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

PCH Excerpt Generator: Fix wrong initialization of the module #2179

Merged
merged 3 commits into from
Feb 1, 2024

Conversation

vaurdan
Copy link
Contributor

@vaurdan vaurdan commented Jan 31, 2024

Description

The Excerpt Generator feature is currently being initialized in the init hook. Since the script only needs to be present on the block editor, using this specific hook is not desirable, since it will load the script everywhere in the site, including the front-end.

This PR changes the initialisation of the Excerpt Generator feature to the enqueue_block_editor_assets hook, and sets it with a priority of 9, to load before the PCH Editor Sidebar. This is required as loading after the sidebar does not work properly.

Motivation and context

Make sure that the Excerpt Generator script is only loaded when it is actually needed.

How has this been tested?

Tested locally on my WordPress environment, and validated that the script is only being loaded in the block editor context, and that it is functioning as before.

@vaurdan vaurdan added Component: PHP Pull requests that update PHP code Changelog: Fixed labels Jan 31, 2024
@vaurdan vaurdan self-assigned this Jan 31, 2024
@vaurdan vaurdan requested a review from a team as a code owner January 31, 2024 14:51
@acicovic acicovic added this to the 3.13.3 milestone Feb 1, 2024
@acicovic acicovic merged commit 3445bef into develop Feb 1, 2024
36 checks passed
@acicovic acicovic deleted the fix/excerpt-generator-initialization-hook branch February 1, 2024 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: Fixed Component: PHP Pull requests that update PHP code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants