WordPress filter Passing by reference

Question

I have this filter:

    $post_arr = apply_filters('insert_product_post_data', $post_arr, $data);
    add_filter('insert_product_post_data', 'my_filter', 10, 2);
    function my_filter($post_arr, &$data)
    {
    //change $data here
    }

I need to change the value of $data is any way to do this ?

0
, Morad Angel 3 years 2020-07-06T10:10:36-05:00 0 Answers 69 views 0

Leave an answer

Browse
Browse