Directory

Load `theme-preview.php` after pluggable functions get defined by okmttdhr · Pull Request #5028 · WordPress/wordpress-develop · GitHub
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

Load theme-preview.php after pluggable functions get defined #5028

Closed
wants to merge 1 commit into from

Conversation

okmttdhr
Copy link

This PR fixes WordPress/gutenberg#53284. #4959 tried to fix the same issue, but there is a concern about its reliability, depending on timing.

Hence, this PR changed to load theme-previews.php, which is the cause of this issue, after the pluggable functions. The reason for this is that running capability checks before defining pluggable functions itself does not seem to be a good approach.

Fixes WordPress/gutenberg#53284
Trac ticket: https://core.trac.wordpress.org/ticket/59000


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

@okmttdhr okmttdhr marked this pull request as ready for review August 18, 2023 06:34
@okmttdhr okmttdhr changed the title Load theme-preview.php after pluggable functions get defined Load theme-preview.php after pluggable functions get defined Aug 18, 2023
@okmttdhr
Copy link
Author

Hello, @SergeyBiryukov @johnbillion!
I've made the changes as described in the PR to make the block theme previews work on every site. I'd appreciate it if you take a look!

Both failing tests (E2E, performance) are passing on my local, at least.
Screen Shot 2023-08-18 at 16 35 34
Screen Shot 2023-08-18 at 16 35 42

@scruffian
Copy link

This makes perfect sense to me, thanks for working on it.

@okmttdhr
Copy link
Author

Hello, @azaozz @mtias @noisysocks!
To fix the crash of Block Theme Previews, I'd appreciate it if you could review and commit this change to the core. Thank you in advance!

@okmttdhr
Copy link
Author

okmttdhr commented Aug 31, 2023

Hello, @azaozz @mtias @noisysocks! To fix the crash of Block Theme Previews, I'd appreciate it if you could review and commit this change to the core. Thank you in advance!

I'm closing this PR in favor of a new one: #5107.

@okmttdhr okmttdhr closed this Aug 31, 2023
@okmttdhr okmttdhr deleted the fix/theme-preview-timing branch August 31, 2023 00:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants