Advertisement
pskli

Ajout de champs custom fields à une taxonomie WordPress #2

Mar 24th, 2013
508
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.64 KB | None | 0 0
  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. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement