Opened 10 years ago
Closed 10 years ago
#29550 closed defect (bug) (fixed)
Twenty Fourteen: Featured Content pre_get_posts method can incorrectly bail if front page gets set back to 'posts'
Reported by: | kwight | Owned by: | SergeyBiryukov |
---|---|---|---|
Milestone: | 4.1 | Priority: | normal |
Severity: | normal | Version: | 3.8 |
Component: | Bundled Theme | Keywords: | has-patch |
Focuses: | Cc: |
Description
Currently, the pre_get_posts
filter will bail if the page_on_front
setting has a value. This value is set once the user chooses a static page for the front page of their site.
$page_on_front = get_option( 'page_on_front' ); // Bail if the blog page is not the front page. if ( ! empty( $page_on_front ) ) { return; }
However, that value is not affected if the user chooses to set their blog back to posts on the front page, causing the above check to become ineffective. Instead, let's check against the show_on_front
option, for a correct evaluation in all cases.
// Bail if the blog page is not the front page. if ( 'posts' !== get_option( 'show_on_front' ) ) { return; }
Attachments (1)
Change History (4)
Note: See
TracTickets for help on using
tickets.
Confirmed when changing the front page via Customizer. See #28454.