WC_Admin_Dashboard::__construct()

Hook in tabs.


Description Description


Source Source

File: includes/admin/class-wc-admin-dashboard.php

		public function __construct() {
			// Only hook in admin parts if the user has admin access.
			if ( current_user_can( 'view_woocommerce_reports' ) || current_user_can( 'manage_woocommerce' ) || current_user_can( 'publish_shop_orders' ) ) {
				// If on network admin, only load the widget that works in that context and skip the rest.
				if ( is_multisite() && is_network_admin() ) {
					add_action( 'wp_network_dashboard_setup', array( $this, 'register_network_order_widget' ) );
				} else {
					add_action( 'wp_dashboard_setup', array( $this, 'init' ) );
				}
			}
		}


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.