-
Notifications
You must be signed in to change notification settings - Fork 17
/
bootstrap.php
48 lines (43 loc) · 1.44 KB
/
bootstrap.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
/**
* WordPress Dynamic CSS
*
* Dynamic CSS compiler for WordPress
*
* @package wp-dynamic-css
* @author Askupa Software <[email protected]>
* @link https://github.com/askupasoftware/wp-dynamic-css
* @copyright 2016 Askupa Software
*
* @wordpress-plugin
* Plugin Name: WordPress Dynamic CSS
* Plugin URI: https://github.com/askupasoftware/wp-dynamic-css
* Description: Dynamic CSS compiler for WordPress
* Version: 1.0.5
* Author: Askupa Software
* Author URI: http://www.askupasoftware.com
* Text Domain: wp-dynamic-css
* Domain Path: /languages
*/
defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
/**
* Prevent loading the library more than once
*/
if( defined( 'WP_DYNAMIC_CSS' ) ) return;
define( 'WP_DYNAMIC_CSS', true );
/**
* Load required files
*/
require_once dirname(__FILE__).'/compiler.php';
require_once dirname(__FILE__).'/cache.php';
require_once dirname(__FILE__).'/functions.php';
/**
* The following actions are used for printing or loading the compiled
* stylesheets externally.
* Priority is set to high (100) to allow the dynamic CSS to override static
* styles.
*/
$dcss = DynamicCSSCompiler::get_instance();
add_action( 'wp_enqueue_scripts', array( $dcss, 'enqueue_styles' ), 100 );
add_action( 'wp_ajax_wp_dynamic_css', array( $dcss, 'ajax_callback' ) );
add_action( 'wp_ajax_nopriv_wp_dynamic_css', array( $dcss, 'ajax_callback' ) );