Revert some changes around class loading (#47987)

* Revert some changes around class loading

* Add changelog
This commit is contained in:
louwie17 2024-05-30 07:22:59 -03:00 committed by GitHub
parent 5080008e1d
commit b0a1787304
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 14 additions and 21 deletions

View File

@ -0,0 +1,5 @@
Significance: patch
Type: tweak
Comment: These changes revert some previous changes, no need for a changelog.

View File

@ -646,6 +646,15 @@ final class WooCommerce {
include_once WC_ABSPATH . 'includes/class-wc-auth.php';
include_once WC_ABSPATH . 'includes/class-wc-register-wp-admin-settings.php';
/**
* Tracks.
*/
include_once WC_ABSPATH . 'includes/tracks/class-wc-tracks.php';
include_once WC_ABSPATH . 'includes/tracks/class-wc-tracks-event.php';
include_once WC_ABSPATH . 'includes/tracks/class-wc-tracks-client.php';
include_once WC_ABSPATH . 'includes/tracks/class-wc-tracks-footer-pixel.php';
include_once WC_ABSPATH . 'includes/tracks/class-wc-site-tracking.php';
/**
* WCCOM Site.
*/
@ -658,15 +667,10 @@ final class WooCommerce {
if ( defined( 'WP_CLI' ) && WP_CLI ) {
include_once WC_ABSPATH . 'includes/class-wc-cli.php';
$this->tracks_includes();
}
if ( $this->is_request( 'admin' ) ) {
include_once WC_ABSPATH . 'includes/admin/class-wc-admin.php';
// Include tracking classes for use in admin.
$this->tracks_includes();
}
// We load frontend includes in the post editor, because they may be invoked via pre-loading of blocks.
@ -676,11 +680,6 @@ final class WooCommerce {
$this->frontend_includes();
}
if ( $this->is_rest_api_request() && ! $this->is_store_api_request() ) {
// Include tracks classes for use in REST API.
$this->tracks_includes();
}
if ( $this->is_request( 'cron' ) && 'yes' === get_option( 'woocommerce_allow_tracking', 'no' ) ) {
include_once WC_ABSPATH . 'includes/class-wc-tracker.php';
}
@ -760,17 +759,6 @@ final class WooCommerce {
include_once WC_ABSPATH . 'includes/class-wc-session-handler.php';
}
/**
* Include Tracks classes.
*/
public function tracks_includes() {
include_once WC_ABSPATH . 'includes/tracks/class-wc-tracks.php';
include_once WC_ABSPATH . 'includes/tracks/class-wc-tracks-event.php';
include_once WC_ABSPATH . 'includes/tracks/class-wc-tracks-client.php';
include_once WC_ABSPATH . 'includes/tracks/class-wc-tracks-footer-pixel.php';
include_once WC_ABSPATH . 'includes/tracks/class-wc-site-tracking.php';
}
/**
* Function used to Init WooCommerce Template Functions - This makes them pluggable by plugins and themes.
*/