Ticket #56230: 56230.2.diff
File 56230.2.diff, 2.2 KB (added by , 2 years ago) |
---|
-
src/js/_enqueues/admin/common.js
751 751 selectionStart = $permalinkStructure[ 0 ].selectionStart, 752 752 selectionEnd = $permalinkStructure[ 0 ].selectionEnd, 753 753 textToAppend = $( this ).text().trim(), 754 textToAnnounce = $( this ).attr( 'data-added' ),754 textToAnnounce, 755 755 newSelectionStart; 756 756 757 757 // Remove structure tag if already part of the structure. … … 788 788 // Insert structure tag at the specified position. 789 789 $permalinkStructure.val( permalinkStructureValue.substr( 0, selectionStart ) + textToAppend + permalinkStructureValue.substr( selectionEnd ) ); 790 790 791 if ( $( this ).hasClass( 'active' ) ) { 792 textToAnnounce = $( this ).attr( 'data-removed' ); 793 } else { 794 textToAnnounce = $( this ).attr( 'data-added' ); 795 } 796 791 797 // Announce change to screen readers. 792 798 $( '#custom_selection_updated' ).text( textToAnnounce ); 793 799 -
src/wp-admin/options-permalink.php
309 309 310 310 /* translators: %s: Permalink structure tag. */ 311 311 $tag_added = __( '%s added to permalink structure' ); 312 313 312 /* translators: %s: Permalink structure tag. */ 313 $tag_removed = __( '%s removed from permalink structure' ); 314 /* translators: %s: Permalink structure tag. */ 314 315 $tag_already_used = __( '%s (already used in permalink structure)' ); 315 316 ?> 316 317 <h2 class="title"><?php _e( 'Common Settings' ); ?></h2> … … 378 379 class="button button-secondary" 379 380 aria-label="<?php echo esc_attr( sprintf( $explanation, $tag ) ); ?>" 380 381 data-added="<?php echo esc_attr( sprintf( $tag_added, $tag ) ); ?>" 382 data-removed="<?php echo esc_attr( sprintf( $tag_removed, $tag ) ); ?>" 381 383 data-used="<?php echo esc_attr( sprintf( $tag_already_used, $tag ) ); ?>"> 382 384 <?php echo '%' . $tag . '%'; ?> 383 385 </button>