Changeset 1053785
- Timestamp:
- 12/25/2014 03:34:03 AM (11 years ago)
- Location:
- css-file-selector/trunk
- Files:
-
- 3 edited
-
cssfileselector.php (modified) (5 diffs)
-
inc/js/cssfileselector.js (modified) (2 diffs)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
css-file-selector/trunk/cssfileselector.php
r1053338 r1053785 30 30 { 31 31 // Recursive function for read directories and subdirectories 32 function gil_read_ directories($directory, &$files)32 function gil_read_css_directories($directory, &$files) 33 33 { 34 34 if (is_dir($directory)) { … … 38 38 // Verify if is directory or file 39 39 if (is_dir( $directory.'/'.$file)) { 40 gil_read_ directories($directory.'/'.$file , $files);40 gil_read_css_directories($directory.'/'.$file , $files); 41 41 } else { 42 42 // Ready File … … 55 55 $path_template = get_template_directory(); 56 56 $files = array(); 57 gil_read_ directories($path_template, $files);57 gil_read_css_directories($path_template, $files); 58 58 $select = ''; 59 59 … … 92 92 $cssfiles = get_post_meta($post->ID, 'gil_css_file_selector_file', true); 93 93 $cssrules = get_post_meta($post->ID, 'gil_css_file_selector_rules', true); 94 echo '<div class="row"><label>Select CSS files</label><br />'.gil_get_css_file(explode(',', $cssfiles)).' <button type="button" class="add-select button button-primary button-large">Add other file</button></div>';94 echo '<div class="row"><label>Select CSS files</label><br />'.gil_get_css_file(explode(',', $cssfiles)).' <button type="button" class="add-select-css button button-primary button-large">Add other file</button><hr /></div>'; 95 95 echo '<div class="row"><label for="css-file-selector-rules">Write your custom CSS rules</label><br /><textarea id="css-file-selector-rules" name="gil_css_file_selector_rules">'.esc_attr($cssrules).'</textarea></div>'; 96 96 wp_enqueue_style('cssfileselector.css', plugins_url('inc/css/cssfileselector.css', __FILE__)); … … 164 164 global $post; 165 165 166 delete_post_meta($post->ID, 'gil_css_file_selector_file'); 167 delete_post_meta($post->ID, 'gil_css_file_selector_rules'); 166 if ('trash' == get_post_status($post_id)) { 167 delete_post_meta($post->ID, 'gil_css_file_selector_file'); 168 delete_post_meta($post->ID, 'gil_css_file_selector_rules'); 169 } 168 170 } 169 171 -
css-file-selector/trunk/inc/js/cssfileselector.js
r1053338 r1053785 8 8 if (last_select.val() == '') { 9 9 //If no option selected, we can't add other select element 10 $('.add-select ').prop('disabled', 'true').removeClass('button-primary').addClass('button-default');10 $('.add-select-css').prop('disabled', 'true').removeClass('button-primary').addClass('button-default'); 11 11 } 12 12 last_select.change(function() 13 13 { 14 14 if ($(this).val() != '') { 15 $('.add-select ').removeProp('disabled').removeClass('button-default').addClass('button-primary');15 $('.add-select-css').removeProp('disabled').removeClass('button-default').addClass('button-primary'); 16 16 } 17 17 }); … … 26 26 }); 27 27 28 $('.add-select ').click(function(e) {28 $('.add-select-css').click(function(e) { 29 29 e.preventDefault(); 30 30 if (!e.target.disabled) { -
css-file-selector/trunk/readme.txt
r1053401 r1053785 5 5 Requires at least: 3.0.1 6 6 Tested up to: 4.1 7 Stable tag: 1.0 7 Stable tag: 1.0.1 8 8 License: GPLv3 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 24 24 == Frequently Asked Questions == 25 25 26 = Are custom post types supported = 27 28 Not yet.. stay tuned 26 29 27 30 == Screenshots == 28 31 29 1. Sample post page with `Select CSS files and/or write your custom CSS rules` metabox screenshot -1.jpg.32 1. Sample post page with `Select CSS files and/or write your custom CSS rules` metabox screenshot.png. 30 33 31 34 == Changelog == 35 36 = 1.0.1 = 37 * Fixed bug 32 38 33 39 = 1.0 = … … 36 42 == Upgrade Notice == 37 43 38 No upgrades at this time 44 = 1.0.1 = 45 Fixed bug that emptied the options of select field when the button `Preview Changes` was pressed 39 46
Note: See TracChangeset
for help on using the changeset viewer.