Classic_Editor::add_meta_boxes()
Add the meta boxes
Source
File: includes/libs/admin/editor/classic-editor.class.php
public function add_meta_boxes(){
global $post;
if( ! $post ){
return;
}
$_post = Helper::get_video_post( $post );
// video post specific meta boxes
if( $_post->is_video() ){
add_meta_box(
'cvm-video-settings',
__( 'Video settings', 'codeflavors-vimeo-video-post-lite' ),
[ $this, 'post_video_settings_meta_box' ],
$post->post_type,
'normal',
'high'
);
add_meta_box(
'cvm-show-video',
__( 'Live video', 'codeflavors-vimeo-video-post-lite' ),
[ $this, 'post_show_video_meta_box' ],
$post->post_type,
'normal',
'high'
);
}else {
/**
* Filter to disable the shortcode metabox in Classic Editor.
*
* @param bool $allow Allow the shortcode meta box (true) or disable it (false).
*/
$allowed = apply_filters( 'vimeotheque\classic_editor\show_shortcode_meta_box', true );
if( true === $allowed && post_type_supports( $post->post_type, 'editor' ) ) {
// Shortcode meta box
add_meta_box(
'cvm-add-video',
__( 'Vimeotheque shortcode',
'codeflavors-vimeo-video-post-lite' ),
[ $this, 'post_shortcode_meta_box' ],
null,
'side',
'low'
);
}
}
}
