WC_Admin_Webhooks::notices()public staticWC 1.0

Notices.

{} It's a method of the class: WC_Admin_Webhooks{}

No Hooks.

Return

null. Nothing.

Usage

$result = WC_Admin_Webhooks::notices();

Code of WC_Admin_Webhooks::notices() WC 6.7.0

public static function notices() {
	if ( isset( $_GET['deleted'] ) ) { // WPCS: input var okay, CSRF ok.
		$deleted = absint( $_GET['deleted'] ); // WPCS: input var okay, CSRF ok.

		/* translators: %d: count */
		WC_Admin_Settings::add_message( sprintf( _n( '%d webhook permanently deleted.', '%d webhooks permanently deleted.', $deleted, 'woocommerce' ), $deleted ) );
	}

	if ( isset( $_GET['updated'] ) ) { // WPCS: input var okay, CSRF ok.
		WC_Admin_Settings::add_message( __( 'Webhook updated successfully.', 'woocommerce' ) );
	}

	if ( isset( $_GET['created'] ) ) { // WPCS: input var okay, CSRF ok.
		WC_Admin_Settings::add_message( __( 'Webhook created successfully.', 'woocommerce' ) );
	}

	if ( isset( $_GET['error'] ) ) { // WPCS: input var okay, CSRF ok.
		foreach ( explode( '|', sanitize_text_field( wp_unslash( $_GET['error'] ) ) ) as $message ) { // WPCS: input var okay, CSRF ok.
			WC_Admin_Settings::add_error( trim( $message ) );
		}
	}
}