Exemplo n.º 1
0
 /**
  * Enqueue compiled wp scripts.
  */
 public function compile_page_scripts()
 {
     if (!beans_get_component_support('wp_scripts_compiler') || !get_option('beans_compile_all_scripts', false) || BEANS_COMPILER_DEV_MODE) {
         return;
     }
     if ($scripts = $this->compile_enqueued('script')) {
         beans_compile_js_fragments('beans', $scripts, array('in_footer' => true, 'version' => null));
     }
 }
Exemplo n.º 2
0
 /**
  * Enqueue compiled wp scripts.
  */
 public function compile_page_scripts()
 {
     if (!beans_get_component_support('wp_scripts_compiler') || !get_option('beans_compile_all_scripts', false) || _beans_is_compiler_dev_mode()) {
         return;
     }
     if ($scripts = $this->compile_enqueued('script')) {
         beans_compile_js_fragments('beans', $scripts, array('in_footer' => 'aggressive' === get_option('beans_compile_all_scripts_mode', 'aggressive') ? true : false, 'version' => null));
     }
 }
Exemplo n.º 3
0
 /**
  * Compile enqueued items.
  */
 function compile()
 {
     global $_beans_uikit_enqueued_items;
     // Set filters for third parties, eventhough it should rarely be used.
     $styles = apply_filters('beans_uikit_euqueued_styles', $this->register_less_components());
     $scripts = apply_filters('beans_uikit_euqueued_scripts', $this->register_js_components());
     // Set default args filters for third parties.
     $styles_args = apply_filters('beans_uikit_euqueued_styles_args', array());
     $scripts_args = apply_filters('beans_uikit_euqueued_scripts_args', array('depedencies' => array('jquery')));
     // Compile less.
     if ($styles) {
         beans_compile_less_fragments('uikit', array_unique($styles), $styles_args);
     }
     // Compile js.
     if ($scripts) {
         beans_compile_js_fragments('uikit', array_unique($scripts), $scripts_args);
     }
 }
Exemplo n.º 4
0
 /**
  * Compile enqueued items.
  */
 function compile()
 {
     global $_beans_uikit_enqueued_items;
     /**
      * Filter UIkit enqueued style components.
      *
      * @since 1.0.0
      *
      * @param array $components An array of UIkit style component files.
      */
     $styles = apply_filters('beans_uikit_euqueued_styles', $this->register_less_components());
     /**
      * Filter UIkit enqueued script components.
      *
      * @since 1.0.0
      *
      * @param array $components An array of UIkit script component files.
      */
     $scripts = apply_filters('beans_uikit_euqueued_scripts', $this->register_js_components());
     /**
      * Filter UIkit style compiler arguments.
      *
      * @since 1.0.0
      *
      * @param array $components An array of UIkit style compiler arguments.
      */
     $styles_args = apply_filters('beans_uikit_euqueued_styles_args', array());
     /**
      * Filter UIkit script compiler arguments.
      *
      * @since 1.0.0
      *
      * @param array $components An array of UIkit script compiler arguments.
      */
     $scripts_args = apply_filters('beans_uikit_euqueued_scripts_args', array('depedencies' => array('jquery')));
     // Compile less.
     if ($styles) {
         beans_compile_less_fragments('uikit', array_unique($styles), $styles_args);
     }
     // Compile js.
     if ($scripts) {
         beans_compile_js_fragments('uikit', array_unique($scripts), $scripts_args);
     }
 }
Exemplo n.º 5
0
function themebutler_euqueue_assets()
{
    $dir = get_stylesheet_directory();
    wp_enqueue_style('themebutler', $dir . '/style.css');
    beans_compile_js_fragments('themebutler', $dir . '/js/demo.js', array('minify_js' => true));
}