Automattic\WooCommerce\Blocks\Domain

Bootstrap::add_build_notice()protectedWC 1.0

Add a notice stating that the build has not been done yet.

Method of the class: Bootstrap{}

No Hooks.

Return

null. Nothing (null).

Usage

// protected - for code of main (parent) or child class
$result = $this->add_build_notice();

Bootstrap::add_build_notice() code WC 8.6.1

protected function add_build_notice() {
	if ( $this->is_built() ) {
		return;
	}
	add_action(
		'admin_notices',
		function() {
			echo '<div class="error"><p>';
			printf(
				/* translators: %1$s is the install command, %2$s is the build command, %3$s is the watch command. */
				esc_html__( 'WooCommerce Blocks development mode requires files to be built. From the plugin directory, run %1$s to install dependencies, %2$s to build the files or %3$s to build the files and watch for changes.', 'woocommerce' ),
				'<code>npm install</code>',
				'<code>npm run build</code>',
				'<code>npm start</code>'
			);
			echo '</p></div>';
		}
	);
}