Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_filter( 'rwmb_meta_boxes', 'your_prefix_register_meta_boxes' );
- function your_prefix_register_meta_boxes( $meta_boxes ) {
- $prefix = '';
- $meta_boxes[] = array (
- 'title' => esc_html__( 'Document Options', 'text-domain' ),
- 'id' => 'document-options',
- 'post_types' => array(
- 0 => 'document',
- ),
- 'context' => 'normal',
- 'priority' => 'high',
- 'validation' => array (
- 'rules' => array(
- 'file_upload_x3h8w2hgtqg' => array(
- 'extension' => "pdf",
- // More rules here
- ),
- // Rules for other fields
- ),
- ),
- 'fields' => array(
- array (
- 'id' => $prefix . 'wysiwyg_rv3nfg4gl9',
- 'name' => esc_html__( 'Description of Document Set', 'text-domain' ),
- 'type' => 'wysiwyg',
- 'options' => array(
- 'media_buttons' => false,
- ),
- ),
- array (
- 'id' => $prefix . 'file_upload_x3h8w2hgtqg',
- 'type' => 'file_upload',
- 'name' => esc_html__( 'File upload', 'text-domain' ),
- 'max_status' => 1,
- 'force_delete' => 1,
- ),
- array (
- 'id' => $prefix . 'user_c33ln3ltujc',
- 'type' => 'user',
- 'name' => esc_html__( 'User', 'text-domain' ),
- 'field_type' => 'select_advanced',
- 'multiple' => true,
- ),
- ),
- );
- return $meta_boxes;
- }
Add Comment
Please, Sign In to add comment