Ticket #15487: 15487-2.diff
File 15487-2.diff, 1.8 KB (added by , 14 years ago) |
---|
-
wp-includes/query.php
2652 2652 return $this->queried_object; 2653 2653 2654 2654 $this->queried_object = NULL; 2655 $this->queried_object_id = 0; 2656 2657 if ( $this->is_category || $this->is_tag || $this->is_tax) {2655 $this->queried_object_id = 0; 2656 2657 if ( ( $this->is_category || $this->is_tag || $this->is_tax ) && !$this->is_single ) { 2658 2658 $tax_query_in = wp_list_filter( $this->tax_query->queries, array( 'operator' => 'IN' ) ); 2659 2659 2660 2660 $query = reset( $tax_query_in ); … … 2681 2681 $this->queried_object_id = (int) $this->get('author'); 2682 2682 $this->queried_object = get_userdata( $this->queried_object_id ); 2683 2683 } 2684 2684 2685 2685 return $this->queried_object; 2686 2686 } 2687 2687 -
wp-includes/canonical.php
66 66 if ( !isset($redirect['query']) ) 67 67 $redirect['query'] = ''; 68 68 69 if ( is_singular() && 1 > $wp_query->post_count && ($id = get_query_var('p')) ) { 69 if ( is_singular() && 1 >= $wp_query->post_count ) { 70 71 $id = get_query_var('p'); 72 $name = get_query_var('name'); 70 73 71 $vars = $wpdb->get_results( $wpdb->prepare("SELECT post_type, post_parent FROM $wpdb->posts WHERE ID = %d", $id) ); 74 if( $id ) 75 $vars = $wpdb->get_results( $wpdb->prepare("SELECT post_type, post_parent FROM $wpdb->posts WHERE ID = %d", $id) ); 76 elseif( $name ) 77 $vars = $wpdb->get_results( $wpdb->prepare("SELECT post_type, post_parent FROM $wpdb->posts WHERE post_name = %s", $name) ); 72 78 73 79 if ( isset($vars[0]) && $vars = $vars[0] ) { 74 80 if ( 'revision' == $vars->post_type && $vars->post_parent > 0 )