[wp-trac] [WordPress Trac] #12955: Add get_post filter

WordPress Trac noreply at wordpress.org
Thu Jun 26 20:16:43 UTC 2025


#12955: Add get_post filter
-------------------------------------------------+-------------------------
 Reporter:  JohnLamansky                         |       Owner:  (none)
     Type:  feature request                      |      Status:  new
 Priority:  normal                               |   Milestone:  Future
                                                 |  Release
Component:  Posts, Post Types                    |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch dev-feedback needs-        |     Focuses:
  refresh                                        |
-------------------------------------------------+-------------------------

Comment (by westonruter):

 I think hooking into the `the_posts` filter the `the_post` action are the
 easiest way to do do this. This is what was implemented in the Customize
 Posts plugin:

 https://github.com/xwp/wp-customize-
 posts/blob/bfc6b4cd8344537edc2af5451b5a4a8d75d96293/php/class-wp-
 customize-posts-preview.php#L273-L288
 https://github.com/xwp/wp-customize-
 posts/blob/bfc6b4cd8344537edc2af5451b5a4a8d75d96293/php/class-wp-
 customize-posts-preview.php#L151-L176

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


More information about the wp-trac mailing list