Make WordPress Core


Ignore:
Timestamp:
09/26/2017 08:23:07 AM (8 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/deprecated.php

    r41275 r41598  
    14921492    }
    14931493}
     1494
     1495/**
     1496 * Display JavaScript on the page.
     1497 *
     1498 * @since 3.5.0
     1499 * @deprecated 4.9.0
     1500 */
     1501function options_permalink_add_js() {
     1502    ?>
     1503    <script type="text/javascript">
     1504        jQuery(document).ready(function() {
     1505            jQuery('.permalink-structure input:radio').change(function() {
     1506                if ( 'custom' == this.value )
     1507                    return;
     1508                jQuery('#permalink_structure').val( this.value );
     1509            });
     1510            jQuery( '#permalink_structure' ).on( 'click input', function() {
     1511                jQuery( '#custom_selection' ).prop( 'checked', true );
     1512            });
     1513        });
     1514    </script>
     1515    <?php
     1516}
Note: See TracChangeset for help on using the changeset viewer.