woocommerce / woocommerce-product-tables-feature-plugin

Implements new data-stores and moves product data into custom tables, with a new, normalised data structure.
GNU General Public License v3.0
192 stars 32 forks source link

WC Admin Notice advising to update to 3.5.beta isn't visible #115

Closed javorszky closed 6 years ago

javorszky commented 6 years ago

Using code as of https://github.com/woocommerce/woocommerce-product-tables-feature-plugin/commit/3d8970d255be06a0a3224cba417a267c1e40d93e (latest master)

WooCommerce is v 3.4.4. As per code here I expected a notice telling me

You need WooCommerce 3.5 development version or higher to run the Custom Product Tables plugin.

Instead the notice is nowhere to be found. Interestingly, when I look at Query monitor, I have this here:

screen shot 2018-07-30 at 20 24 00

This happens with only WooCommerce and the feature plugin being active.

Putting a die in that block confirms that it runs.

Reason

WC_Admin_Notices::add_notice( $name ) is to be used for core notices, of which there is a short list: https://github.com/woocommerce/woocommerce/blob/master/includes/admin/class-wc-admin-notices.php#L28-L38

What is needed is WC_Admin_Notices::add_custom_notice( $name, $html )

PR incoming