示例#1
0
 /**
  * Checks if an asset is registered
  *
  * @since 1.0.0
  *
  * @param string $handle Specify either the full dot notation path to the asset handle (i.e. with the config)
  *                          or just the handle itself.  If only the handle, then we use $is_js to find the
  *                          the asset handle's full path.
  * @param bool|true $is_js
  * @return bool
  */
 public function is_registered($handle, $is_js = true)
 {
     if (!wpdevsclub_str_contains($handle, '.')) {
         $handle = $is_js ? 'wp_enqueue_scripts.wp_enqueue_script.' . $handle : 'wp_enqueue_scripts.wp_enqueue_style.' . $handle;
     }
     return $this->registered_assets_config->has($handle);
 }
示例#2
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);
 }
示例#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);
     }
 }
示例#4
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');
 }