Automattic\WooCommerce\Internal\StockNotifications

StockSyncController::output_admin_noticepublicWC 1.0

Add admin notices.

Method of the class: StockSyncController{}

No Hooks.

Returns

null. Nothing (null).

Usage

$StockSyncController = new StockSyncController();
$StockSyncController->output_admin_notice(): void;

StockSyncController::output_admin_notice() code WC 10.3.6

public function output_admin_notice(): void {
	if ( ! function_exists( 'wp_admin_notice' ) ) {
		return;
	}

	$notice_message = get_option( 'wc_customer_stock_notifications_product_sync_notice' );
	if ( empty( $notice_message ) ) {
		return;
	}

	\wp_admin_notice(
		$notice_message,
		array(
			'type'        => 'info',
			'id'          => 'woocommerce_customer_stock_notifications_product_sync_notice',
			'dismissible' => false,
		)
	);

	delete_option( 'wc_customer_stock_notifications_product_sync_notice' );
}