Automattic\WooCommerce
Autoloader::missing_autoloader
If the autoloader is missing, add an admin notice.
Method of the class: Autoloader{}
No Hooks.
Returns
null. Nothing (null).
Usage
$result = Autoloader::missing_autoloader();
Autoloader::missing_autoloader() Autoloader::missing autoloader code WC 10.7.0
<?php
protected static function missing_autoloader() {
if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
// This message is not translated as at this point it's too early to load translations.
error_log( // phpcs:ignore
esc_html( 'Your installation of WooCommerce is incomplete. If you installed WooCommerce from GitHub, please refer to this document to set up your development environment: https://developer.woocommerce.com/docs/contribution/contributing/#setting-up-your-development-environment' )
);
}
add_action(
'admin_notices',
function () {
?>
<div class="notice notice-error">
<p>
<?php
printf(
/* translators: 1: is a link to a support document. 2: closing link */
esc_html__( 'Your installation of WooCommerce is incomplete. If you installed WooCommerce from GitHub, %1$splease refer to this document%2$s to set up your development environment.', 'woocommerce' ),
'<a href="' . esc_url( 'https://developer.woocommerce.com/docs/contribution/contributing/#setting-up-your-development-environment' ) . '" target="_blank" rel="noopener noreferrer">',
'</a>'
);
?>
</p>
</div>
<?php
}
);
}