What is the `apply_filters_ref_array()` function and when should it be used over `apply_filters()`?

WordPress Expert Medium

WordPress Expert — Medium

What is the `apply_filters_ref_array()` function and when should it be used over `apply_filters()`?

Key points

  • `apply_filters_ref_array()` allows modifying values that need reference semantics
  • `apply_filters()` passes arguments by value
  • `apply_filters_ref_array()` is useful for large arrays or objects
  • `apply_filters()` is limited in modifying certain data types

Ready to go further?

Related questions