Changeset 1062596
- Timestamp:
- 01/07/2015 10:58:50 PM (11 years ago)
- Location:
- css-file-selector
- Files:
-
- 2 edited
- 3 copied
-
tags/1.0.3 (copied) (copied from css-file-selector/trunk)
-
tags/1.0.3/cssfileselector.php (copied) (copied from css-file-selector/trunk/cssfileselector.php) (7 diffs)
-
tags/1.0.3/readme.txt (copied) (copied from css-file-selector/trunk/readme.txt) (3 diffs)
-
trunk/cssfileselector.php (modified) (7 diffs)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
css-file-selector/tags/1.0.3/cssfileselector.php
r1057455 r1062596 4 4 Plugin URI: http://www.chrgiga.com/css-file-selector 5 5 Description: Add CSS files and/or CSS custom rules to any single page or post 6 Version: 1.0. 36 Version: 1.0.4 7 7 Author: Christian Gil 8 8 Author URI: http://www.chrgiga.com … … 16 16 { 17 17 $screens = array( 'post', 'page' ); 18 18 19 19 foreach ($screens as $screen) { 20 20 add_meta_box( … … 41 41 } else { 42 42 // Ready File 43 if (is_file($directory.'/'.$file) && end(explode('.', $file)) == 'css') { 43 $explodefile = explode('.', $file); 44 45 if (is_file($directory.'/'.$file) && end($explodefile) == 'css') { 44 46 $files[dirname($directory.'/'.$file)][] = $directory.'/'.$file; 45 47 } … … 81 83 $select .= $option_css.'</select>'; 82 84 } 83 85 84 86 return $select; 85 87 } … … 107 109 function gil_css_file_selector_save_postdata($post_id) 108 110 { 109 // First we need to check if the current user is authorised to do this action. 111 // First we need to check if the current user is authorised to do this action. 110 112 if ('page' == $_POST['post_type']) { 111 113 if (!current_user_can( 'edit_page', $post_id)) { … … 137 139 { 138 140 global $post; 139 141 140 142 if (is_single() || is_page()) { 141 143 $cssfiles = get_post_meta($post->ID, 'gil_css_file_selector_file'); 142 144 143 if ( $cssfiles[0] != '') {145 if (count($cssfiles) && $cssfiles[0] != '') { 144 146 foreach (explode(',', $cssfiles[0]) as $cssfile) { 145 147 $css_uri = str_replace(get_template_directory(), get_template_directory_uri(), $cssfile); … … 153 155 { 154 156 global $post; 155 157 156 158 if (is_single() || is_page()) { 157 159 $cssrules = get_post_meta($post->ID, 'gil_css_file_selector_rules'); 158 if ( $cssrules[0] != '') { ?>160 if (count($cssrules) && $cssrules[0] != '') { ?> 159 161 <!-- CSS File Selector (custom rules) --> 160 162 <style type="text/css"> -
css-file-selector/tags/1.0.3/readme.txt
r1057455 r1062596 5 5 Requires at least: 3.0 6 6 Tested up to: 4.1 7 Stable tag: 1.0. 37 Stable tag: 1.0.4 8 8 License: GPLv3 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 31 31 == Changelog == 32 32 33 = 1.0.4 = 34 * Solved a warning in debug mode. 35 33 36 = 1.0.3 = 34 37 * Fixed a little error in the field select that showed the CSS files of the root path in the wrong folders. This little error did not prejudice the functionality of the plugin. … … 46 49 == Upgrade Notice == 47 50 51 = 1.0.4 = 52 * Solved a warning in debug mode. 53 48 54 = 1.0.3 = 49 55 * Fixed a little error in the field select that showed the CSS files of the root path in the wrong folders. This little error did not prejudice the functionality of the plugin. -
css-file-selector/trunk/cssfileselector.php
r1057455 r1062596 4 4 Plugin URI: http://www.chrgiga.com/css-file-selector 5 5 Description: Add CSS files and/or CSS custom rules to any single page or post 6 Version: 1.0. 36 Version: 1.0.4 7 7 Author: Christian Gil 8 8 Author URI: http://www.chrgiga.com … … 16 16 { 17 17 $screens = array( 'post', 'page' ); 18 18 19 19 foreach ($screens as $screen) { 20 20 add_meta_box( … … 41 41 } else { 42 42 // Ready File 43 if (is_file($directory.'/'.$file) && end(explode('.', $file)) == 'css') { 43 $explodefile = explode('.', $file); 44 45 if (is_file($directory.'/'.$file) && end($explodefile) == 'css') { 44 46 $files[dirname($directory.'/'.$file)][] = $directory.'/'.$file; 45 47 } … … 81 83 $select .= $option_css.'</select>'; 82 84 } 83 85 84 86 return $select; 85 87 } … … 107 109 function gil_css_file_selector_save_postdata($post_id) 108 110 { 109 // First we need to check if the current user is authorised to do this action. 111 // First we need to check if the current user is authorised to do this action. 110 112 if ('page' == $_POST['post_type']) { 111 113 if (!current_user_can( 'edit_page', $post_id)) { … … 137 139 { 138 140 global $post; 139 141 140 142 if (is_single() || is_page()) { 141 143 $cssfiles = get_post_meta($post->ID, 'gil_css_file_selector_file'); 142 144 143 if ( $cssfiles[0] != '') {145 if (count($cssfiles) && $cssfiles[0] != '') { 144 146 foreach (explode(',', $cssfiles[0]) as $cssfile) { 145 147 $css_uri = str_replace(get_template_directory(), get_template_directory_uri(), $cssfile); … … 153 155 { 154 156 global $post; 155 157 156 158 if (is_single() || is_page()) { 157 159 $cssrules = get_post_meta($post->ID, 'gil_css_file_selector_rules'); 158 if ( $cssrules[0] != '') { ?>160 if (count($cssrules) && $cssrules[0] != '') { ?> 159 161 <!-- CSS File Selector (custom rules) --> 160 162 <style type="text/css"> -
css-file-selector/trunk/readme.txt
r1057455 r1062596 5 5 Requires at least: 3.0 6 6 Tested up to: 4.1 7 Stable tag: 1.0. 37 Stable tag: 1.0.4 8 8 License: GPLv3 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 31 31 == Changelog == 32 32 33 = 1.0.4 = 34 * Solved a warning in debug mode. 35 33 36 = 1.0.3 = 34 37 * Fixed a little error in the field select that showed the CSS files of the root path in the wrong folders. This little error did not prejudice the functionality of the plugin. … … 46 49 == Upgrade Notice == 47 50 51 = 1.0.4 = 52 * Solved a warning in debug mode. 53 48 54 = 1.0.3 = 49 55 * Fixed a little error in the field select that showed the CSS files of the root path in the wrong folders. This little error did not prejudice the functionality of the plugin.
Note: See TracChangeset
for help on using the changeset viewer.