Пример #1
0
 public function __construct($namespace, $properties)
 {
     // Verify there's a render callback saved
     if (!is_array($properties['callbacks']) || !isset($properties['callbacks']['render'])) {
         throw new Exception("Render callback must be defined");
     }
     $this->default_properties = array();
     parent::__construct($namespace, $properties);
 }
 public function __construct($namespace, $properties)
 {
     $this->default_properties = array('checked' => false, 'admin-column' => array('label-checked' => 'Yes', 'label-unchecked' => 'No'));
     parent::__construct($namespace, $properties);
 }
Пример #3
0
 public function __construct($namespace, $properties)
 {
     $this->default_properties = array('dateFormat' => 'yy-mm-dd');
     parent::__construct($namespace, $properties);
     add_action('admin_footer', array($this, 'render_js'));
 }
 public function __construct($namespace, $properties)
 {
     $this->default_properties = array();
     parent::__construct($namespace, $properties);
 }
Пример #5
0
 /**
  * Retrieves the value
  *
  * @return void
  * @author Erik Hedberg (erik@webbgaraget.se)
  */
 public function get_value()
 {
     $value = parent::get_value();
     // In case of default value
     if (!$value || !array_key_exists($value, $this->properties['options'])) {
         // Default value
         if (isset($this->properties['default'])) {
             return '0';
         }
         // Otherwise, there's no value
         return null;
     }
     return $value;
 }