WordPress.org

Plugin Directory

Changeset 567869


Ignore:
Timestamp:
07/05/12 15:51:08 (22 months ago)
Author:
jbrinley
Message:

redirect the placeholder page to the blog front page

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wp-router/trunk/WP_Router.class.php

    r567865 r567869  
    11<?php 
    2 /** 
    3  * User: jbrinley 
    4  * Date: 5/18/11 
    5  * Time: 12:29 PM 
    6  */ 
    72  
    83class WP_Router extends WP_Router_Utility { 
     
    196191     */ 
    197192    public function parse_request( WP $query ) { 
     193        $this->redirect_placeholder($query); 
    198194        if ( $id = $this->identify_route($query) ) { 
    199195            $this->routes[$id]->execute($query); 
     196        } 
     197    } 
     198 
     199    /** 
     200     * Redirect the placeholder page back to the front page 
     201     * 
     202     * @param WP|WP_Query $query 
     203     */ 
     204    protected function redirect_placeholder( $query ) { 
     205        // we'll only get a 'wp_router_page' query var when visiting 
     206        // the page for a WP Router post, and there's only one of those 
     207        if ( !empty( $query->query_vars[WP_Router_Page::POST_TYPE]) ) { 
     208            wp_redirect( home_url(), 303 ); 
     209            exit(); 
    200210        } 
    201211    } 
Note: See TracChangeset for help on using the changeset viewer.