Merge pull request #23840 from unfulvio/23839-do-not-throw-notice-rest-api-includes
[#23839] Do not throw autoloader notice if following notice instructions
This commit is contained in:
commit
bf01eccfcd
|
@ -91,7 +91,7 @@ class WC_Autoloader {
|
|||
}
|
||||
|
||||
// Prevent plugins from breaking if they extend the rest API early.
|
||||
if ( 0 === strpos( $class, 'wc_rest_' ) && ! did_action( 'rest_api_init' ) ) {
|
||||
if ( 0 === strpos( $class, 'wc_rest_' ) && ! class_exists( $class, false ) && ! did_action( 'rest_api_init' ) ) {
|
||||
wc_doing_it_wrong( $class, __( 'Classes that extend the WooCommerce/WordPress REST API should only be loaded during the rest_api_init action, or should call WC()->api->rest_api_includes() manually.', 'woocommerce' ), '3.6' );
|
||||
WC()->api->rest_api_includes();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue