コード例 #1
0
 /**
  * Constructor.
  *
  * @since  1.0.0
  */
 public function __construct()
 {
     parent::__construct(array('singular' => 'member', 'plural' => 'members', 'ajax' => false));
     add_action('ms_helper_listtable_searchbox_start', array($this, 'searchbox_filters'));
     $memberships = MS_Model_Membership::get_memberships(array('include_guest' => 0));
     self::$memberships = array();
     foreach ($memberships as $item) {
         self::$memberships[$item->id] = (object) array('label' => $item->name, 'attr' => sprintf('data-color="%1$s"', $item->get_color()));
     }
 }
コード例 #2
0
 /**
  * Initialize the list table
  *
  * @since  1.0.0
  * @param MS_Rule $model Rule-Model
  */
 public function __construct($model)
 {
     parent::__construct(array('singular' => 'rule_' . $this->id, 'plural' => 'rules_' . $this->id, 'ajax' => false));
     $this->name['singular'] = __('Item', 'membership2');
     $this->name['plural'] = __('Items', 'membership2');
     $this->name['default_access'] = __('Everyone', 'membership2');
     $this->model = $model;
     $this->membership = MS_Model_Membership::get_base();
     $memberships = MS_Model_Membership::get_memberships();
     self::$memberships = array();
     foreach ($memberships as $item) {
         self::$memberships[$item->id] = (object) array('label' => $item->name, 'attr' => sprintf('data-color="%1$s"', $item->get_color()));
     }
     // Add code right before the bulk actions are displayed.
     add_action('ms_listtable_before_bulk_actions', array($this, 'add_rule_type'));
 }
コード例 #3
0
 public function __construct()
 {
     parent::__construct(array('singular' => 'event', 'plural' => 'events', 'ajax' => false));
 }
 /**
  * Constructor, defines general list table attributes.
  *
  * @since  1.0.0
  */
 public function __construct()
 {
     // 'singular' just added for fun...
     // 'plural' is used as class name for the list.
     parent::__construct(array('singular' => 'transaction', 'plural' => 'transactions'));
 }
 public function __construct()
 {
     parent::__construct(array('singular' => 'membership', 'plural' => 'memberships', 'ajax' => false));
 }
 /**
  * Custom display function to hide item table for invalid filter options.
  *
  * @since  1.0.1.2
  */
 public function display()
 {
     if (MS_Model_Import::can_match($this->matching_type_id, $this->matching_type)) {
         parent::display();
     }
 }
 /**
  * Custom display function to hide item table for invalid filter options.
  *
  * @since  1.0.1.2
  */
 public function display()
 {
     if (MS_Model_Import::can_match($this->source_id, $this->source)) {
         parent::display();
     }
 }