Advertisement
leadbellydesign

meta-box-script-wp

Sep 12th, 2011
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.88 KB | None | 0 0
  1. // prefix of meta keys, optional
  2. // use underscore (_) at the beginning to make keys hidden, for example $prefix = '_rw_';
  3. // you also can make prefix empty to disable it
  4. $prefix = 'faf_';
  5.  
  6. $meta_boxes = array();
  7.  
  8. // first meta box
  9. $meta_boxes[] = array(
  10.     'id' => 'faf',
  11.     'title' => 'Custom Food & Fitness Content',
  12.     'pages' => array('page'), // multiple post types, accept custom post types
  13.     'context' => 'normal', // normal, advanced, side (optional)
  14.     'priority' => 'high', // high, low (optional)
  15.     'fields' => array(
  16.             array(
  17.             'name' => 'Author Byline',
  18.             'desc' => 'Enter author name',
  19.             'id' => $prefix . 'byline',
  20.             'type' => 'text' // text box
  21.         ),
  22.         array(
  23.             'name' => 'Author Bio',
  24.             'desc' => 'Enter author bio here',
  25.             'id' => $prefix . 'authorBio',
  26.             'type' => 'textarea' // text area
  27.         )
  28.     )
  29. );
  30.  
  31. foreach ($meta_boxes as $meta_box) {
  32.     $my_box = new RW_Meta_Box($meta_box);
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement