cbox_theme_auto_create_home_page() fires on wp, which means that page_on_front and the homepage-template page template aren't set until the first front-end pageload. This can result in the first pageload being the WP default, which is confusing for the administrator. It also means that the queries run on every WP pageload, which seems wasteful.
It's not currently possible to swap this out directly with a direct call or a different hook, because of the use of is_404().
Ideally, we'd simply call this function during the installation process, eliminating the need to call it again on subsequent pageloads. If that's not possible, perhaps we can check only on admin pages, or when the super admin is logged in.
cbox_theme_auto_create_home_page()
fires onwp
, which means thatpage_on_front
and the homepage-template page template aren't set until the first front-end pageload. This can result in the first pageload being the WP default, which is confusing for the administrator. It also means that the queries run on every WP pageload, which seems wasteful.It's not currently possible to swap this out directly with a direct call or a different hook, because of the use of
is_404()
.Ideally, we'd simply call this function during the installation process, eliminating the need to call it again on subsequent pageloads. If that's not possible, perhaps we can check only on admin pages, or when the super admin is logged in.
Edit by r-a-y - See #120