[wp-trac] [WordPress Trac] #51461: Update WordPress packages

WordPress Trac noreply at wordpress.org
Thu Oct 29 15:35:56 UTC 2020


#51461: Update WordPress packages
-----------------------------------+-------------------------------
 Reporter:  isabel_brison          |       Owner:  jorgefilipecosta
     Type:  enhancement            |      Status:  closed
 Priority:  normal                 |   Milestone:  5.6
Component:  Editor                 |     Version:
 Severity:  normal                 |  Resolution:  fixed
 Keywords:  2nd-opinion has-patch  |     Focuses:
-----------------------------------+-------------------------------

Comment (by jorgefilipecosta):

 Hi @dd32, @iandunn,

 The function wp_array_get got introduced to be an equivalent of JavaScript
 lodash get https://lodash.com/docs/4.17.15#get.

 The lodash get is very used on Gutenberg client-side and we have functions
 that need to work on both the client and the server. So in order for the
 code to be an almost direct translation of JavaScript to PHP, it seemed
 good to introduce an equivalent function in PHP.

 The usages we have now in fact could easily be implemented using an
 alternative approach and they don't use the subarray functionality where
 the power of this function relies on.
 But soon we will have in core code where the function with subarray
 functionality is needed
 https://github.com/WordPress/gutenberg/blob/ba5cecc8c82665ee7d89e36457e7d47de5d81131/lib
 /global-styles.php#L689 where even the path is not static but a variable
 itself.

 I like the idea of marking the function as internal-use at least for now
 until the function proves useful in some cases.

 Is there any guide on how to mark a function as internal-use?

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


More information about the wp-trac mailing list