Skip to content

Instantly share code, notes, and snippets.

@shubham-99fusion
Created March 5, 2019 08:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shubham-99fusion/715f2eda8806f4c8b8106cd8ef546158 to your computer and use it in GitHub Desktop.
Save shubham-99fusion/715f2eda8806f4c8b8106cd8ef546158 to your computer and use it in GitHub Desktop.
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