WC_Admin_Webhooks::notices()public staticWC 1.0

Notices.

Method of the class: WC_Admin_Webhooks{}

No Hooks.

Return

null. Nothing (null).

Usage

$result = WC_Admin_Webhooks::notices();

WC_Admin_Webhooks::notices() code WC 8.7.0

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 ) );
		}
	}
}