[wp-trac] [WordPress Trac] #50787: Consolidate the logic for displaying WP & PHP compatibility messages for themes

WordPress Trac noreply at wordpress.org
Wed Oct 14 21:26:02 UTC 2020


#50787: Consolidate the logic for displaying WP & PHP compatibility messages for
themes
-------------------------------------------------+-------------------------
 Reporter:  SergeyBiryukov                       |       Owner:
                                                 |  SergeyBiryukov
     Type:  enhancement                          |      Status:  accepted
 Priority:  normal                               |   Milestone:  5.6
Component:  Site Health                          |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch dev-feedback needs-        |     Focuses:
  testing                                        |  administration
-------------------------------------------------+-------------------------

Comment (by hellofromTonya):

 A couple of code review notes:

 **Function naming**

 For the new function name, it's not clear to me what the function will do
 when invoked. I can infer. But I'm wondering if it would be more clear if
 action-based such as


 {{{
 wp_get_compatibility_string
 }}}

 to tell us that it "gets" and returns a single string. What do you think
 @afragen ?

 **Performance**

 Each time the function is called, the `$strings` array rebuilds. This
 means each `__()` has to run again, ie there are 12 of them. Is this
 necessary? Do we need to retranslate and rebuild the array each time the
 function is invoked?

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


More information about the wp-trac mailing list