[wp-trac] [WordPress Trac] #46743: A way to detect whether the current theme supports wp_body_open()

WordPress Trac noreply at wordpress.org
Thu Apr 18 06:18:12 UTC 2019


#46743: A way to detect whether the current theme supports wp_body_open()
-----------------------------------------+---------------------
 Reporter:  SergeyBiryukov               |       Owner:  (none)
     Type:  defect (bug)                 |      Status:  new
 Priority:  high                         |   Milestone:  5.2
Component:  Themes                       |     Version:  trunk
 Severity:  normal                       |  Resolution:
 Keywords:  has-patch reporter-feedback  |     Focuses:
-----------------------------------------+---------------------
Changes (by pento):

 * keywords:  has-patch 2nd-opinion => has-patch reporter-feedback


Comment:

 I don't really like the idea of new theme feature if we don't have to.

 Are there some examples of how plugins put their code as soon after the
 `<body>` tag as possible? Legit examples only, please, I have little
 interest in supporting [https://plugins.trac.wordpress.org/browser
 /duracelltomi-google-tag-manager/trunk/public/frontend.php#L882 hacks like
 this].

 It seems like plugins would be able to add their hook to the
 `wp_body_open` action, but leave their current practice in place, and
 check `did_action( 'wp_body_open' )` to decide if they need to fall back
 to their current practice.

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


More information about the wp-trac mailing list