SHARE
TWEET

Ajout de champs custom fields à une taxonomie WordPress #2

pskli Mar 24th, 2013 138 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. require_once(get_template_directory() . '/inc/Tax-meta-class/Tax-meta-class.php');
  4.  
  5. if (is_admin()){
  6.  
  7.         $config = array(
  8.                 'id' => 'serie_metabox',
  9.                 'title' => 'Information sur cette série',
  10.                 'pages' => array('serie'),
  11.                 'context' => 'normal',
  12.                 'fields' => array(),
  13.                 'local_images' => true,
  14.                 'use_with_theme' => get_template_directory_uri() . '/inc/Tax-meta-class'
  15.         );
  16.  
  17.         $serie_metabox =  new Tax_Meta_Class($config);
  18.  
  19.         $serie_metabox->addText(
  20.                 'difficulty',
  21.                 array(
  22.                         'name'=> 'Difficulté'
  23.                 )
  24.         );
  25.  
  26.         $serie_metabox->addImage(
  27.                 'image',
  28.                 array(
  29.                         'name'=> 'Image'
  30.                 )
  31.         );
  32.  
  33.         $serie_metabox->Finish();
  34. }
  35.  
  36. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top