Changeset 10869 for sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-patterns/functions.php
- Timestamp:
- 04/02/2021 07:31:56 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-patterns/functions.php
r10861 r10869 9 9 add_action( 'wp_head', __NAMESPACE__ . '\generate_block_editor_styles_html' ); 10 10 add_action( 'pre_get_posts', __NAMESPACE__ . '\pre_get_posts' ); 11 12 add_filter( 'search_template', __NAMESPACE__ . '\use_index_php_as_template' ); 13 add_filter( 'archive_template', __NAMESPACE__ . '\use_index_php_as_template' ); 11 14 12 15 /** … … 32 35 */ 33 36 function enqueue_assets() { 37 $script_debug = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG; 38 $suffix = $script_debug ? '' : '.min'; 39 34 40 wp_enqueue_style( 35 41 'wporg-style', … … 54 60 wp_set_script_translations( 'wporg-pattern-script', 'wporg-patterns' ); 55 61 } 62 63 wp_enqueue_script( 'wporg-navigation', get_template_directory_uri() . "/js/navigation$suffix.js", array(), '20210331', true ); 56 64 } 57 65 … … 121 129 } 122 130 } 131 /** 132 * Use the index.php template for various WordPress views that would otherwise be handled by the parent theme. 133 */ 134 function use_index_php_as_template() { 135 return __DIR__ . '/index.php'; 136 }
Note: See TracChangeset
for help on using the changeset viewer.