Changeset 41598
- Timestamp:
- 09/26/2017 08:23:07 AM (7 years ago)
- Location:
- trunk/src/wp-admin
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/deprecated.php
r41275 r41598 1492 1492 } 1493 1493 } 1494 1495 /** 1496 * Display JavaScript on the page. 1497 * 1498 * @since 3.5.0 1499 * @deprecated 4.9.0 1500 */ 1501 function 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 } -
trunk/src/wp-admin/includes/options.php
r40897 r41598 92 92 * @since 3.5.0 93 93 */ 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 <?php109 }110 111 /**112 * Display JavaScript on the page.113 *114 * @since 3.5.0115 */116 94 function options_reading_add_js() { 117 95 ?> -
trunk/src/wp-admin/js/common.js
r41183 r41598 182 182 var permalinkStructureFocused = false, 183 183 $permalinkStructure = $( '#permalink_structure' ), 184 $permalinkStructureInputs = $( '.permalink-structure input:radio' ), 185 $permalinkCustomSelection = $( '#custom_selection' ), 184 186 $availableStructureTags = $( '.form-table.permalink-structure .available-structure-tags button' ); 187 188 // Change permalink structure input when selecting one of the common structures. 189 $permalinkStructureInputs.on( 'change', function() { 190 if ( 'custom' === this.value ) { 191 return; 192 } 193 194 $permalinkStructure.val( this.value ); 195 196 // Update button states after selection. 197 $availableStructureTags.each( function() { 198 changeStructureTagButtonState( $( this ) ); 199 } ); 200 } ); 201 202 $permalinkStructure.on( 'click input', function() { 203 $permalinkCustomSelection.prop( 'checked', true ); 204 } ); 185 205 186 206 // Check if the permalink structure input field has had focus at least once. … … 250 270 } 251 271 252 $ ( '#custom_selection' ).prop( 'checked', true );272 $permalinkCustomSelection.prop( 'checked', true ); 253 273 254 274 // Prepend and append slashes if necessary. -
trunk/src/wp-admin/options-permalink.php
r41182 r41598 46 46 '<p>' . __('<a href="https://wordpress.org/support/">Support Forums</a>') . '</p>' 47 47 ); 48 49 add_filter('admin_head', 'options_permalink_add_js');50 48 51 49 $home_path = get_home_path();
Note: See TracChangeset
for help on using the changeset viewer.