Skip to content

Instantly share code, notes, and snippets.

@kwcjr
Created October 17, 2021 13:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kwcjr/c2cf1a053eb28215c4a8dbb2a4d95661 to your computer and use it in GitHub Desktop.
Save kwcjr/c2cf1a053eb28215c4a8dbb2a4d95661 to your computer and use it in GitHub Desktop.
Check for a woocommerce notice highlighting bad template files.
ob_start(); // start capturing output.
WC_Admin_Notices::template_file_check_notice(); // Check for a notice highlighting bad template files.
$notice = 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.
echo $notice; // output to screen or do something else with it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment