Exemplo n.º 1
0
 /**
  * Wrapper which checks if the parameter exists in $config.
  *
  * @since 1.0.0
  *
  * @param string $parameter
  *
  * @return bool
  */
 public function config_has($parameter)
 {
     if (empty($this->config)) {
         return false;
     }
     return $this->config->has($parameter);
 }
Exemplo n.º 2
0
 /**
  * Initialize Widgets
  *
  * @since 1.0.0
  *
  * @return null
  */
 public function widgets_init()
 {
     if ($this->config->is_array('widgets')) {
         $this->register_widgets($this->config->widgets);
     }
     do_action('wpdevsclub_widget_init', $this);
 }
Exemplo n.º 3
0
 /**
  * Register formatters, if configured
  *
  * @since 1.0.0
  *
  * @return null
  */
 protected function register_formatters()
 {
     if ($this->config->has('formatter_html')) {
         $this->core->register_formatter($this->config->formatter_html);
     }
 }
Exemplo n.º 4
0
 /**
  * Register the resource with the Manager
  *
  * @since 1.0.0
  *
  * @param I_Config $config
  * @return bool
  */
 public function register(I_Config $config)
 {
     if (is_null($this->registered_assets_config)) {
         $this->registered_assets_config = $config;
         return;
     }
     $this->registered_assets_config->merge($config->all());
 }
Exemplo n.º 5
0
 /**
  * Initialize properties
  *
  * @since 1.0.0
  *
  * @param I_Config $config
  * @return null
  */
 protected function init_properties(I_Config $config)
 {
     $this->config = $config;
     array_walk($config->all(), function ($value, $property) {
         $this->{$property} = $value;
     });
 }
Exemplo n.º 6
0
 /**
  * Checks whether to use the limit_to_template check for this screen.
  *
  * @since 2.0.0
  *
  * @return bool
  */
 protected function use_limit_to_template_check()
 {
     return $this->config->has('limit_to_template.template') && $this->config->limit_to_template['template'] && $this->config->limit_to_template['template'] && $this->config->is_array('limit_to_template.screen');
 }