Created
July 23, 2023 09:36
-
-
Save mustardBees/b117477abe642ca3516d2a50e228df6b to your computer and use it in GitHub Desktop.
Revisions
-
mustardBees created this gist
Jul 23, 2023 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,27 @@ <?php /** * Write a log entry. * * Helper function to write a log entry with a given title, category, and any * log data. Relies on the Maintenance Functionality mu-plugin being present. * * Usage: * * kanuka_log( 'Data Import', 'import', array( * 'status' => 'success', * 'data' => $data, * ) ); * * @param string $title The title of the log entry. * @param string|null $category The category of the log entry (optional). * @param mixed|null $data The log data to be saved (optional). */ function kanuka_log( $title, $category = null, $data = null ) { // Bail if our mu-plugin isn't present. if ( ! class_exists( 'Kanuka_Maintenance_Functionality' ) ) { return; } Kanuka_Maintenance_Functionality::log( $title, $category, $data ); }