Answers for "WordPress: save output of do_action in variable"

0

WordPress: save output of do_action in variable

ob_start(); // start capturing output.
do_action('any_action_you_want');
$save_output_here = ob_get_contents(); // the actions output will now be stored in the variable as a string!
ob_end_clean(); // never forget this or you will keep capturing output.
Posted by: Guest on July-28-2021

Code answers related to "WordPress: save output of do_action in variable"

Browse Popular Code Answers by Language