public function admin_register_meta_box_attributes()
 {
     $meta_box = new MetaBox('attributes', __('Attributes', 'wpk15'));
     $meta_box->add_field('price', __('Price', 'wpk15'), function () {
         $field = new Number();
         $field->set_min(0.0);
         return $field;
     });
     $meta_box->add_field('in-stock', __('In Stock', 'wpk15'), 'Checkbox');
     $meta_box->add_post_type($this->_post_type_product);
 }
예제 #2
0
파일: PostType.php 프로젝트: jar-laks/wpkit
 /**
  * Attach a meta box that will be used with this post type
  *
  * @param MetaBox $meta_box meta box object
  */
 public function add_meta_box(MetaBox $meta_box)
 {
     $meta_box->add_post_type($this);
 }