options_permalink_add_js

Display JavaScript on the page.

Description

options_permalink_add_js(); 

Usage

  1. if ( !function_exists( 'options_permalink_add_js' ) ) { 
  2. require_once ABSPATH . '/wp-admin/includes/options.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = options_permalink_add_js(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/wp-admin/includes/options.php  
  1. function options_permalink_add_js() { 
  2. ?> 
  3. <script type="text/javascript"> 
  4. jQuery(document).ready(function() { 
  5. jQuery('.permalink-structure input:radio').change(function() { 
  6. if ( 'custom' == this.value ) 
  7. return; 
  8. jQuery('#permalink_structure').val( this.value ); 
  9. }); 
  10. jQuery('#permalink_structure').focus(function() { 
  11. jQuery("#custom_selection").attr('checked', 'checked'); 
  12. }); 
  13. }); 
  14. </script> 
  15. <?php