'ct_post_settings', 'title' => __('General post options', 'czsablony'), 'pages' => array( 'post' ), 'context' => 'normal', // Where the meta box appear: normal (default), advanced, side. Optional. 'priority' => 'high', 'fields' => array( array( 'name' => __('Show author', 'czsablony'), 'desc' => __('Show or hide author', 'czsablony'), 'id' => "{$prefix}show_author", 'type' => 'checkbox', 'std' => 1, ), array( 'name' => __('Show date', 'czsablony'), 'desc' => __('Show or hide date', 'czsablony'), 'id' => "{$prefix}show_date", 'type' => 'checkbox', 'std' => 1, ), array( 'name' => __('Show comments', 'czsablony'), 'desc' => __('Show or hide comments', 'czsablony'), 'id' => "{$prefix}show_comments", 'type' => 'checkbox', 'std' => 1, ), array( 'name' => __('Show categories', 'czsablony'), 'desc' => __('Show or hide categories', 'czsablony'), 'id' => "{$prefix}show_category", 'type' => 'checkbox', 'std' => 1, ), array( 'name' => __('Show views', 'czsablony'), 'desc' => __('Show or hide views', 'czsablony'), 'id' => "{$prefix}show_views", 'type' => 'checkbox', 'std' => 1, ), array( 'name' => __('Show Thumbnail/Video', 'czsablony'), 'desc' => __('This option show or hide Thumbnail/Video above title.', 'czsablony'), 'id' => "{$prefix}show_thumb", 'type' => 'checkbox', 'std' => 1, ), ) ); // Metabox for Post Format: Gallery $meta_boxes[] = array( 'title' => __('Video Settings', 'czsablony'), 'id' => 'ct_video_format', 'fields' => array( array( 'name' => __('Video Type', 'czsablony'), 'id' => "{$prefix}post_video_type", 'type' => 'select', 'std' => __('Select Type', 'czsablony'), 'options' => array( 'vimeo' => 'Vimeo', 'youtube' => 'Youtube', ), 'multiple' => false, ), array( 'name' => __('Video ID', 'czsablony'), 'id' => "{$prefix}post_video_file", 'desc' => __('Add Video ID (example: 5ESHJKat6ds)', 'czsablony'), 'type' => 'text', 'std' => '', 'clone' => false, ), ) ); /********************* META BOX REGISTERING ***********************/ /** * Register meta boxes * * @return void */ function ct_register_meta_boxes() { // Make sure there's no errors when the plugin is deactivated or during upgrade if ( !class_exists( 'RW_Meta_Box' ) ) return; global $meta_boxes; foreach ( $meta_boxes as $meta_box ) { new RW_Meta_Box( $meta_box ); } } // Hook to 'admin_init' to make sure the meta box class is loaded before // (in case using the meta box class in another plugin) // This is also helpful for some conditionals like checking page template, categories, etc. add_action( 'admin_init', 'ct_register_meta_boxes' );