GRAYBYTE WORDPRESS FILE MANAGER9950

Server IP : 162.213.255.40 / Your IP : 216.73.216.149
System : Linux server146.web-hosting.com 4.18.0-513.18.1.lve.el8.x86_64 #1 SMP Thu Feb 22 12:55:50 UTC 2024 x86_64
PHP Version : 8.0.30
Disable Function : NONE
cURL : ON | WGET : ON | Sudo : OFF | Pkexec : OFF

HOME

/home/hellrfbn/public_html/wp-content/updraft/plugins-old/woocommerce/src/Admin/API/
Upload Files :
Current_dir [ Writeable ] Document_root [ Writeable ]

Command :


Current File : /home/hellrfbn/public_html/wp-content/updraft/plugins-old/woocommerce/src/Admin/API//Init.php
<?php
/**
 * REST API bootstrap.
 */

namespace Automattic\WooCommerce\Admin\API;

use AllowDynamicProperties;
use Automattic\WooCommerce\Admin\Features\Features;

defined( 'ABSPATH' ) || exit;

use Automattic\WooCommerce\Internal\Admin\Loader;

/**
 * Init class.
 *
 * @internal
 */
#[AllowDynamicProperties]
class Init {
	/**
	 * The single instance of the class.
	 *
	 * @var object
	 */
	protected static $instance = null;

	/**
	 * Get class instance.
	 *
	 * @return object Instance.
	 */
	final public static function instance() {
		if ( null === static::$instance ) {
			static::$instance = new static();
		}
		return static::$instance;
	}

	/**
	 * Bootstrap REST API.
	 */
	public function __construct() {
		// Hook in data stores.
		add_filter( 'woocommerce_data_stores', array( __CLASS__, 'add_data_stores' ) );
		// REST API extensions init.
		add_action( 'rest_api_init', array( $this, 'rest_api_init' ) );

		// Add currency symbol to orders endpoint response.
		add_filter( 'woocommerce_rest_prepare_shop_order_object', array( __CLASS__, 'add_currency_symbol_to_order_response' ) );

		include_once WC_ABSPATH . 'includes/admin/class-wc-admin-upload-downloadable-product.php';
	}

	/**
	 * Init REST API.
	 */
	public function rest_api_init() {
		$controllers = array(
			'Automattic\WooCommerce\Admin\API\Features',
			'Automattic\WooCommerce\Admin\API\Notes',
			'Automattic\WooCommerce\Admin\API\NoteActions',
			'Automattic\WooCommerce\Admin\API\Coupons',
			'Automattic\WooCommerce\Admin\API\Data',
			'Automattic\WooCommerce\Admin\API\DataCountries',
			'Automattic\WooCommerce\Admin\API\DataDownloadIPs',
			'Automattic\WooCommerce\Admin\API\Experiments',
			'Automattic\WooCommerce\Admin\API\Marketing',
			'Automattic\WooCommerce\Admin\API\MarketingOverview',
			'Automattic\WooCommerce\Admin\API\MarketingRecommendations',
			'Automattic\WooCommerce\Admin\API\MarketingChannels',
			'Automattic\WooCommerce\Admin\API\MarketingCampaigns',
			'Automattic\WooCommerce\Admin\API\MarketingCampaignTypes',
			'Automattic\WooCommerce\Admin\API\Notice',
			'Automattic\WooCommerce\Admin\API\Options',
			'Automattic\WooCommerce\Admin\API\Orders',
			'Automattic\WooCommerce\Admin\API\PaymentGatewaySuggestions',
			'Automattic\WooCommerce\Admin\API\Products',
			'Automattic\WooCommerce\Admin\API\ProductAttributes',
			'Automattic\WooCommerce\Admin\API\ProductAttributeTerms',
			'Automattic\WooCommerce\Admin\API\ProductCategories',
			'Automattic\WooCommerce\Admin\API\ProductVariations',
			'Automattic\WooCommerce\Admin\API\ProductReviews',
			'Automattic\WooCommerce\Admin\API\ProductVariations',
			'Automattic\WooCommerce\Admin\API\ProductsLowInStock',
			'Automattic\WooCommerce\Admin\API\SettingOptions',
			'Automattic\WooCommerce\Admin\API\Themes',
			'Automattic\WooCommerce\Admin\API\Plugins',
			'Automattic\WooCommerce\Admin\API\OnboardingFreeExtensions',
			'Automattic\WooCommerce\Admin\API\OnboardingProductTypes',
			'Automattic\WooCommerce\Admin\API\OnboardingProfile',
			'Automattic\WooCommerce\Admin\API\OnboardingTasks',
			'Automattic\WooCommerce\Admin\API\OnboardingThemes',
			'Automattic\WooCommerce\Admin\API\OnboardingPlugins',
			'Automattic\WooCommerce\Admin\API\OnboardingProducts',
			'Automattic\WooCommerce\Admin\API\NavigationFavorites',
			'Automattic\WooCommerce\Admin\API\Taxes',
			'Automattic\WooCommerce\Admin\API\MobileAppMagicLink',
			'Automattic\WooCommerce\Admin\API\ShippingPartnerSuggestions',
		);

		$product_form_controllers = array();
		if ( Features::is_enabled( 'new-product-management-experience' ) ) {
			$product_form_controllers[] = 'Automattic\WooCommerce\Admin\API\ProductForm';
		}

		if ( Features::is_enabled( 'launch-your-store' ) ) {
			$controllers[] = 'Automattic\WooCommerce\Admin\API\LaunchYourStore';
		}

		if ( Features::is_enabled( 'analytics' ) ) {
			$analytics_controllers = array(
				'Automattic\WooCommerce\Admin\API\Customers',
				'Automattic\WooCommerce\Admin\API\Leaderboards',
				'Automattic\WooCommerce\Admin\API\Reports\Controller',
				'Automattic\WooCommerce\Admin\API\Reports\Import\Controller',
				'Automattic\WooCommerce\Admin\API\Reports\Export\Controller',
				'Automattic\WooCommerce\Admin\API\Reports\Products\Controller',
				'Automattic\WooCommerce\Admin\API\Reports\Variations\Controller',
				'Automattic\WooCommerce\Admin\API\Reports\Products\Stats\Controller',
				'Automattic\WooCommerce\Admin\API\Reports\Variations\Stats\Controller',
				'Automattic\WooCommerce\Admin\API\Reports\Revenue\Stats\Controller',
				'Automattic\WooCommerce\Admin\API\Reports\Orders\Controller',
				'Automattic\WooCommerce\Admin\API\Reports\Orders\Stats\Controller',
				'Automattic\WooCommerce\Admin\API\Reports\Categories\Controller',
				'Automattic\WooCommerce\Admin\API\Reports\Taxes\Controller',
				'Automattic\WooCommerce\Admin\API\Reports\Taxes\Stats\Controller',
				'Automattic\WooCommerce\Admin\API\Reports\Coupons\Controller',
				'Automattic\WooCommerce\Admin\API\Reports\Coupons\Stats\Controller',
				'Automattic\WooCommerce\Admin\API\Reports\Stock\Controller',
				'Automattic\WooCommerce\Admin\API\Reports\Stock\Stats\Controller',
				'Automattic\WooCommerce\Admin\API\Reports\Downloads\Controller',
				'Automattic\WooCommerce\Admin\API\Reports\Downloads\Stats\Controller',
				'Automattic\WooCommerce\Admin\API\Reports\Customers\Controller',
				'Automattic\WooCommerce\Admin\API\Reports\Customers\Stats\Controller',
			);

			// The performance indicators controller must be registered last, after other /stats endpoints have been registered.
			$analytics_controllers[] = 'Automattic\WooCommerce\Admin\API\Reports\PerformanceIndicators\Controller';
			$controllers             = array_merge( $controllers, $analytics_controllers, $product_form_controllers );
		}

		/**
		 * Filter for the WooCommerce Admin REST controllers.
		 *
		 * @since 3.5.0
		 * @param array $controllers List of rest API controllers.
		 */
		$controllers = apply_filters( 'woocommerce_admin_rest_controllers', $controllers );

		foreach ( $controllers as $controller ) {
			$this->$controller = new $controller();
			$this->$controller->register_routes();
		}
	}

	/**
	 * Adds data stores.
	 *
	 * @internal
	 * @param array $data_stores List of data stores.
	 * @return array
	 */
	public static function add_data_stores( $data_stores ) {
		return array_merge(
			$data_stores,
			array(
				'report-revenue-stats'    => 'Automattic\WooCommerce\Admin\API\Reports\Orders\Stats\DataStore',
				'report-orders'           => 'Automattic\WooCommerce\Admin\API\Reports\Orders\DataStore',
				'report-orders-stats'     => 'Automattic\WooCommerce\Admin\API\Reports\Orders\Stats\DataStore',
				'report-products'         => 'Automattic\WooCommerce\Admin\API\Reports\Products\DataStore',
				'report-variations'       => 'Automattic\WooCommerce\Admin\API\Reports\Variations\DataStore',
				'report-products-stats'   => 'Automattic\WooCommerce\Admin\API\Reports\Products\Stats\DataStore',
				'report-variations-stats' => 'Automattic\WooCommerce\Admin\API\Reports\Variations\Stats\DataStore',
				'report-categories'       => 'Automattic\WooCommerce\Admin\API\Reports\Categories\DataStore',
				'report-taxes'            => 'Automattic\WooCommerce\Admin\API\Reports\Taxes\DataStore',
				'report-taxes-stats'      => 'Automattic\WooCommerce\Admin\API\Reports\Taxes\Stats\DataStore',
				'report-coupons'          => 'Automattic\WooCommerce\Admin\API\Reports\Coupons\DataStore',
				'report-coupons-stats'    => 'Automattic\WooCommerce\Admin\API\Reports\Coupons\Stats\DataStore',
				'report-downloads'        => 'Automattic\WooCommerce\Admin\API\Reports\Downloads\DataStore',
				'report-downloads-stats'  => 'Automattic\WooCommerce\Admin\API\Reports\Downloads\Stats\DataStore',
				'admin-note'              => 'Automattic\WooCommerce\Admin\Notes\DataStore',
				'report-customers'        => 'Automattic\WooCommerce\Admin\API\Reports\Customers\DataStore',
				'report-customers-stats'  => 'Automattic\WooCommerce\Admin\API\Reports\Customers\Stats\DataStore',
				'report-stock-stats'      => 'Automattic\WooCommerce\Admin\API\Reports\Stock\Stats\DataStore',
			)
		);
	}

	/**
	 * Add the currency symbol (in addition to currency code) to each Order
	 * object in REST API responses. For use in formatAmount().
	 *
	 * @internal
	 * @param WP_REST_Response $response REST response object.
	 * @returns WP_REST_Response
	 */
	public static function add_currency_symbol_to_order_response( $response ) {
		$response_data                    = $response->get_data();
		$currency_code                    = $response_data['currency'];
		$currency_symbol                  = get_woocommerce_currency_symbol( $currency_code );
		$response_data['currency_symbol'] = html_entity_decode( $currency_symbol );
		$response->set_data( $response_data );

		return $response;
	}
}

[ Back ]
Name
Size
Last Modified
Owner / Group
Permissions
Options
..
--
July 23 2025 07:38:28
hellrfbn / hellrfbn
0755
Reports
--
July 23 2025 07:38:28
hellrfbn / hellrfbn
0755
Templates
--
July 23 2025 07:38:28
hellrfbn / hellrfbn
0755
.htaccess
0.41 KB
July 23 2025 07:38:28
hellrfbn / hellrfbn
0644
Coupons.php
2.15 KB
June 25 2024 18:19:14
hellrfbn / hellrfbn
0644
CustomAttributeTraits.php
3.402 KB
June 25 2024 18:19:14
hellrfbn / hellrfbn
0644
Customers.php
2.112 KB
June 25 2024 18:19:14
hellrfbn / hellrfbn
0644
Data.php
0.917 KB
June 25 2024 18:19:14
hellrfbn / hellrfbn
0644
DataCountries.php
1.122 KB
June 25 2024 18:19:14
hellrfbn / hellrfbn
0644
DataDownloadIPs.php
4.148 KB
June 25 2024 18:19:14
hellrfbn / hellrfbn
0644
Experiments.php
1.82 KB
June 25 2024 18:19:14
hellrfbn / hellrfbn
0644
Features.php
1.699 KB
June 25 2024 18:19:14
hellrfbn / hellrfbn
0644
Init.php
8.65 KB
June 25 2024 18:19:14
hellrfbn / hellrfbn
0644
LaunchYourStore.php
2.948 KB
June 25 2024 18:19:14
hellrfbn / hellrfbn
0644
Leaderboards.php
17.702 KB
June 25 2024 18:19:14
hellrfbn / hellrfbn
0644
Marketing.php
4.082 KB
June 25 2024 18:19:14
hellrfbn / hellrfbn
0644
MarketingCampaignTypes.php
6.016 KB
June 25 2024 18:19:14
hellrfbn / hellrfbn
0644
MarketingCampaigns.php
9.637 KB
June 25 2024 18:19:14
hellrfbn / hellrfbn
0644
MarketingChannels.php
5.74 KB
June 25 2024 18:19:14
hellrfbn / hellrfbn
0644
MarketingOverview.php
3.362 KB
June 25 2024 18:19:14
hellrfbn / hellrfbn
0644
MarketingRecommendations.php
5.942 KB
June 25 2024 18:19:14
hellrfbn / hellrfbn
0644
MobileAppMagicLink.php
2.097 KB
June 25 2024 18:19:14
hellrfbn / hellrfbn
0644
NavigationFavorites.php
4.825 KB
June 25 2024 18:19:14
hellrfbn / hellrfbn
0644
NoteActions.php
2.392 KB
June 25 2024 18:19:14
hellrfbn / hellrfbn
0644
Notes.php
25.788 KB
June 25 2024 18:19:14
hellrfbn / hellrfbn
0644
Notice.php
2.065 KB
June 25 2024 18:19:14
hellrfbn / hellrfbn
0644
OnboardingFreeExtensions.php
3.753 KB
June 25 2024 18:19:14
hellrfbn / hellrfbn
0644
OnboardingPlugins.php
11.267 KB
June 25 2024 18:19:14
hellrfbn / hellrfbn
0644
OnboardingProductTypes.php
1.797 KB
June 25 2024 18:19:14
hellrfbn / hellrfbn
0644
OnboardingProducts.php
1.937 KB
June 25 2024 18:19:14
hellrfbn / hellrfbn
0644
OnboardingProfile.php
16.311 KB
June 25 2024 18:19:14
hellrfbn / hellrfbn
0644
OnboardingTasks.php
31.971 KB
June 25 2024 18:19:14
hellrfbn / hellrfbn
0644
OnboardingThemes.php
17.54 KB
June 25 2024 18:19:14
hellrfbn / hellrfbn
0644
Options.php
9.652 KB
June 25 2024 18:19:14
hellrfbn / hellrfbn
0644
Orders.php
10.172 KB
June 25 2024 18:19:14
hellrfbn / hellrfbn
0644
PaymentGatewaySuggestions.php
5.444 KB
June 25 2024 18:19:14
hellrfbn / hellrfbn
0644
Plugins.php
20.251 KB
June 25 2024 18:19:14
hellrfbn / hellrfbn
0644
ProductAttributeTerms.php
4.362 KB
June 25 2024 18:19:14
hellrfbn / hellrfbn
0644
ProductAttributes.php
4.461 KB
June 25 2024 18:19:14
hellrfbn / hellrfbn
0644
ProductCategories.php
0.447 KB
June 25 2024 18:19:14
hellrfbn / hellrfbn
0644
ProductForm.php
3.063 KB
June 25 2024 18:19:14
hellrfbn / hellrfbn
0644
ProductReviews.php
1.299 KB
June 25 2024 18:19:14
hellrfbn / hellrfbn
0644
ProductVariations.php
5.966 KB
June 25 2024 18:19:14
hellrfbn / hellrfbn
0644
Products.php
9.7 KB
June 25 2024 18:19:14
hellrfbn / hellrfbn
0644
ProductsLowInStock.php
13.927 KB
June 25 2024 18:19:14
hellrfbn / hellrfbn
0644
SettingOptions.php
0.857 KB
June 25 2024 18:19:14
hellrfbn / hellrfbn
0644
ShippingPartnerSuggestions.php
5.738 KB
June 25 2024 18:19:14
hellrfbn / hellrfbn
0644
Taxes.php
4.902 KB
June 25 2024 18:19:14
hellrfbn / hellrfbn
0644
Themes.php
6.116 KB
June 25 2024 18:19:14
hellrfbn / hellrfbn
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025
CONTACT ME
Static GIF