コード例 #1
0
 /**
  * Adds fields.
  *
  * @internal
  * @since 0.5.0
  * @param array $fields the fields to add as $field_slug => $field_args
  * @param WPPTD\Components\Metabox $metabox the metabox to add the fields to
  */
 protected function add_fields($fields, $metabox)
 {
     foreach ($fields as $field_slug => $field_args) {
         $field = $metabox->add(new Field($field_slug, $field_args));
         if (is_wp_error($field)) {
             self::doing_it_wrong(__METHOD__, $field->get_error_message(), '0.5.0');
         }
     }
 }
コード例 #2
0
 /**
  * Class constructor.
  *
  * @since 0.6.0
  * @param string $slug the metabox slug
  * @param array $args array of metabox properties
  */
 public function __construct($slug, $args)
 {
     parent::__construct($slug, $args);
     $this->validate_filter = 'wpptd_term_metabox_validated';
 }