Changeset 1527 for sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/functions.php
- Timestamp:
- 04/30/2015 11:31:29 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/functions.php
r1505 r1527 87 87 add_action( 'pre_get_posts', __NAMESPACE__ . '\\pre_get_posts' ); 88 88 add_action( 'wp_enqueue_scripts', __NAMESPACE__ . '\\theme_scripts_styles' ); 89 add_action( 'wp_head', __NAMESPACE__ . '\\header_js' ); 89 90 add_action( 'add_meta_boxes', __NAMESPACE__ . '\\rename_comments_meta_box', 10, 2 ); 90 91 … … 103 104 add_filter( 'breadcrumb_trail_items', __NAMESPACE__ . '\\breadcrumb_trail_items', 10, 2 ); 104 105 105 add_filter( 'wp_parser_skip_duplicate_hooks', '__return_true' ); 106 add_filter( 'wp_parser_skip_duplicate_hooks', '__return_true' ); 106 107 107 108 } … … 244 245 } 245 246 247 /** 248 * Outputs JavaScript intended to appear in the head of the page. 249 */ 250 function header_js() { 251 // Output CSS to hide markup with the class 'hide-if-js'. Ensures the markup is visible if JS is not present. 252 echo "<script type=\"text/javascript\">jQuery( '<style>.hide-if-js { display: none; }</style>' ).appendTo( 'head' );</script>\n"; 253 } 254 246 255 function theme_scripts_styles() { 247 256 wp_enqueue_style( 'dashicons' );
Note: See TracChangeset
for help on using the changeset viewer.