Making WordPress.org


Ignore:
Timestamp:
07/16/2021 08:58:19 PM (5 years ago)
Author:
ryelle
Message:

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

File:
1 edited

Legend:

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

    r11117 r11121  
    1414
    1515add_filter( 'archive_template', __NAMESPACE__ . '\use_index_php_as_template' );
    16 
    17 add_filter( 'pre_handle_404', __NAMESPACE__ . '\bypass_404_page', 10, 2 );
    18 
    1916add_action( 'template_redirect', __NAMESPACE__ . '\rewrite_search_url' );
    2017
    … …  
    227224
    228225/**
    229  * Handle a possible 404 page when viewing patterns, which might happen if the JS pagination is
    230  * different than the WP default.
    231  *
    232  * @param bool     $preempt  Whether to short-circuit default header status handling. Default false.
    233  * @param WP_Query $wp_query WordPress Query object.
    234  * @return bool
    235  */
    236 function bypass_404_page( $preempt, $wp_query ) {
    237         if ( isset( $wp_query->query_vars['post_type'][0] ) && POST_TYPE === $wp_query->query_vars['post_type'][0] ) {
    238                 return true;
    239         }
    240         return $preempt;
    241 }
    242 
    243 /**
    244226 * Get the full, filtered content of a post, ignoring more and noteaser tags and pagination.
    245227 *
Note: See TracChangeset for help on using the changeset viewer.