2

When I was looking at the latest WP 6.3 release note, I saw that they improved performances on the _wp_array_get() function and I thought: That's a sweet function that I would like to use (I had a similar one in my personal toolkit).

And then I saw that it was flagged as internal.

https://developer.wordpress.org/reference/functions/_wp_array_get/

Does anyone have an idea why we shouldn't use those functions? This one is called 262 times in WP core itself. It sure looks like something worth using.

1 Answer 1

6

Internal/private functions (their names are prefixed with an underscore) can be subject to changes without a warning and break backward compatibility unlike the public functions in general.

This makes the core developement move faster being able to change part of the code without having to take deprecation steps over multiple versions of core.

Many internal functions might not change at all but it's an extra risk to use them in your plugin. Might be safer to copy it into your own wrapper instead.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.