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

Add do_action hooks when rendering templates and template parts. ( #32309 ) #32316

Open
wants to merge 2 commits into
base: trunk
Choose a base branch
from

Conversation

bobbingwide
Copy link
Contributor

Description

I've added some calls to do_action() for two new action hooks: rendering_template and rendering_template_part.
These allow plugins / themes to develop extensions that will enable problem determination and/or logic associated with invocation context.
For example, I use these hooks to implement a debug block that will indicate which template has been used, the start and end of a template part and other information relevant during problem determination. See bobbingwide/sb-debug-block#2

How has this been tested?

I tested the changes by applying the rendering_template hook to Gutenberg v10.7.2 build, and the rendering_template_part hook to an override of render_core_block_template_part in my ThisIs theme.

Unfortunately I couldn't test using the latest extract from Gutenberg trunk since I could not get the build to work. Both npm run dev and npm run build fail. See bobbingwide/sb-debug-block#3

Screenshots

Types of changes

Implements Feature Request #32309

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • I've tested my changes with keyboard and screen readers.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
  • I've updated all React Native files affected by any refactorings/renamings in this PR (please manually search all *.native.js files for terms that need renaming or removal).

@annezazu annezazu added [Block] Template Part Affects the Template Parts Block [Feature] Template Editing Mode Related to the template editor available in the Block Editor [Type] Enhancement A suggestion for improvement. labels Aug 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Template Part Affects the Template Parts Block [Feature] Template Editing Mode Related to the template editor available in the Block Editor [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants