require/include php file in add_menu()
You can turn on output buffering, include (and evaluate) the PHP file, and save the output (of the evaluated code) in a variable, like so: ob_start(); include ‘docs/row_layouts.php’; $html = ob_get_clean(); Then just use ‘html’ => $html in the meta array when you call the $admin_bar->add_menu(). Or if you don’t need to evaluate any PHP … Read more