Last active
May 22, 2020 15:11
-
-
Save MrVibe/e251e32b583f6940803a71450185378c to your computer and use it in GitHub Desktop.
Load different Unit content from Meta in API
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
//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