Make WordPress Core


Ignore:
Timestamp:
09/26/2017 08:23:07 AM (7 years ago)
Author:
swissspidy
Message:

Permalinks: Change structure tag button state more reliably.

Changes the highlighted tag buttons accordingly when selecting one of the commong permalink settings.

Deprecates options_permalink_add_js() as that JavaScript isn't added inline anymore.

Fixes #29872.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/options.php

    r40897 r41598  
    9292 * @since 3.5.0
    9393 */
    94 function options_permalink_add_js() {
    95     ?>
    96 <script type="text/javascript">
    97 jQuery(document).ready(function() {
    98     jQuery('.permalink-structure input:radio').change(function() {
    99         if ( 'custom' == this.value )
    100             return;
    101         jQuery('#permalink_structure').val( this.value );
    102     });
    103     jQuery( '#permalink_structure' ).on( 'click input', function() {
    104         jQuery( '#custom_selection' ).prop( 'checked', true );
    105     });
    106 });
    107 </script>
    108 <?php
    109 }
    110 
    111 /**
    112  * Display JavaScript on the page.
    113  *
    114  * @since 3.5.0
    115  */
    11694function options_reading_add_js() {
    11795?>
Note: See TracChangeset for help on using the changeset viewer.