- This topic has 1 reply, 2 voices, and was last updated 2 years, 3 months ago by .
-
Topic
-
Is it possible to setup 2 metaboxes with different array names? For instance:
$meta_boxes_announcements[] = array() and $meta_boxes[] = array()add_filter( 'rwmb_meta_boxes', 'announcements_register_meta_boxes' ); function announcements_register_meta_boxes( $meta_boxes ) { $prefix = 'announcements_'; $meta_boxes_announcements[] = array( 'id' => 'announcements', 'title' => 'Announcements Meta', 'post_types' => 'announcements', 'fields' => array( // DATE array( 'name' => __( 'Event Date - If nothing is entered here, the post publish date will be used', 'announcements_' ), 'id' => "{$prefix}display_date", 'type' => 'date', ), ) ); return $meta_boxes_announcements; } add_filter( 'rwmb_meta_boxes', 'register_meta_boxes' ); function register_meta_boxes( $meta_boxes ) { $prefix = 'uu_'; $meta_boxes[] = array( 'id' => 'uu_metabox', 'title' => 'My Metabox', 'post_types' => 'post', 'fields' => array( // DATE array( 'name' => __( 'Event Date - If nothing is entered here, the post publish date will be used', 'announcements_' ), 'id' => "{$prefix}display_date", 'type' => 'date', ), ) ); return $meta_boxes; }
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- You must be logged in to reply to this topic.