Пример #1
0
 public function __construct(WPLessConfiguration $configuration)
 {
     parent::__construct($configuration);
     $this->compiler = new WPLessCompiler();
     $this->compiler->setVariable('stylesheet_directory_uri', "'" . get_stylesheet_directory_uri() . "'");
     $this->compiler->setVariable('template_directory_uri', "'" . get_template_directory_uri() . "'");
 }
Пример #2
0
/**
 * Creates easily a SCSS function to be replaced on compilation
 *
 * @author oncletom
 * @since 1.4.2
 * @version 1.0
 * @param string $name
 * @param string $callback
 * @return null
 */
function scss_register_function($name, $callback)
{
    WPPluginToolkitPlugin::getInstance('WPScss')->registerFunction($name, $callback);
}
Пример #3
0
 public function __construct(WPLessConfiguration $configuration)
 {
     parent::__construct($configuration);
     WPLessStylesheet::$upload_dir = $this->configuration->getUploadDir();
     WPLessStylesheet::$upload_uri = $this->configuration->getUploadUrl();
 }
Пример #4
0
 *
 * And to apply automatic building on page display:
 * `add_action('wp_print_styles', array($WPScssPlugin, 'processStylesheets'));`
 * Or apply all hooks with:
 * `$WPScssPlugin->dispatch();`
 *
 * You can rebuild all stylesheets at any time with:
 * `$WPScssPlugin->processStylesheets();`
 *
 * Or a specific stylesheet:
 * `wp_enqueue_style('my_css', 'path/to/my/style.css');`
 * `$WPScssPlugin->processStylesheet('my_css');`
 *
 * = Filters and hooks aren't enough =
 *
 * Build your own flavour and manage it the way you want. Simply extends WPScssPlugin and/or WPScssConfiguration.
 * Dig in the code to see what to configure. I tried to make things customizable without extending classes!
 */
/*
 * This will be effective only if the plugin is not activated.
 * You can then redistribute your theme with this loader fearscssly.
 */
if (!class_exists('WPScssPlugin')) {
    require dirname(__FILE__) . '/lib/Plugin.class.php';
    $WPScssPlugin = WPPluginToolkitPlugin::create('WPScss', __FILE__, 'WPScssPlugin');
    //READY and WORKING
    //add_action('after_setup_theme', array($WPScssPlugin, 'install'));
    // NOT WORKING
    //@see http://core.trac.wordpress.org/ticket/14955
    //add_action('uninstall_theme', array($WPScssPlugin, 'uninstall'));
}
Пример #5
0
 public function __construct(WPLessConfiguration $configuration)
 {
     parent::__construct($configuration);
 }
<?php

/*
Plugin Name: WP LESS
Description: LESS extends CSS with variables, mixins, operations and nested rules. This plugin magically parse all your <code>*.less</code> files queued with <code>wp_enqueue_style</code> in WordPress.
Author: Oncle Tom
Version: 1.4.2
Author URI: http://case.oncle-tom.net/
Plugin URI: http://wordpress.org/extend/plugins/wp-less/

  This plugin is released under version 3 of the GPL:
  http://www.opensource.org/licenses/gpl-3.0.html
*/
require dirname(__FILE__) . '/lib/Plugin.class.php';
$WPLessPlugin = WPPluginToolkitPlugin::create('WPLess', __FILE__);
$WPLessPlugin->dispatch();
Пример #7
0
 public function __construct(WPLessConfiguration $configuration)
 {
     parent::__construct($configuration);
     $this->resetCompiler();
 }