Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #18318


Ignore:
Timestamp:
08/03/2011 08:28:15 AM (14 years ago)
Author:
dd32
Comment:

See #4328 (If you know a ticket exists, you can usually find it by searching in a specific component - searching for old tickets isn't exactly simple for new trac users)

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #18318

    • Property Status changed from new to closed
    • Property Component changed from General to Canonical
    • Property Resolution changed from to duplicate
    • Property Milestone changed from Awaiting Review to
  • Ticket #18318 – Description

    initial v1  
    1919                        $post_type = 'page';
    2020                else
    21                         $post_type = 'post';}}}
     21                        $post_type = 'post';
     22}}}
    2223
    2324The trouble is pagename in $wp_query->query_vars['pagename'] is never set/found, so the guess for post_type always guesses the post_type as a 'post'. Thus when a page redirect is expected, the query doesn't fetch any results.
    2425
    2526example query vars for post expecting redirection
     27{{{
    2628Array ( [page] => 0 [name] => sample-post-with-threaded-comments [error] => [m] => 0 [p] => 0 [post_parent] => [subpost] => [subpost_id] => [attachment] => [attachment_id] => 0 [static] => [pagename] => [page_id] => 0 [second] => [minute] => [hour] => [day] => 0 [monthnum] => 0 [year] => 0 [w] => 0 [category_name] => [tag] => [cat] => [tag_id] => [author_name] => [feed] => [tb] => [paged] => 0 [comments_popup] => [meta_key] => [meta_value] => [preview] => [s] => [sentence] => [fields] => [category__in] => Array ( ) [category__not_in] => Array ( ) [category__and] => Array ( ) [post__in] => Array ( ) [post__not_in] => Array ( ) [tag__in] => Array ( ) [tag__not_in] => Array ( ) [tag__and] => Array ( ) [tag_slug__in] => Array ( ) [tag_slug__and] => Array ( ) [ignore_sticky_posts] => [suppress_filters] => [cache_results] => 1 [update_post_term_cache] => 1 [update_post_meta_cache] => 1 [post_type] => [posts_per_page] => 10 [nopaging] => [comments_per_page] => 50 [no_found_rows] => [order] => DESC )
    2729
    2830example query vars for page expecting redirection
    2931Array ( [page] => 0 [name] => sumedh [error] => [m] => 0 [p] => 0 [post_parent] => [subpost] => [subpost_id] => [attachment] => [attachment_id] => 0 [static] => [pagename] => [page_id] => 0 [second] => [minute] => [hour] => [day] => 0 [monthnum] => 0 [year] => 0 [w] => 0 [category_name] => [tag] => [cat] => [tag_id] => [author_name] => [feed] => [tb] => [paged] => 0 [comments_popup] => [meta_key] => [meta_value] => [preview] => [s] => [sentence] => [fields] => [category__in] => Array ( ) [category__not_in] => Array ( ) [category__and] => Array ( ) [post__in] => Array ( ) [post__not_in] => Array ( ) [tag__in] => Array ( ) [tag__not_in] => Array ( ) [tag__and] => Array ( ) [tag_slug__in] => Array ( ) [tag_slug__and] => Array ( ) [ignore_sticky_posts] => [suppress_filters] => [cache_results] => 1 [update_post_term_cache] => 1 [update_post_meta_cache] => 1 [post_type] => [posts_per_page] => 10 [nopaging] => [comments_per_page] => 50 [no_found_rows] => [order] => DESC )
     32}}}