[wp-trac] [WordPress Trac] #46187: Add a dynamic hook to filter the content of a single block.

WordPress Trac noreply at wordpress.org
Tue Nov 24 05:05:36 UTC 2020


#46187: Add a dynamic hook to filter the content of a single block.
-----------------------------+------------------------------
 Reporter:  manzoorwani.jk   |       Owner:  (none)
     Type:  enhancement      |      Status:  new
 Priority:  normal           |   Milestone:  Awaiting Review
Component:  Editor           |     Version:
 Severity:  normal           |  Resolution:
 Keywords:  has-patch close  |     Focuses:
-----------------------------+------------------------------

Comment (by manzoorwani.jk):

 Well, both of those arguments are not valid.

 You need to follow the coding standards in the code you write and you are
 not responsible for the dynamic part of the filter. An example of that is
 `save_post_{$post->post_type}`, where `post_type` can have some characters
 like `-` which apparently are not as per the coding standards for filter
 names, although there is nothing mentioned about filter names in WPCS.
 Another example is `admin_post_{$action}`, where I can write anything as
 `$action`, including `/`.

 Regarding the order of dynamic and normal filter, aren't there tens of
 such dynamic filters in WordPress?? Is there any standard for order of
 such filters? Example is again `save_post` vs `save_post_{$post_type}`.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/46187#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list