Changeset 60715
- Timestamp:
- 09/07/2025 02:45:32 AM (2 months ago)
- Location:
- trunk/src
- Files:
-
- 4 edited
-
js/_enqueues/wp/customize/controls.js (modified) (2 diffs)
-
js/_enqueues/wp/customize/nav-menus.js (modified) (2 diffs)
-
wp-includes/class-wp-customize-control.php (modified) (1 diff)
-
wp-includes/class-wp-customize-nav-menus.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/js/_enqueues/wp/customize/controls.js
r60482 r60715 4067 4067 */ 4068 4068 addNewPage: function () { 4069 var control = this, promise, toggle, container, input, title, select;4069 var control = this, promise, toggle, container, input, inputError, title, select; 4070 4070 4071 4071 if ( 'dropdown-pages' !== control.params.type || ! control.params.allow_addition || ! api.Menus ) { … … 4076 4076 container = control.container.find( '.new-content-item-wrapper' ); 4077 4077 input = control.container.find( '.create-item-input' ); 4078 inputError = control.container.find('.create-item-error'); 4078 4079 title = input.val(); 4079 4080 select = control.container.find( 'select' ); 4080 4081 4081 4082 if ( ! title ) { 4082 input.addClass( 'invalid' ); 4083 container.addClass( 'form-invalid' ); 4084 input.attr('aria-invalid', 'true'); 4085 input.attr('aria-describedby', inputError.attr('id')); 4086 inputError.slideDown( 'fast' ); 4087 wp.a11y.speak( inputError.text() ); 4083 4088 return; 4084 4089 } 4085 4090 4086 input.removeClass( 'invalid' ); 4091 container.removeClass( 'form-invalid' ); 4092 input.attr('aria-invalid', 'false'); 4093 input.removeAttr('aria-describedby'); 4094 inputError.hide(); 4087 4095 input.attr( 'disabled', 'disabled' ); 4088 4096 -
trunk/src/js/_enqueues/wp/customize/nav-menus.js
r59948 r60715 662 662 itemObject = dataContainer.data( 'object' ), 663 663 itemTypeLabel = dataContainer.data( 'type_label' ), 664 inputError = container.find('.create-item-error'), 664 665 promise; 665 666 … … 672 673 return; 673 674 } 674 675 675 if ( '' === itemName.val().trim() ) { 676 itemName.addClass( 'invalid' ); 677 itemName.focus(); 676 container.addClass( 'form-invalid' ); 677 itemName.attr('aria-invalid', 'true'); 678 itemName.attr('aria-describedby', inputError.attr('id')); 679 inputError.slideDown( 'fast' ); 680 wp.a11y.speak( inputError.text() ); 678 681 return; 679 682 } else { 680 itemName.removeClass( 'invalid' ); 683 container.removeClass( 'form-invalid' ); 684 itemName.attr('aria-invalid', 'false'); 685 itemName.removeAttr('aria-describedby'); 686 inputError.hide(); 681 687 container.find( '.accordion-section-title' ).addClass( 'loading' ); 682 688 } -
trunk/src/wp-includes/class-wp-customize-control.php
r60668 r60715 647 647 <label for="create-input-<?php echo esc_attr( $this->id ); ?>"><?php _e( 'New page title' ); ?></label> 648 648 <div class="new-content-item"> 649 <input type="text" id="create-input-<?php echo esc_attr( $this->id ); ?>" class="create-item-input ">649 <input type="text" id="create-input-<?php echo esc_attr( $this->id ); ?>" class="create-item-input form-required"> 650 650 <button type="button" class="button add-content"><?php _e( 'Add' ); ?></button> 651 651 </div> 652 <span id="create-input-<?php echo esc_attr( $this->id ); ?>-error" class="create-item-error error-message" style="display: none;"><?php _e( 'Please enter a page title' ); ?></span> 653 652 654 </div> 653 655 <?php endif; ?> -
trunk/src/wp-includes/class-wp-customize-nav-menus.php
r60681 r60715 1238 1238 <label for="<?php echo esc_attr( 'create-item-input-' . $available_item_type['object'] ); ?>"><?php echo esc_html( $post_type_obj->labels->add_new_item ); ?></label> 1239 1239 <div class="new-content-item"> 1240 <input type="text" id="<?php echo esc_attr( 'create-item-input-' . $available_item_type['object'] ); ?>" class="create-item-input ">1240 <input type="text" id="<?php echo esc_attr( 'create-item-input-' . $available_item_type['object'] ); ?>" class="create-item-input form-required"> 1241 1241 <button type="button" class="button add-content"><?php _e( 'Add' ); ?></button> 1242 1242 </div> 1243 <span id="create-input-<?php echo esc_attr( $available_item_type['object'] ); ?>-error" class="create-item-error error-message" style="display: none;"><?php _e( 'Please enter an item title' ); ?></span> 1244 1243 1245 </div> 1244 1246 <?php endif; ?>
Note: See TracChangeset
for help on using the changeset viewer.