Forked from kutoi94/Create Post Field in Meta Box Plugin
Last active
July 27, 2019 07:22
-
-
Save rilwis/f7fd5e3b388ea9d005cd49ce4d85bf11 to your computer and use it in GitHub Desktop.
Create Post Field in Meta Box Plugin
This file contains hidden or 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
<?php | |
add_filter( 'rwmb_meta_boxes', 'your_prefix_register_meta_boxes' ); | |
function your_prefix_register_meta_boxes( $meta_boxes ) { | |
$meta_boxes[] = array ( | |
'title' => 'Related Post', | |
'id' => 'related-post', | |
'post_types' => array( | |
0 => 'post', | |
), | |
'context' => 'normal', | |
'priority' => 'high', | |
'fields' => array( | |
array ( | |
'id' => 'related_posts', | |
'type' => 'post', | |
'name' => 'Related Posts', | |
'desc' => 'Choose 3 Related Posts', | |
'post_type' => array( | |
0 => 'post', | |
1 => 'page', | |
), | |
'field_type' => 'select_advanced', | |
'multiple' => true, | |
'required' => 1, | |
), | |
), | |
); | |
return $meta_boxes; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment