WC_Admin_Status::remove_log()
Remove/delete the chosen file.
Method of the class: WC_Admin_Status{}
No Hooks.
Return
null
. Nothing (null).
Usage
$result = WC_Admin_Status::remove_log();
WC_Admin_Status::remove_log() WC Admin Status::remove log code WC 9.7.1
public static function remove_log() { if ( empty( $_REQUEST['_wpnonce'] ) || ! wp_verify_nonce( wp_unslash( $_REQUEST['_wpnonce'] ), 'remove_log' ) ) { // WPCS: input var ok, sanitization ok. wp_die( esc_html__( 'Action failed. Please refresh the page and retry.', 'woocommerce' ) ); } if ( ! empty( $_REQUEST['handle'] ) ) { // WPCS: input var ok. $log_handler = new WC_Log_Handler_File(); $log_handler->remove( wp_unslash( $_REQUEST['handle'] ) ); // WPCS: input var ok, sanitization ok. } wp_safe_redirect( esc_url_raw( admin_url( 'admin.php?page=wc-status&tab=logs' ) ) ); exit(); }