TJ Custom CSS - Version 0.1.1

Version Description

  • 8/18/2014 =
  • Allow html entities in css selector eg. #id > .class
Download this release

Release Info

Developer themejunkie
Plugin Icon wp plugin TJ Custom CSS
Version 0.1.1
Comparing to
See all releases

Code changes from version 0.1.0 to 0.1.1

Files changed (5) hide show
  1. admin/admin.php +4 -13
  2. admin/customize.php +4 -8
  3. inc/functions.php +3 -5
  4. readme.txt +5 -2
  5. tj-custom-css.php +1 -11
admin/admin.php CHANGED
@@ -9,17 +9,10 @@
9
  * @license http://www.gnu.org/licenses/gpl-2.0.html
10
  */
11
 
12
- /* Add the custom css menu. */
13
- add_action( 'admin_menu', 'tjcc_custom_css_menu', 20 );
14
-
15
- /* Register setting. */
16
- add_action( 'admin_init', 'tjcc_register_setting' );
17
-
18
  /**
19
  * Add the custom css menu to the admin menu.
20
  *
21
  * @since 0.1.0
22
- * @access public
23
  * @link http://codex.wordpress.org/Function_Reference/add_theme_page
24
  */
25
  function tjcc_custom_css_menu() {
@@ -40,12 +33,12 @@ function tjcc_custom_css_menu() {
40
  add_action( 'load-' . $setting, 'tjcc_scripts' );
41
 
42
  }
 
43
 
44
  /**
45
  * Load scripts and styles for the custom css page.
46
  *
47
  * @since 0.1.0
48
- * @access public
49
  * @link http://codex.wordpress.org/Function_Reference/wp_enqueue_script
50
  * @link http://codex.wordpress.org/Function_Reference/wp_enqueue_style
51
  */
@@ -67,7 +60,6 @@ function tjcc_scripts() {
67
  * Register the custom css setting.
68
  *
69
  * @since 0.1.0
70
- * @access public
71
  * @link http://codex.wordpress.org/Function_Reference/register_setting
72
  */
73
  function tjcc_register_setting() {
@@ -79,12 +71,12 @@ function tjcc_register_setting() {
79
  );
80
 
81
  }
 
82
 
83
  /**
84
  * Render the custom CSS page
85
  *
86
  * @since 0.1.0
87
- * @access public
88
  */
89
  function tjcc_custom_css_page() {
90
  $options = get_option( 'tj_custom_css' );
@@ -94,7 +86,7 @@ function tjcc_custom_css_page() {
94
  <div class="wrap">
95
 
96
  <h2><?php _e( 'Theme Junkie Custom CSS', 'tjcc' ) ?></h2>
97
- <p><?php printf( __( 'Hi There, thanks for using our plugin we hope you will enjoy it. Check out our %1$sPremium WordPress Themes%2$s.', 'scrolltop' ), '<a href="http://www.theme-junkie.com/" target="_blank"><strong>', '</strong></a>' ); ?></p>
98
 
99
  <?php settings_errors(); ?>
100
 
@@ -143,9 +135,8 @@ function tjcc_custom_css_page() {
143
  * Sanitize and validate form input.
144
  *
145
  * @since 0.1.0
146
- * @access public
147
  */
148
  function tj_custom_css_setting_validate( $input ) {
149
- $input['custom_css'] = wp_filter_nohtml_kses( $input['custom_css'] );
150
  return $input;
151
  }
9
  * @license http://www.gnu.org/licenses/gpl-2.0.html
10
  */
11
 
 
 
 
 
 
 
12
  /**
13
  * Add the custom css menu to the admin menu.
14
  *
15
  * @since 0.1.0
 
16
  * @link http://codex.wordpress.org/Function_Reference/add_theme_page
17
  */
18
  function tjcc_custom_css_menu() {
33
  add_action( 'load-' . $setting, 'tjcc_scripts' );
34
 
35
  }
36
+ add_action( 'admin_menu', 'tjcc_custom_css_menu', 20 );
37
 
38
  /**
39
  * Load scripts and styles for the custom css page.
40
  *
41
  * @since 0.1.0
 
42
  * @link http://codex.wordpress.org/Function_Reference/wp_enqueue_script
43
  * @link http://codex.wordpress.org/Function_Reference/wp_enqueue_style
44
  */
60
  * Register the custom css setting.
61
  *
62
  * @since 0.1.0
 
63
  * @link http://codex.wordpress.org/Function_Reference/register_setting
64
  */
65
  function tjcc_register_setting() {
71
  );
72
 
73
  }
74
+ add_action( 'admin_init', 'tjcc_register_setting' );
75
 
76
  /**
77
  * Render the custom CSS page
78
  *
79
  * @since 0.1.0
 
80
  */
81
  function tjcc_custom_css_page() {
82
  $options = get_option( 'tj_custom_css' );
86
  <div class="wrap">
87
 
88
  <h2><?php _e( 'Theme Junkie Custom CSS', 'tjcc' ) ?></h2>
89
+ <p><?php printf( __( 'Hi There, thanks for using our plugin we hope you will enjoy it. Check out our %1$sPremium WordPress Themes%2$s.', 'tjcc' ), '<a href="http://www.theme-junkie.com/" target="_blank"><strong>', '</strong></a>' ); ?></p>
90
 
91
  <?php settings_errors(); ?>
92
 
135
  * Sanitize and validate form input.
136
  *
137
  * @since 0.1.0
 
138
  */
139
  function tj_custom_css_setting_validate( $input ) {
140
+ $input['custom_css'] = stripslashes( $input['custom_css'] );
141
  return $input;
142
  }
admin/customize.php CHANGED
@@ -10,12 +10,6 @@
10
  * @license http://www.gnu.org/licenses/gpl-2.0.html
11
  */
12
 
13
- /* Load textarea function for customizer. */
14
- add_action( 'customize_register', 'tjcc_textarea_customize_control', 1 );
15
-
16
- /* Register custom sections, settings, and controls. */
17
- add_action( 'customize_register', 'tjcc_register_customize' );
18
-
19
  /**
20
  * Load textarea function for customizer.
21
  *
@@ -25,6 +19,7 @@ add_action( 'customize_register', 'tjcc_register_customize' );
25
  function tjcc_textarea_customize_control() {
26
  require_once( TJCC_ADMIN . 'customize-control-textarea.php' );
27
  }
 
28
 
29
  /**
30
  * Register customizer.
@@ -46,7 +41,7 @@ function tjcc_register_customize( $wp_customize ) {
46
  array(
47
  'type' => 'option',
48
  'capability' => 'edit_theme_options',
49
- 'sanitize_callback' => 'wp_filter_nohtml_kses'
50
  )
51
  );
52
 
@@ -58,4 +53,5 @@ function tjcc_register_customize( $wp_customize ) {
58
  )
59
  ) );
60
 
61
- }
 
10
  * @license http://www.gnu.org/licenses/gpl-2.0.html
11
  */
12
 
 
 
 
 
 
 
13
  /**
14
  * Load textarea function for customizer.
15
  *
19
  function tjcc_textarea_customize_control() {
20
  require_once( TJCC_ADMIN . 'customize-control-textarea.php' );
21
  }
22
+ add_action( 'customize_register', 'tjcc_textarea_customize_control', 1 );
23
 
24
  /**
25
  * Register customizer.
41
  array(
42
  'type' => 'option',
43
  'capability' => 'edit_theme_options',
44
+ 'sanitize_callback' => 'stripslashes'
45
  )
46
  );
47
 
53
  )
54
  ) );
55
 
56
+ }
57
+ add_action( 'customize_register', 'tjcc_register_customize' );
inc/functions.php CHANGED
@@ -9,9 +9,6 @@
9
  * @license http://www.gnu.org/licenses/gpl-2.0.html
10
  */
11
 
12
- /* Output the custom css to the wp_head. */
13
- add_action( 'wp_head', 'tjcc_get_custom_css', 20 );
14
-
15
  /**
16
  * Get the custom css value and display it on front-end
17
  *
@@ -26,11 +23,12 @@ function tjcc_get_custom_css() {
26
  if ( $output ) {
27
  $css = '<!-- Custom CSS -->' . "\n";
28
  $css .= '<style>' . "\n";
29
- $css .= wp_filter_nohtml_kses( $output ) . "\n";
30
  $css .= '</style>' . "\n";
31
  $css .= '<!-- Generate by Theme Junkie Custom CSS -->' . "\n";
32
 
33
  echo $css;
34
  }
35
 
36
- }
 
9
  * @license http://www.gnu.org/licenses/gpl-2.0.html
10
  */
11
 
 
 
 
12
  /**
13
  * Get the custom css value and display it on front-end
14
  *
23
  if ( $output ) {
24
  $css = '<!-- Custom CSS -->' . "\n";
25
  $css .= '<style>' . "\n";
26
+ $css .= stripslashes( $output ) . "\n";
27
  $css .= '</style>' . "\n";
28
  $css .= '<!-- Generate by Theme Junkie Custom CSS -->' . "\n";
29
 
30
  echo $css;
31
  }
32
 
33
+ }
34
+ add_action( 'wp_head', 'tjcc_get_custom_css', 20 );
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: themejunkie, satrya
3
  Tags: custom css, customizer, css, style, theme, child theme
4
  Requires at least: 3.6
5
- Tested up to: 3.9
6
- Stable tag: 0.1.0
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -64,5 +64,8 @@ Yes, this plugin was developed to support all themes.
64
 
65
  == Changelog ==
66
 
 
 
 
67
  = 0.1 - 4/20/2014 =
68
  * Initial Release
2
  Contributors: themejunkie, satrya
3
  Tags: custom css, customizer, css, style, theme, child theme
4
  Requires at least: 3.6
5
+ Tested up to: 3.9.2
6
+ Stable tag: 0.1.1
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
64
 
65
  == Changelog ==
66
 
67
+ = 0.1.1 - 8/18/2014 =
68
+ * Allow html entities in css selector eg. `#id > .class`
69
+
70
  = 0.1 - 4/20/2014 =
71
  * Initial Release
tj-custom-css.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Theme Junkie Custom CSS
4
  * Plugin URI: http://www.theme-junkie.com/
5
  * Description: Easily to add custom css code to your site.
6
- * Version: 0.1.0
7
  * Author: Theme Junkie
8
  * Author URI: http://www.theme-junkie.com/
9
  * Author Email: satrya@theme-junkie.com
@@ -34,8 +34,6 @@ class Tj_Custom_CSS {
34
  * PHP5 constructor method.
35
  *
36
  * @since 0.1.0
37
- * @access public
38
- * @return void
39
  */
40
  public function __construct() {
41
 
@@ -57,8 +55,6 @@ class Tj_Custom_CSS {
57
  * Defines constants used by the plugin.
58
  *
59
  * @since 0.1.0
60
- * @access public
61
- * @return void
62
  */
63
  public function constants() {
64
 
@@ -83,8 +79,6 @@ class Tj_Custom_CSS {
83
  * Loads the translation files.
84
  *
85
  * @since 0.1.0
86
- * @access public
87
- * @return void
88
  */
89
  public function i18n() {
90
  load_plugin_textdomain( 'tjcc', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
@@ -95,8 +89,6 @@ class Tj_Custom_CSS {
95
  * Loads the admin functions.
96
  *
97
  * @since 0.1.0
98
- * @access public
99
- * @return void
100
  */
101
  public function admin() {
102
  require_once( TJCC_ADMIN . 'admin.php' );
@@ -107,8 +99,6 @@ class Tj_Custom_CSS {
107
  * Loads the initial files needed by the plugin.
108
  *
109
  * @since 0.1.0
110
- * @access public
111
- * @return void
112
  */
113
  public function includes() {
114
  require_once( TJCC_INC . 'functions.php' );
3
  * Plugin Name: Theme Junkie Custom CSS
4
  * Plugin URI: http://www.theme-junkie.com/
5
  * Description: Easily to add custom css code to your site.
6
+ * Version: 0.1.1
7
  * Author: Theme Junkie
8
  * Author URI: http://www.theme-junkie.com/
9
  * Author Email: satrya@theme-junkie.com
34
  * PHP5 constructor method.
35
  *
36
  * @since 0.1.0
 
 
37
  */
38
  public function __construct() {
39
 
55
  * Defines constants used by the plugin.
56
  *
57
  * @since 0.1.0
 
 
58
  */
59
  public function constants() {
60
 
79
  * Loads the translation files.
80
  *
81
  * @since 0.1.0
 
 
82
  */
83
  public function i18n() {
84
  load_plugin_textdomain( 'tjcc', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
89
  * Loads the admin functions.
90
  *
91
  * @since 0.1.0
 
 
92
  */
93
  public function admin() {
94
  require_once( TJCC_ADMIN . 'admin.php' );
99
  * Loads the initial files needed by the plugin.
100
  *
101
  * @since 0.1.0
 
 
102
  */
103
  public function includes() {
104
  require_once( TJCC_INC . 'functions.php' );