WordPress.org

Make WordPress Core

Opened 11 months ago

Last modified 4 months ago

#51720 closed defect (bug)

Make wp_array_get internal for now. Add tests to _wp_array_get; — at Version 5

Reported by: jorgefilipecosta Owned by:
Milestone: 5.6 Priority: normal
Severity: normal Version: 5.6
Component: General Keywords: has-patch has-unit-tests commit
Focuses: Cc:

Description (last modified by jorgefilipecosta)

According to feedback received at #51461. This ticket contains a patch to make wp_array_get internal.
After more core code uses it we can decide if the function is valuable and something we want to expose or not.
This Patch also adds test cases and does some enhancements to the function wp_array_get to make it more similar to lodash namely the default value and the way null is handled.

Change History (5)

This ticket was mentioned in PR #692 on WordPress/wordpress-develop by jorgefilipecosta.


11 months ago

According to feedback received in ticket 51461. This PR contains makes wp_array_get internal.
After more core code uses it we can decide if the function is valuable and something we want to expose or not.

Trac ticket: core.trac.wordpress.org/ticket/51720

#2 @SergeyBiryukov
11 months ago

  • Description modified (diff)

This ticket was mentioned in Slack in #core by hellofromtonya. View the logs.


11 months ago

#4 @johnbillion
11 months ago

@jorgefilipecosta Can you point us to the upstream tests for this function please? It would be worth bringing them into core regardless of whether it's a private function or not.

Last edited 11 months ago by johnbillion (previous) (diff)

#5 @jorgefilipecosta
11 months ago

  • Description modified (diff)
  • Summary changed from Make wp_array_get internal for now to Make wp_array_get internal for now. Add tests to _wp_array_get;
Note: See TracTickets for help on using tickets.