PHP 8.0.30
Preview: class-wc-admin-pointers.php Size: 2.19 KB
/home/certprox/zang.certproxywizard.com/wp/wp-content/plugins/woocommerce/includes/admin/class-wc-admin-pointers.php

<?php
/**
 * Adds and controls pointers for contextual help/tutorials
 *
 * @package WooCommerce\Admin\Pointers
 * @version 2.4.0
 */

use Automattic\WooCommerce\Internal\Admin\WCAdminAssets;
use Automattic\WooCommerce\Admin\Features\Features;

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

/**
 * WC_Admin_Pointers Class.
 */
class WC_Admin_Pointers {

	/**
	 * Constructor.
	 */
	public function __construct() {
		add_action( 'admin_enqueue_scripts', array( $this, 'setup_pointers_for_screen' ) );
	}

	/**
	 * Setup pointers for screen.
	 */
	public function setup_pointers_for_screen() {
		$screen = get_current_screen();

		if ( ! $screen ) {
			return;
		}

		switch ( $screen->id ) {
			case 'product':
				$this->create_product_tutorial();
				$this->create_variable_product_tutorial();
				break;
			case 'woocommerce_page_wc-addons':
				$this->create_wc_addons_tutorial();
				break;
		}
	}

	/**
	 * Pointers for creating a product.
	 */
	public function create_product_tutorial() {
		if ( ! isset( $_GET['tutorial'] ) || ! current_user_can( 'manage_options' ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
			return;
		}

		global $wp_post_types;

		if ( ! isset( $wp_post_types ) ) {
			return;
		}

		$labels          = $wp_post_types['product']->labels;
		$labels->add_new = __( 'Enable guided mode', 'woocommerce' );
		WCAdminAssets::register_script( 'wp-admin-scripts', 'product-tour', true );
	}

	/**
	 * Pointers for creating a variable product.
	 */
	public function create_variable_product_tutorial() {
		if ( ! current_user_can( 'manage_options' ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
			return;
		}

		WCAdminAssets::register_script( 'wp-admin-scripts', 'variable-product-tour', true );
	}

	/**
	 * Pointers for accessing In-App Marketplace.
	 */
	public function create_wc_addons_tutorial() {
		if ( ! isset( $_GET['tutorial'] ) || ! current_user_can( 'manage_options' ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
			return;
		}

		if ( wp_is_mobile() ) {
			return; // Permit In-App Marketplace Tour on desktops only.
		}

		WCAdminAssets::register_script( 'wp-admin-scripts', 'wc-addons-tour', true );
	}
}

new WC_Admin_Pointers();

Directory Contents

Dirs: 10 × Files: 34

Name Size Perms Modified Actions
helper DIR
- drwxr-xr-x 2026-03-30 10:22:30
Edit Download
importers DIR
- drwxr-xr-x 2026-03-30 10:22:30
Edit Download
- drwxr-xr-x 2026-03-30 10:22:30
Edit Download
- drwxr-xr-x 2026-03-30 10:22:30
Edit Download
- drwxr-xr-x 2026-03-30 10:22:30
Edit Download
notes DIR
- drwxr-xr-x 2026-03-30 10:22:31
Edit Download
- drwxr-xr-x 2026-03-30 10:22:31
Edit Download
reports DIR
- drwxr-xr-x 2026-03-30 10:22:31
Edit Download
settings DIR
- drwxr-xr-x 2026-03-30 10:22:31
Edit Download
views DIR
- drwxr-xr-x 2026-03-30 10:22:31
Edit Download
13.24 KB lrw-r--r-- 2026-03-30 10:22:29
Edit Download
7.07 KB lrw-r--r-- 2026-03-30 10:22:29
Edit Download
7.82 KB lrw-r--r-- 2026-03-30 10:22:29
Edit Download
46.97 KB lrw-r--r-- 2026-03-30 10:22:29
Edit Download
20.67 KB lrw-r--r-- 2026-03-30 10:22:29
Edit Download
26.70 KB lrw-r--r-- 2026-03-30 10:22:29
Edit Download
2.50 KB lrw-r--r-- 2026-03-30 10:22:29
Edit Download
4.57 KB lrw-r--r-- 2026-03-30 10:22:29
Edit Download
28.01 KB lrw-r--r-- 2026-03-30 10:22:29
Edit Download
13.03 KB lrw-r--r-- 2026-03-30 10:22:29
Edit Download
7.43 KB lrw-r--r-- 2026-03-30 10:22:29
Edit Download
4.71 KB lrw-r--r-- 2026-03-30 10:22:29
Edit Download
8.45 KB lrw-r--r-- 2026-03-30 10:22:30
Edit Download
13.07 KB lrw-r--r-- 2026-03-30 10:22:30
Edit Download
11.52 KB lrw-r--r-- 2026-03-30 10:22:30
Edit Download
19.55 KB lrw-r--r-- 2026-03-30 10:22:30
Edit Download
9.99 KB lrw-r--r-- 2026-03-30 10:22:30
Edit Download
24.37 KB lrw-r--r-- 2026-03-30 10:22:30
Edit Download
9.10 KB lrw-r--r-- 2026-03-30 10:22:30
Edit Download
2.19 KB lrw-r--r-- 2026-03-30 10:22:30
Edit Download
36.49 KB lrw-r--r-- 2026-03-30 10:22:30
Edit Download
9.85 KB lrw-r--r-- 2026-03-30 10:22:30
Edit Download
10.13 KB lrw-r--r-- 2026-03-30 10:22:30
Edit Download
39.49 KB lrw-r--r-- 2026-03-30 10:22:30
Edit Download
86.93 KB lrw-r--r-- 2026-03-30 10:22:30
Edit Download
14.46 KB lrw-r--r-- 2026-03-30 10:22:30
Edit Download
17.72 KB lrw-r--r-- 2026-03-30 10:22:30
Edit Download
3.75 KB lrw-r--r-- 2026-03-30 10:22:30
Edit Download
11.06 KB lrw-r--r-- 2026-03-30 10:22:30
Edit Download
14.56 KB lrw-r--r-- 2026-03-30 10:22:30
Edit Download
13.60 KB lrw-r--r-- 2026-03-30 10:22:30
Edit Download
18.92 KB lrw-r--r-- 2026-03-30 10:22:31
Edit Download
13.71 KB lrw-r--r-- 2026-03-30 10:22:31
Edit Download
535 B lrw-r--r-- 2026-03-30 10:22:31
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).