Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ensure front page can be set if existing front page is deleted #418

Merged

Conversation

greatislander
Copy link
Contributor

@greatislander greatislander commented Aug 10, 2023

Resolves #402.

A custom front page can't be set if the site option show_on_front is set to posts. The private function _reset_front_page_settings_for_post is added as an action to the before_delete_post and wp_trash_post hooks; if the page assigned to the page_on_front option is deleted, this function changes the show_on_front option to posts, meaning that a new front page can't be assigned until show_on_front is set to page again. Aldine doesn't use posts, and there's no interface to change what's shown on the front page from a page to posts or vice versa exposed in Aldine (the reading options page is hidden). I resolved the issue by unhooking the _reset_front_page_settings_for_post function. Now, if the selected front page is deleted, the home page will show a 404 until a new one is selected in the customizer.

@SteelWagstaff SteelWagstaff self-requested a review August 15, 2023 13:42
@SteelWagstaff SteelWagstaff merged commit 735e7b8 into pressbooks:dev Aug 15, 2023
7 checks passed
@greatislander greatislander deleted the feat/home-page-unrecoverable branch August 15, 2023 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deleting Front Page Unrecoverable
2 participants