Created
March 5, 2019 08:50
-
-
Save shubham-99fusion/715f2eda8806f4c8b8106cd8ef546158 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter('wplms_course_metabox',function($args){ | |
$args['vibe_app_course_description']=array( // Text Input | |
'label' => __('App Course description','vibe-customtypes'), // <label> | |
'desc' => __('This descrption is shown in App as course description'), // description | |
'id' => 'vibe_app_course_description', // field id and name | |
'type' => 'editor', // type of field | |
'std' => __('This message is shown as course description in app','vibe-customtypes') | |
); | |
return $args; | |
}); | |
add_filter('bp_course_api_get_course',function($data,$request){ | |
if($request['context'] == 'full' || $request['context'] == 'loggedin'){ | |
$data[0]->data['description']=do_shortcode(get_post_meta( $request['id'],'vibe_app_course_description',true) ); | |
} | |
return $data; | |
},10,2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment