/** * 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); }
/** * 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); }
/** * 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); } }
/** * 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()); }
/** * 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; }); }
/** * 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'); }