Changeset 1787375
- Timestamp:
- 12/15/2017 01:13:55 AM (8 years ago)
- Location:
- admin-tag-ui/trunk
- Files:
-
- 2 edited
-
admin-tag-ui.php (modified) (9 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
admin-tag-ui/trunk/admin-tag-ui.php
r1770394 r1787375 4 4 * Plugin URI: http://divspark.com/product/admin-tag-ui 5 5 * Description: Changes appearance of tag sections in the admin backend post pages. 6 * Version: 1.1. 26 * Version: 1.1.3 7 7 * Author: DivSpark 8 8 * Author URI: http://divspark.com … … 17 17 class Admin_Tag_UI_Plugin 18 18 { 19 const version = '1.1. 2';19 const version = '1.1.3'; 20 20 21 21 private $settings; … … 103 103 return array_merge( $links, $add_links ); 104 104 } 105 106 107 /**108 * Disabled now, not sure if this will be used in the future.109 * Was running from __construct:110 * if ( $this->settings['number_to_show'] == 'all' ) {111 * add_filter( 'gettext', array( $this, 'change_show_tags_text'), 1, 3 );112 * }113 */114 /*public function change_show_tags_text( $translated_text, $text, $domain )115 {116 if ( 'Choose from the most used tags' == $text ) // && 'your-post-type' == $typenow117 {118 $translated_text = __( 'Choose from all tags', 'admin-tag-ui' );119 }120 return $translated_text;121 }*/122 123 105 124 106 /** … … 150 132 * Adds css <style> to the head section of the page 151 133 * - action admin_head - __construct() 152 *153 * 1.1.2 - WordPress 4.9 changed tag cloud's html structure in the page. Styles had to be changed.154 134 */ 155 135 public function add_style_to_head() … … 182 162 display: inline-block; 183 163 width: 100%; 164 word-wrap: break-word; 184 165 } 185 166 .the-tagcloud ul li { … … 198 179 display: inline-block; 199 180 width: 100%; 181 word-wrap: break-word; 200 182 } 201 183 … … 250 232 * - action admin_footer-post.php - __construct() 251 233 * - action admin_footer-post-new.php - __construct() 252 *253 * 1.1.0254 * - Moved {$tag_link_wording} within jQuery.ready() function255 * - Prevented the screen from jumping back to the tag input field by disabling it temporarily (focus does not jump to disabled elements).256 * - Added atui_check_tag_selection() to highlight tags which have been selected in the selectable tags section.257 * - Used setTimeout() to let other events fire. May need to review this and attempt another approach?258 *259 * 1.1.1260 * - Changed ".the-tagcloud > a[class^=tag-link-]" to ".the-tagcloud > a[class*=tag-link-]" (makes it compatible with WordPress 4.8)261 * - find tags to highlight by using .filter(). :contains caused additional tags to be matched.262 *263 * 1.1.2264 * - WordPress 4.9 changed tag cloud's html structure in the page. Selectors had to be changed.265 * - Added listener to "Add" button. Will now run highlight tag function after being clicked.266 234 */ 267 235 public function add_script_to_footer() … … 272 240 { 273 241 $all = __( 'all', 'admin-tag-ui' ); 274 $tag_link_wording = "var tag_wording = jQuery( '.tagcloud-link' ).text().replace( 'the most used', '{$all}' );\n"; 275 $tag_link_wording .= "jQuery( '.tagcloud-link' ).text( tag_wording );\n"; 276 $tag_link_wording .= "jQuery( '.tagcloud-link' ).css( 'visibility', 'visible' );\n"; 242 $tag_link_wording = "$( '.tagcloud-link' ).each( function() {\n"; 243 $tag_link_wording .= "var tag_wording = jQuery( this ).text().replace( 'the most used', '{$all}' );\n"; 244 $tag_link_wording .= "jQuery( this ).text( tag_wording );\n"; 245 $tag_link_wording .= "jQuery( this ).css( 'visibility', 'visible' );\n"; 246 $tag_link_wording .= "});"; 277 247 } 278 248 else … … 293 263 }); 294 264 295 // Adds the selected class back to tags which have been selected 296 jQuery( '.tagchecklist span.screen-reader-text' ).each( function() { 297 298 selected_tag_text = jQuery( this ).text().replace( 'Remove term: ', '' ).trim().toLowerCase(); 299 300 // console.log( 'selected tag: ' + jQuery( this ).text().replace( 'Remove term: ', '' ).trim().toLowerCase() + ' ' ); 301 302 jQuery( '.the-tagcloud a[class*=tag-link-]' ).filter( function() { 303 304 // console.log( 'selectable tag: ' + jQuery( this ).text().trim().toLowerCase() + ' ' ); 265 // find the tag boxes within the screen. ^= is starts with. Also needs .postbox otherwise will incorrectly match other elements 266 jQuery( 'div[id^="tagsdiv-"].postbox' ).each( function( i, tagsdiv ) 267 { 268 // Adds the selected class back to tags which have been selected 269 jQuery( tagsdiv ).find( '.tagchecklist span.screen-reader-text' ).each( function() 270 { 271 selected_tag_text = jQuery( this ).text().replace( 'Remove term: ', '' ).trim().toLowerCase(); 305 272 306 if ( jQuery( this ).text().trim().toLowerCase() === selected_tag_text ) { 273 // console.log( 'selected tag: ' + jQuery( this ).text().replace( 'Remove term: ', '' ).trim().toLowerCase() + ' ' ); 274 275 jQuery( tagsdiv ).find( '.the-tagcloud a[class*=tag-link-]' ).filter( function() { 276 277 // console.log( 'selectable tag: ' + jQuery( this ).text().trim().toLowerCase() + ' ' ); 307 278 308 jQuery( this ).addClass( 'atui-tag-selected' ); 309 310 // console.log( 'matching tag: ' + jQuery( this ).text().trim().toLowerCase() + ' ' ); 311 } 312 }); 313 314 }); 279 if ( jQuery( this ).text().trim().toLowerCase() === selected_tag_text ) { 280 281 jQuery( this ).addClass( 'atui-tag-selected' ); 282 283 // console.log( 'matching tag: ' + jQuery( this ).text().trim().toLowerCase() + ' ' ); 284 } 285 }); 286 287 }); 288 }); 315 289 } 316 290 -
admin-tag-ui/trunk/readme.txt
r1770394 r1787375 4 4 Requires at least: 4.4 5 5 Tested up to: 4.9 6 Stable tag: 1.1. 26 Stable tag: 1.1.3 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 68 68 == Changelog == 69 69 70 = 1.1.3 = 71 * Added compatibility for multiple tag boxes appear in the post edit screen (such as when there is a custom taxonomy) 72 * Fixed non-breaking tags that were too long 73 70 74 = 1.1.2 = 71 * Added compat ability for WordPress 4.975 * Added compatibility for WordPress 4.9 72 76 * Fixed tags not being highlighted when adding tags with Add button 73 77
Note: See TracChangeset
for help on using the changeset viewer.