mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-03 06:57:35 +01:00
Permalinks: Fix aria-live text when removing custom structure.
Change the notification announced when a custom structure is removed. Previously, the notification incorrectly indicated that the structure was added for both actions. This changes the notification to correctly announce removals when structures are removed. Props joedolson, kebbet, SergeyBiryukov. Fixes #56230. Built from https://develop.svn.wordpress.org/trunk@53911 git-svn-id: http://core.svn.wordpress.org/trunk@53470 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
594f5ae8c1
commit
f5ca26cd24
@ -751,9 +751,15 @@ $availableStructureTags.on( 'click', function() {
|
|||||||
selectionStart = $permalinkStructure[ 0 ].selectionStart,
|
selectionStart = $permalinkStructure[ 0 ].selectionStart,
|
||||||
selectionEnd = $permalinkStructure[ 0 ].selectionEnd,
|
selectionEnd = $permalinkStructure[ 0 ].selectionEnd,
|
||||||
textToAppend = $( this ).text().trim(),
|
textToAppend = $( this ).text().trim(),
|
||||||
textToAnnounce = $( this ).attr( 'data-added' ),
|
textToAnnounce,
|
||||||
newSelectionStart;
|
newSelectionStart;
|
||||||
|
|
||||||
|
if ( $( this ).hasClass( 'active' ) ) {
|
||||||
|
textToAnnounce = $( this ).attr( 'data-removed' );
|
||||||
|
} else {
|
||||||
|
textToAnnounce = $( this ).attr( 'data-added' );
|
||||||
|
}
|
||||||
|
|
||||||
// Remove structure tag if already part of the structure.
|
// Remove structure tag if already part of the structure.
|
||||||
if ( -1 !== permalinkStructureValue.indexOf( textToAppend ) ) {
|
if ( -1 !== permalinkStructureValue.indexOf( textToAppend ) ) {
|
||||||
permalinkStructureValue = permalinkStructureValue.replace( textToAppend + '/', '' );
|
permalinkStructureValue = permalinkStructureValue.replace( textToAppend + '/', '' );
|
||||||
|
2
wp-admin/js/common.min.js
vendored
2
wp-admin/js/common.min.js
vendored
File diff suppressed because one or more lines are too long
@ -309,7 +309,8 @@ $available_tags = apply_filters( 'available_permalink_structure_tags', $availabl
|
|||||||
|
|
||||||
/* translators: %s: Permalink structure tag. */
|
/* translators: %s: Permalink structure tag. */
|
||||||
$tag_added = __( '%s added to permalink structure' );
|
$tag_added = __( '%s added to permalink structure' );
|
||||||
|
/* translators: %s: Permalink structure tag. */
|
||||||
|
$tag_removed = __( '%s removed from permalink structure' );
|
||||||
/* translators: %s: Permalink structure tag. */
|
/* translators: %s: Permalink structure tag. */
|
||||||
$tag_already_used = __( '%s (already used in permalink structure)' );
|
$tag_already_used = __( '%s (already used in permalink structure)' );
|
||||||
?>
|
?>
|
||||||
@ -378,6 +379,7 @@ printf(
|
|||||||
class="button button-secondary"
|
class="button button-secondary"
|
||||||
aria-label="<?php echo esc_attr( sprintf( $explanation, $tag ) ); ?>"
|
aria-label="<?php echo esc_attr( sprintf( $explanation, $tag ) ); ?>"
|
||||||
data-added="<?php echo esc_attr( sprintf( $tag_added, $tag ) ); ?>"
|
data-added="<?php echo esc_attr( sprintf( $tag_added, $tag ) ); ?>"
|
||||||
|
data-removed="<?php echo esc_attr( sprintf( $tag_removed, $tag ) ); ?>"
|
||||||
data-used="<?php echo esc_attr( sprintf( $tag_already_used, $tag ) ); ?>">
|
data-used="<?php echo esc_attr( sprintf( $tag_already_used, $tag ) ); ?>">
|
||||||
<?php echo '%' . $tag . '%'; ?>
|
<?php echo '%' . $tag . '%'; ?>
|
||||||
</button>
|
</button>
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '6.1-alpha-53910';
|
$wp_version = '6.1-alpha-53911';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
Loading…
Reference in New Issue
Block a user