WC_Admin_Webhooks::notices()public staticWC 1.0

Notices.

{} Это метод класса: WC_Admin_Webhooks{}

Хуков нет.

Возвращает

null. Ничего.

Использование

$result = WC_Admin_Webhooks::notices();

Код WC_Admin_Webhooks::notices() WC 6.9.1

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