Ticket #1671: 1671.4.patch
| File 1671.4.patch, 3.3 KB (added by , 10 years ago) |
|---|
-
inc/extras.php
96 96 * @return string 97 97 */ 98 98 function wporg_filter_archive_excerpt( $excerpt ) { 99 if ( ! is_single() && ! wporg_is_handbook() ) {99 $wporg_is_handbook = function_exists( 'wporg_is_handbook' ) ? wporg_is_handbook() : false; 100 100 101 if ( ! is_single() && ! $wporg_is_handbook ) { 102 101 103 $post_id = get_the_ID(); 102 104 $type = get_post_type_object( get_post_type( $post_id ) )->labels->singular_name; 103 105 -
inc/redirects.php
32 32 * Redirects a search query with only one result directly to that result. 33 33 */ 34 34 public static function redirect_single_search_match() { 35 if ( is_search() && ! wporg_is_handbook() && 1 == $GLOBALS['wp_query']->found_posts ) { 35 $wporg_is_handbook = function_exists( 'wporg_is_handbook' ) ? wporg_is_handbook() : false; 36 37 if ( is_search() && ! $wporg_is_handbook && 1 == $GLOBALS['wp_query']->found_posts ) { 36 38 wp_redirect( get_permalink( get_post() ) ); 37 39 exit(); 38 40 } -
inc/search.php
43 43 44 44 // Separates searches for handbook pages from non-handbook pages depending on 45 45 // whether the search was performed within context of a handbook page or not. 46 if ( wporg_is_handbook() ) { 46 $wporg_is_handbook = function_exists( 'wporg_is_handbook' ) ? wporg_is_handbook() : false; 47 48 if ( $wporg_is_handbook ) { 47 49 // Search only in current handbook post type. 48 50 // Just to make sure. post type should already be set. 49 51 $query->set( 'post_type', wporg_get_current_handbook() ); -
inc/user-content.php
62 62 */ 63 63 public static function scripts_and_styles() { 64 64 if ( is_singular() ) { 65 if ( '0' != get_comments_number() || \DevHub\post_type_has_source_code() || wporg_is_handbook_post_type() ) { 65 $is_handbook_post_type = function_exists( 'wporg_is_handbook_post_type' ) ? wporg_is_handbook_post_type() : false; 66 67 if ( '0' != get_comments_number() || \DevHub\post_type_has_source_code() || $is_handbook_post_type ) { 66 68 wp_enqueue_script( 'wporg-developer-function-reference', get_template_directory_uri() . '/js/function-reference.js', array( 'jquery', 'syntaxhighlighter-core', 'syntaxhighlighter-brush-php' ), '20150319', true ); 67 69 wp_enqueue_style( 'syntaxhighlighter-core' ); 68 70 wp_enqueue_style( 'syntaxhighlighter-theme-default' ); -
searchform.php
34 34 <?php } ?> 35 35 36 36 <?php 37 $is_handbook = wporg_is_handbook();37 $is_handbook = function_exists( 'wporg_is_handbook' ) ? wporg_is_handbook() : false; 38 38 $search_url = $is_handbook ? wporg_get_current_handbook_home_url() : home_url( '/' ); 39 39 $form_class = $is_handbook ? ' searchform-handbook' : ''; 40 40 ?>