[wp-trac] [WordPress Trac] #42855: Add ability to filter header, sidebar, searchform, footer and template_part file paths
WordPress Trac
noreply at wordpress.org
Wed Feb 28 21:52:33 UTC 2018
#42855: Add ability to filter header, sidebar, searchform, footer and template_part
file paths
------------------------------+------------------------------
Reporter: atanasangelovdev | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Themes | Version:
Severity: normal | Resolution:
Keywords: has-patch | Focuses: template
------------------------------+------------------------------
Comment (by joyously):
Replying to [comment:9 MikeSchinkel]:
> Why can you not see the need to make the output of a theme valid AMP?
Why not for JSON? Why not for Unit Testing?
I'm not saying that your use cases should not be done, I'm saying that
they would not be accomplished by filtering the part name, as proposed.
> > They would be better done as action hooks, which already exist for
these functions.
>
> "pre" action hooks exist, but "post" action hooks do not.
> So are you saying you would join us in advocating for post action hooks
to be added to these functions?
Yes, each of the specific functions has a a "pre" action hook (like
`get_header` and `get_footer`), but nothing after the template part is
finished, so the current method would be to know the order they are called
in so that the next one can do the finish work on the previous.
Or, add an action for `all`, and apply logic to the action names that
start with `get_template_part`.
Or, any filtering of the HTML should be done on the client end.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/42855#comment:12>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list