How to append to an array and return the results in a filter?

Question

i am trying to get array in filters in wordpress i dont khnow how to do it.

add_filter('ft_tabs', function ($tabs) {
    return array_push($tabs, array(
        '111' => 'aaa',
        '222' => 'bbb'
    ));
}, 10);

add_filter('ft_tabs', function ($tabs) {
    return array_push($tabs, array(
        '333' => 'ccc',
        '444' => 'ddd'
    ));
}, 15);

$array = array();
$asdasd = apply_filters('ft_tabs', $array);
0
, Saeed 1 year 2020-07-19T22:11:15-05:00 0 Answers 45 views 0

Leave an answer

Browse
Browse