Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $meta_boxes[] = array(
- 'id' => 'cat_pagebanner',
- 'title' => __( 'Page banner', 'mytheme' ),
- 'taxonomies' => 'category',
- 'context' => 'normal',
- 'priority' => 'high',
- 'fields' => array(
- // Banner content
- array(
- 'name' => esc_html__( 'Banner content', 'mytheme' ),
- 'desc' => esc_html__( 'This is the content that will display in the banner', 'mytheme' ),
- 'id' => "{$prefix}cat_banner_text",
- 'type' => 'wysiwyg',
- ),
- // Banner background color
- array(
- 'name' => __( 'Background color', 'mytheme' ),
- 'id' => $prefix . 'cat_bg-color',
- 'type' => 'color',
- 'js_options'=> array(
- 'palettes' => array( '#F3C5C6', '#A2C7C5', '#F8D687', '#FFF', '#444' ),
- ),
- ),
- // Banner image = IMAGE ADVANCED - RECOMMENDED
- array(
- 'name' => esc_html__( 'Banner background image', 'mytheme' ),
- 'id' => "{$prefix}cat_banner_image",
- 'type' => 'image_advanced',
- // Delete image from Media Library when remove it from post meta?
- // Note: it might affect other posts if you use same image for multiple posts
- 'force_delete' => false,
- // Maximum image uploads
- 'max_file_uploads' => 1,
- // Display the "Uploaded 1/2 files" status
- 'max_status' => false,
- ),
- // Banner background image position
- array(
- 'name' => esc_html__( 'Banner background image position', 'mytheme' ),
- 'id' => "{$prefix}cat_banner_bgpos",
- 'type' => 'select',
- // Array of 'value' => 'Label' pairs
- 'options' => array(
- 'left top' => 'Left top',
- 'left center' => 'Left center',
- 'left bottom' => 'Left bottom',
- 'center top' => 'Center top',
- 'center center' => 'Center center',
- 'center bottom' => 'Center bottom',
- 'right top' => 'Right top',
- 'right center' => 'Right center',
- 'right bottom' => 'Right bottom',
- ),
- // Allow to select multiple value?
- 'multiple' => false,
- // Placeholder text
- 'placeholder' => esc_html__( 'Select a position', 'mytheme' ),
- // Display "Select All / None" button?
- 'select_all_none' => false,
- ),
- )
- );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement