'Best', // Meta box title - Will appear at the drag and drop handle bar 'title' => __('Slide', 'best'), // Post types, accept custom post types as well - DEFAULT is array('post'); (optional) 'pages' => array( 'post', 'page'), // Where the meta box appear: normal (default), advanced, side; optional 'context' => 'normal', // Order of meta box: high (default), low; optional 'priority' => 'high', // List of meta fields 'fields' => array( //INTRO - TEXT array( 'name' => __('Intro text', 'best'), 'desc' => __('One sentence intro text, displayed below the post title', 'best'), 'id' => $prefix . 'intro', 'type' => 'textarea', 'cols' => '40', 'rows' => '3' ), // COVER - IMAGE UPLOAD array( 'name' => __('Best cover image', 'best'), 'desc' => __('Best cover displayed next to the title with Slide posts', 'best'), 'id' => $prefix . 'cover', 'type' => 'image' ) ) ); /********************* META BOX REGISTERING ***********************/ /** * Register meta boxes * * @return void */ function Best_register_meta_boxes() { global $meta_boxes; // Make sure there's no errors when the plugin is deactivated or during upgrade if ( class_exists( 'RW_Meta_Box' ) ) { 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', 'Best_register_meta_boxes' );