pskli

Ajout de champs custom fields à une taxonomie WordPress #2

Mar 24th, 2013
209
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

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×