Skip to content

Instantly share code, notes, and snippets.

@MrVibe
Last active May 22, 2020 15:11
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 MrVibe/e251e32b583f6940803a71450185378c to your computer and use it in GitHub Desktop.
Save MrVibe/e251e32b583f6940803a71450185378c to your computer and use it in GitHub Desktop.
Load different Unit content from Meta in API
//video so app
add_filter('wplms_unit_metabox',function($box){
$box[]=array( // Single checkbox
'label' => __('Unit Content for App','vibe-customtypes'), // <label>
'desc' => __('Unit Content for App.','vibe-customtypes'), // description
'id' => 'vibe_app_content', // field id and name
'type' => 'editor', // type of field
'std' => ''
);
return $box;
});
add_filter('vibe_wplms_api_unit_content',function($content,$post){
$app_content = get_post_meta($post->ID,'vibe_app_content',true);
if(strlen($app_content) > 2){
return $app_content;
}
return $content;
},10,2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment