Changeset 19853
- Timestamp:
- 02/07/2012 06:06:12 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/ajax-actions.php
r19822 r19853 67 67 $s = stripslashes( $_GET['q'] ); 68 68 69 $comma = _x( ',', 'tag delimiter' ); 70 if ( ',' !== $comma ) 71 $s = str_replace( $comma, ',', $s ); 69 72 if ( false !== strpos( $s, ',' ) ) { 70 73 $s = explode( ',', $s ); -
trunk/wp-admin/includes/class-wp-posts-list-table.php
r19712 r19853 610 610 ); 611 611 } 612 echo join( ', ', $out ); 612 /* translators: used between list items, there is a space after the comma */ 613 echo join( __( ', ' ), $out ); 613 614 } else { 614 615 _e( 'Uncategorized' ); … … 630 631 ); 631 632 } 632 echo join( ', ', $out ); 633 /* translators: used between list items, there is a space after the comma */ 634 echo join( __( ', ' ), $out ); 633 635 } else { 634 636 _e( 'No Tags' ); -
trunk/wp-admin/includes/meta-boxes.php
r19684 r19853 277 277 $taxonomy = get_taxonomy($taxonomy); 278 278 $disabled = !current_user_can($taxonomy->cap->assign_terms) ? 'disabled="disabled"' : ''; 279 $comma = _x( ',', 'tag delimiter' ); 279 280 ?> 280 281 <div class="tagsdiv" id="<?php echo $tax_name; ?>"> … … 282 283 <div class="nojs-tags hide-if-js"> 283 284 <p><?php echo $taxonomy->labels->add_or_remove_items; ?></p> 284 <textarea name="<?php echo "tax_input[$tax_name]"; ?>" rows="3" cols="20" class="the-tags" id="tax-input-<?php echo $tax_name; ?>" <?php echo $disabled; ?>><?php echo get_terms_to_edit( $post->ID, $tax_name); // textarea_escaped by esc_attr() ?></textarea></div>285 <textarea name="<?php echo "tax_input[$tax_name]"; ?>" rows="3" cols="20" class="the-tags" id="tax-input-<?php echo $tax_name; ?>" <?php echo $disabled; ?>><?php echo str_replace( ',', $comma . ' ', get_terms_to_edit( $post->ID, $tax_name ) ); // textarea_escaped by esc_attr() ?></textarea></div> 285 286 <?php if ( current_user_can($taxonomy->cap->assign_terms) ) : ?> 286 287 <div class="ajaxtag hide-if-no-js"> -
trunk/wp-admin/includes/post.php
r19720 r19853 303 303 continue; 304 304 if ( is_taxonomy_hierarchical( $tax_name ) ) { 305 $tax_input[ $tax_name] = array_map( 'absint', $terms );305 $tax_input[ $tax_name ] = array_map( 'absint', $terms ); 306 306 } else { 307 $tax_input[$tax_name] = preg_replace( '/\s*,\s*/', ',', rtrim( trim($terms), ' ,' ) ); 308 $tax_input[$tax_name] = explode(',', $tax_input[$tax_name]); 307 $comma = _x( ',', 'tag delimiter' ); 308 if ( ',' !== $comma ) 309 $terms = str_replace( $comma, ',', $terms ); 310 $tax_input[ $tax_name ] = explode( ',', trim( $terms, " \n\t\r\0\x0B," ) ); 309 311 } 310 312 } -
trunk/wp-admin/includes/template.php
r19825 r19853 265 265 $taxonomy = get_taxonomy( $taxonomy_name ); 266 266 267 if ( $taxonomy->hierarchical && $taxonomy->show_ui ) 268 echo '<div class="post_category" id="'.$taxonomy_name.'_'.$post->ID.'">' . implode( ',', wp_get_object_terms( $post->ID, $taxonomy_name, array('fields'=>'ids')) ) . '</div>'; 269 elseif ( $taxonomy->show_ui ) 270 echo '<div class="tags_input" id="'.$taxonomy_name.'_'.$post->ID.'">' . esc_html( str_replace( ',', ', ', get_terms_to_edit($post->ID, $taxonomy_name) ) ) . '</div>'; 267 if ( $taxonomy->hierarchical && $taxonomy->show_ui ) { 268 echo '<div class="post_category" id="' . $taxonomy_name . '_' . $post->ID . '">' 269 . implode( ',', wp_get_object_terms( $post->ID, $taxonomy_name, array( 'fields' => 'ids' ) ) ) . '</div>'; 270 } elseif ( $taxonomy->show_ui ) { 271 echo '<div class="tags_input" id="'.$taxonomy_name.'_'.$post->ID.'">' 272 . esc_html( str_replace( ',', ', ', get_terms_to_edit( $post->ID, $taxonomy_name ) ) ) . '</div>'; 273 } 271 274 } 272 275 -
trunk/wp-admin/js/inline-edit-post.dev.js
r19478 r19853 118 118 // support multi taxonomies? 119 119 tax = 'post_tag'; 120 $('tr.inline-editor textarea[name="tax_input['+tax+']"]').suggest( 'admin-ajax.php?action=ajax-tag-search&tax='+tax, { delay: 500, minchars: 2, multiple: true, multipleSep: ", "} );120 $('tr.inline-editor textarea[name="tax_input['+tax+']"]').suggest( 'admin-ajax.php?action=ajax-tag-search&tax='+tax, { delay: 500, minchars: 2, multiple: true, multipleSep: inlineEditL10n.comma + ' ' } ); 121 121 } 122 122 $('html, body').animate( { scrollTop: 0 }, 'fast' ); … … 185 185 var terms = $(this).text(), 186 186 taxname = $(this).attr('id').replace('_' + id, ''), 187 textarea = $('textarea.tax_input_' + taxname, editRow); 188 189 if ( terms ) 187 textarea = $('textarea.tax_input_' + taxname, editRow), 188 comma = inlineEditL10n.comma; 189 190 if ( terms ) { 191 if ( ',' !== comma ) 192 terms = terms.replace(/,/g, comma); 190 193 textarea.val(terms); 191 192 textarea.suggest( 'admin-ajax.php?action=ajax-tag-search&tax='+taxname, { delay: 500, minchars: 2, multiple: true, multipleSep: ", " } ); 194 } 195 196 textarea.suggest( 'admin-ajax.php?action=ajax-tag-search&tax='+taxname, { delay: 500, minchars: 2, multiple: true, multipleSep: inlineEditL10n.comma + ' ' } ); 193 197 }); 194 198 -
trunk/wp-admin/js/post.dev.js
r19444 r19853 16 16 tagBox = { 17 17 clean : function(tags) { 18 return tags.replace(/\s*,\s*/g, ',').replace(/,+/g, ',').replace(/[,\s]+$/, '').replace(/^[,\s]+/, ''); 18 var comma = postL10n.comma; 19 if ( ',' !== comma ) 20 tags = tags.replace(new RegExp(comma, 'g'), ','); 21 tags = tags.replace(/\s*,\s*/g, ',').replace(/,+/g, ',').replace(/[,\s]+$/, '').replace(/^[,\s]+/, ''); 22 if ( ',' !== comma ) 23 tags = tags.replace(/,/g, comma); 24 return tags; 19 25 }, 20 26 21 27 parseTags : function(el) { 22 var id = el.id, num = id.split('-check-num-')[1], taxbox = $(el).closest('.tagsdiv'), thetags = taxbox.find('.the-tags'), current_tags = thetags.val().split(','), new_tags = []; 28 var id = el.id, num = id.split('-check-num-')[1], taxbox = $(el).closest('.tagsdiv'), 29 thetags = taxbox.find('.the-tags'), comma = postL10n.comma, 30 current_tags = thetags.val().split(comma), new_tags = []; 23 31 delete current_tags[num]; 24 32 … … 30 38 }); 31 39 32 thetags.val( this.clean( new_tags.join( ',') ) );40 thetags.val( this.clean( new_tags.join(comma) ) ); 33 41 34 42 this.quickClicks(taxbox); … … 47 55 disabled = thetags.prop('disabled'); 48 56 49 current_tags = thetags.val().split( ',');57 current_tags = thetags.val().split(postL10n.comma); 50 58 tagchecklist.empty(); 51 59 … … 75 83 flushTags : function(el, a, f) { 76 84 a = a || false; 77 var text, tags = $('.the-tags', el), newtag = $('input.newtag', el), newtags; 85 var tags = $('.the-tags', el), 86 newtag = $('input.newtag', el), 87 comma = postL10n.comma, 88 newtags, text; 78 89 79 90 text = a ? $(a).text() : newtag.val(); 80 91 tagsval = tags.val(); 81 newtags = tagsval ? tagsval + ','+ text : text;92 newtags = tagsval ? tagsval + comma + text : text; 82 93 83 94 newtags = this.clean( newtags ); 84 newtags = array_unique_noempty( newtags.split( ',') ).join(',');95 newtags = array_unique_noempty( newtags.split(comma) ).join(comma); 85 96 tags.val(newtags); 86 97 this.quickClicks(el); … … 97 108 var tax = id.substr(id.indexOf('-')+1); 98 109 99 $.post(ajaxurl, {'action':'get-tagcloud', 'tax':tax}, function(r, stat) {110 $.post(ajaxurl, {'action':'get-tagcloud', 'tax':tax}, function(r, stat) { 100 111 if ( 0 == r || 'success' != stat ) 101 112 r = wpAjax.broken; … … 143 154 }).each(function(){ 144 155 var tax = $(this).closest('div.tagsdiv').attr('id'); 145 $(this).suggest( ajaxurl + '?action=ajax-tag-search&tax=' + tax, { delay: 500, minchars: 2, multiple: true, multipleSep: ","} );156 $(this).suggest( ajaxurl + '?action=ajax-tag-search&tax=' + tax, { delay: 500, minchars: 2, multiple: true, multipleSep: postL10n.comma + ' ' } ); 146 157 }); 147 158 -
trunk/wp-includes/post.php
r19779 r19853 2908 2908 $tags = array(); 2909 2909 2910 $tags = is_array($tags) ? $tags : explode( ',', trim($tags, " \n\t\r\0\x0B,") ); 2910 if ( ! is_array( $tags ) ) { 2911 $comma = _x( ',', 'tag delimiter' ); 2912 if ( ',' !== $comma ) 2913 $tags = str_replace( $comma, ',', $tags ); 2914 $tags = explode( ',', trim( $tags, " \n\t\r\0\x0B," ) ); 2915 } 2911 2916 2912 2917 // Hierarchical taxonomies must always pass IDs rather than names so that children with the same -
trunk/wp-includes/script-loader.php
r19688 r19853 331 331 'password' => __('Password Protected'), 332 332 'privatelyPublished' => __('Privately Published'), 333 'published' => __('Published') 333 'published' => __('Published'), 334 'comma' => _x( ',', 'tag delimiter' ), 334 335 ) ); 335 336 … … 354 355 'error' => __('Error while saving the changes.'), 355 356 'ntdeltitle' => __('Remove From Bulk Edit'), 356 'notitle' => __('(no title)') 357 'notitle' => __('(no title)'), 358 'comma' => _x( ',', 'tag delimiter' ), 357 359 ) ); 358 360
Note: See TracChangeset
for help on using the changeset viewer.