Inventory_Presser_Allow_Inventory_As_Home_Page::redirect_the_page( WP_Query $wp_query )
Performs the redirect from our special page to the inventory archive
On This Page
Parameters Parameters
- $wp_query
-
(WP_Query) (Required)
Return Return
(void)
Source Source
File: includes/class-allow-inventory-as-home-page.php
public function redirect_the_page( $wp_query ) { if ( is_admin() ) { return; } $page_id = intval( $wp_query->get( 'page_id', 0 ) ); if ( 0 === $page_id ) { // This isn't even a request for a page. return; } if ( $page_id == get_option( 'page_on_front' ) && $page_id == self::find_page_id() ) { wp_safe_redirect( get_post_type_archive_link( INVP::POST_TYPE ) ); exit; } }
Expand full source codeCollapse full source codeView on Github