[wp-trac] [WordPress Trac] #37653: customizer sections with 'active_callback' set to 'is_front_page' don't show when "Front page displays" "a static page"
WordPress Trac
noreply at wordpress.org
Sat Aug 13 18:02:09 UTC 2016
#37653: customizer sections with 'active_callback' set to 'is_front_page' don't
show when "Front page displays" "a static page"
--------------------------+-----------------------------
Reporter: Guss77 | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Themes | Version: 4.5.1
Severity: normal | Keywords:
Focuses: |
--------------------------+-----------------------------
When using a theme with customizer sections set up with the
"active_callback" feature set to "is_front_page", when customizing the
theme on a blog which has "Front page displays a static page" under
"Reading setting", these sections to not show up when accessing
"Appearance"->"Customize".
The problem appears to be that when running "Customize", the WP_Query
object is started with an empty string. When the query is empty, then
`is_front_page` looks at the value of `get_option( 'show_on_front')` and
if it is set to "posts" it checks `is_home` - which resolves to `true`
when the query is empty.
On the other hand, if `get_option( 'show_on_front')` resolves to "pages",
`is_front_page` then checks `$this->is_page( get_option( 'page_on_front' )
)` which never resolves to true when starting with an empty query.
The problem with `is_page` not responding correctly `get_option(
'show_on_front') == "pages"` is that `WP_Query::__construct()` will not do
anything if `empty($query)` and will not run `WP_Query::query()` - which
would in turn run `get_posts()` and then `parse_query` only there does
`get_option('show_on_front')` gets resolved and `is_page` is set if
needed.
Tested on 4.5.1, but the code paths I traced exist without change in
trunk. I'm running my tests on a mutli-site set up, so that might also
contribute to the issue, but not in anyway I managed to detect.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/37653>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list