Advertisement
Guest User

Untitled

a guest
Feb 1st, 2018
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.34 KB | None | 0 0
  1. $meta_boxes[] = array(
  2.         'id'         => 'cat_pagebanner',
  3.         'title'      => __( 'Page banner', 'mytheme' ),
  4.         'taxonomies' => 'category',
  5.         'context'    => 'normal',
  6.         'priority'   => 'high',
  7.         'fields' => array(
  8.             // Banner content
  9.             array(
  10.                 'name' => esc_html__( 'Banner content', 'mytheme' ),
  11.                 'desc' => esc_html__( 'This is the content that will display in the banner', 'mytheme' ),
  12.                 'id'   => "{$prefix}cat_banner_text",
  13.                 'type' => 'wysiwyg',
  14.             ), 
  15.             // Banner background color
  16.             array(
  17.                 'name'      => __( 'Background color', 'mytheme' ),
  18.                 'id'        => $prefix . 'cat_bg-color',
  19.                 'type'      => 'color',
  20.                 'js_options'=> array(
  21.                 'palettes' => array( '#F3C5C6', '#A2C7C5', '#F8D687', '#FFF', '#444' ),
  22.                 ),
  23.             ),
  24.             // Banner image = IMAGE ADVANCED - RECOMMENDED
  25.             array(
  26.                 'name'             => esc_html__( 'Banner background image', 'mytheme' ),
  27.                 'id'               => "{$prefix}cat_banner_image",
  28.                 'type'             => 'image_advanced',
  29.  
  30.                 // Delete image from Media Library when remove it from post meta?
  31.                 // Note: it might affect other posts if you use same image for multiple posts
  32.                 'force_delete'     => false,
  33.  
  34.                 // Maximum image uploads
  35.                 'max_file_uploads' => 1,
  36.  
  37.                 // Display the "Uploaded 1/2 files" status
  38.                 'max_status'       => false,
  39.             ),
  40.             // Banner background image position
  41.             array(
  42.                 'name'            => esc_html__( 'Banner background image position', 'mytheme' ),
  43.                 'id'              => "{$prefix}cat_banner_bgpos",
  44.                 'type'            => 'select',
  45.                 // Array of 'value' => 'Label' pairs
  46.                 'options'         => array(
  47.                     'left top'      => 'Left top',
  48.                     'left center'   => 'Left center',
  49.                     'left bottom'   => 'Left bottom',
  50.                     'center top'    => 'Center top',
  51.                     'center center' => 'Center center',
  52.                     'center bottom' => 'Center bottom',
  53.                     'right top'     => 'Right top',
  54.                     'right center'  => 'Right center',
  55.                     'right bottom'  => 'Right bottom',
  56.                 ),
  57.                 // Allow to select multiple value?
  58.                 'multiple'        => false,
  59.                 // Placeholder text
  60.                 'placeholder'     => esc_html__( 'Select a position', 'mytheme' ),
  61.                 // Display "Select All / None" button?
  62.                 'select_all_none' => false,
  63.             ),
  64.         )
  65.     );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement