WC_Query::get_errors
Get any errors from querystring.
Method of the class: WC_Query{}
No Hooks.
Returns
null. Nothing (null).
Usage
$WC_Query = new WC_Query(); $WC_Query->get_errors();
WC_Query::get_errors() WC Query::get errors code WC 10.8.1
public function get_errors() {
// phpcs:ignore WordPress.Security.NonceVerification.Recommended
$error = ! empty( $_GET['wc_error'] ) ? sanitize_text_field( wp_unslash( $_GET['wc_error'] ) ) : '';
if ( $error && ! wc_has_notice( $error, 'error' ) ) {
wc_add_notice( $error, 'error' );
}
}