rebase on oct-10-2023
This commit is contained in:
@@ -28,7 +28,6 @@ class WC_Admin {
|
||||
add_action( 'admin_init', array( $this, 'admin_redirects' ) );
|
||||
add_action( 'admin_footer', 'wc_print_js', 25 );
|
||||
add_filter( 'admin_footer_text', array( $this, 'admin_footer_text' ), 1 );
|
||||
add_action( 'init', array( 'WC_Site_Tracking', 'init' ) );
|
||||
|
||||
// Disable WXR export of schedule action posts.
|
||||
add_filter( 'action_scheduler_post_type_args', array( $this, 'disable_webhook_post_export' ) );
|
||||
@@ -67,12 +66,6 @@ class WC_Admin {
|
||||
include_once __DIR__ . '/class-wc-admin-importers.php';
|
||||
include_once __DIR__ . '/class-wc-admin-exporters.php';
|
||||
|
||||
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';
|
||||
|
||||
// Help Tabs.
|
||||
if ( apply_filters( 'woocommerce_enable_admin_help_tab', true ) ) {
|
||||
include_once __DIR__ . '/class-wc-admin-help.php';
|
||||
@@ -157,7 +150,19 @@ class WC_Admin {
|
||||
public function prevent_admin_access() {
|
||||
$prevent_access = false;
|
||||
|
||||
if ( apply_filters( 'woocommerce_disable_admin_bar', true ) && ! wp_doing_ajax() && isset( $_SERVER['SCRIPT_FILENAME'] ) && basename( sanitize_text_field( wp_unslash( $_SERVER['SCRIPT_FILENAME'] ) ) ) !== 'admin-post.php' ) {
|
||||
// Do not interfere with admin-post or admin-ajax requests.
|
||||
$exempted_paths = array( 'admin-post.php', 'admin-ajax.php' );
|
||||
|
||||
if (
|
||||
/**
|
||||
* This filter is documented in ../wc-user-functions.php
|
||||
*
|
||||
* @since 3.6.0
|
||||
*/
|
||||
apply_filters( 'woocommerce_disable_admin_bar', true )
|
||||
&& isset( $_SERVER['SCRIPT_FILENAME'] )
|
||||
&& ! in_array( basename( sanitize_text_field( wp_unslash( $_SERVER['SCRIPT_FILENAME'] ) ) ), $exempted_paths, true )
|
||||
) {
|
||||
$has_cap = false;
|
||||
$access_caps = array( 'edit_posts', 'manage_woocommerce', 'view_admin_dashboard' );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user