WC_Admin_Webhooks::notices
Notices.
Method of the class: WC_Admin_Webhooks{}
No Hooks.
Returns
null. Nothing (null).
Usage
$result = WC_Admin_Webhooks::notices();
WC_Admin_Webhooks::notices() WC Admin Webhooks::notices code WC 10.6.2
public static function notices() {
// phpcs:ignore WordPress.Security.NonceVerification.Recommended
if ( isset( $_GET['deleted'] ) ) {
// phpcs:ignore WordPress.Security.NonceVerification.Recommended
$deleted = absint( $_GET['deleted'] );
/* translators: %d: count */
WC_Admin_Settings::add_message( sprintf( _n( '%d webhook permanently deleted.', '%d webhooks permanently deleted.', $deleted, 'woocommerce' ), $deleted ) );
}
// phpcs:ignore WordPress.Security.NonceVerification.Recommended
if ( isset( $_GET['updated'] ) ) {
WC_Admin_Settings::add_message( __( 'Webhook updated successfully.', 'woocommerce' ) );
}
// phpcs:ignore WordPress.Security.NonceVerification.Recommended
if ( isset( $_GET['created'] ) ) {
WC_Admin_Settings::add_message( __( 'Webhook created successfully.', 'woocommerce' ) );
}
// phpcs:ignore WordPress.Security.NonceVerification.Recommended
if ( isset( $_GET['error'] ) ) {
// phpcs:ignore WordPress.Security.NonceVerification.Recommended
foreach ( explode( '|', sanitize_text_field( wp_unslash( $_GET['error'] ) ) ) as $message ) {
WC_Admin_Settings::add_error( trim( $message ) );
}
}
}