Making WordPress.org


Ignore:
Timestamp:
04/02/2021 07:31:56 PM (5 years ago)
Author:
ryelle
Message:

Pattern Directory: Sync with git WordPress/pattern-directory@a7e04d2cd0327dddb03bf5b09a2c061272a96ef1

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-patterns/functions.php

    r10861 r10869  
    99add_action( 'wp_head', __NAMESPACE__ . '\generate_block_editor_styles_html' );
    1010add_action( 'pre_get_posts', __NAMESPACE__ . '\pre_get_posts' );
     11
     12add_filter( 'search_template', __NAMESPACE__ . '\use_index_php_as_template' );
     13add_filter( 'archive_template', __NAMESPACE__ . '\use_index_php_as_template' );
    1114
    1215/**
     
    3235 */
    3336function enqueue_assets() {
     37    $script_debug = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG;
     38    $suffix       = $script_debug ? '' : '.min';
     39
    3440    wp_enqueue_style(
    3541        'wporg-style',
     
    5460        wp_set_script_translations( 'wporg-pattern-script', 'wporg-patterns' );
    5561    }
     62
     63    wp_enqueue_script( 'wporg-navigation', get_template_directory_uri() . "/js/navigation$suffix.js", array(), '20210331', true );
    5664}
    5765
     
    121129    }
    122130}
     131/**
     132 * Use the index.php template for various WordPress views that would otherwise be handled by the parent theme.
     133 */
     134function use_index_php_as_template() {
     135    return __DIR__ . '/index.php';
     136}
Note: See TracChangeset for help on using the changeset viewer.