Has anyone ever been able to insert the output from do_action into an array at a specific index? For example, if you have the array and function below:
$myarr = array(1,2,3,4);
my_function(){
return 4 + 4;
}
I'm trying to do:
array_splice($myarr, 2, 0, do_action('my_function'););
And have it output:
[1, 2, 8, 3, 4]
I'm trying to integrate something like this in a wordpress page, and it breaks my entire page.