Ticket #1731: 1731.patch
File 1731.patch, 1.3 KB (added by , 9 years ago) |
---|
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/handbook/inc/template-tags.php
37 37 } 38 38 39 39 foreach ( $post_types as $post_type ) { 40 $is_handbook = ! $handbook || ( $handbook === $post_type );41 $ handbook_query = is_singular( $post_type ) || is_post_type_archive( $post_type );40 $is_handbook = ! $handbook || ( $handbook === $post_type ); 41 $single_handbook = false; 42 42 43 if( is_singular() ) { 44 $queried_obj = get_queried_object(); 45 46 if( !empty( $queried_obj ) ) { 47 $single_handbook = is_singular( $post_type ); 48 } else { 49 // Queried object is not set, use the post type query var. 50 $qv_post_type = get_query_var('post_type'); 51 52 if ( is_array( $qv_post_type ) ) { 53 $qv_post_type = reset( $qv_post_type ); 54 } 55 56 $single_handbook = ( $post_type === $qv_post_type ); 57 } 58 } 59 60 $handbook_query = $single_handbook || is_post_type_archive( $post_type ); 61 43 62 if ( $is_handbook && $handbook_query ) { 44 63 return true; 45 64 }