Created
October 17, 2021 13:48
-
-
Save kwcjr/c2cf1a053eb28215c4a8dbb2a4d95661 to your computer and use it in GitHub Desktop.
Check for a woocommerce notice highlighting bad template files.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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