Advertisement
Guest User

My Tax Meta Class

a guest
May 6th, 2013
435
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.27 KB | None | 0 0
  1. //include the main class file
  2. require_once("Tax-meta-class/Tax-meta-class.php");
  3. if (is_admin()){
  4.   /*
  5.    * prefix of meta keys, optional
  6.    */
  7.   $prefix = 'gh_';
  8.   /*
  9.    * configure your meta box
  10.    */
  11.   $config = array(
  12.     'id' => 'products_meta_box',          // meta box id, unique per meta box
  13.     'title' => 'Products Meta Box',          // meta box title
  14.     'pages' => array('food'),        // taxonomy name, accept categories, post_tag and custom taxonomies
  15.     'context' => 'normal',            // where the meta box appear: normal (default), advanced, side; optional
  16.     'fields' => array(),            // list of meta fields (can be added by field arrays)
  17.     'local_images' => false,          // Use local or hosted images (meta box images for add/remove)
  18.     'use_with_theme' => true          //change path if used with theme set to true, false for a plugin or anything else for a custom path(default false).
  19.   );
  20.  
  21.  /*
  22.    * Initiate your meta box
  23.    */
  24.   $my_meta =  new Tax_Meta_Class($config);
  25.  
  26.   /*
  27.    * Add fields to your meta box
  28.    */
  29.  
  30.   //text field
  31.   $my_meta->addText($prefix.'text_field_id',array('name'=> __('price ','tax-meta')));
  32.  
  33.   /*
  34.    * Don't Forget to Close up the meta box decleration
  35.    */
  36.   //Finish Meta Box Decleration
  37.   $my_meta->Finish();
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement