📜  WordPress:将 do_action 的输出保存在变量中 - 无论代码示例

📅  最后修改于: 2022-03-11 15:00:46.586000             🧑  作者: Mango

代码示例1
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.