403Webshell
Server IP : 119.195.102.159  /  Your IP : 216.73.217.134
Web Server : nginx/1.18.0
System : Linux picell 5.15.0-181-generic #191-Ubuntu SMP Fri May 22 19:09:02 UTC 2026 x86_64
User : altablue ( 1000)
PHP Version : 8.3.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /proc/1960348/cwd/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /proc/1960348/cwd/DownloadableProductTrait.php
<?php
/**
 * DownloadableProductTrait
 */

namespace Automattic\WooCommerce\Internal\Features\ProductBlockEditor\ProductTemplates;

use Automattic\WooCommerce\Admin\Features\Features;
use Automattic\WooCommerce\Admin\Features\ProductBlockEditor\ProductTemplates\GroupInterface;

/**
 * Downloadable Product Trait.
 */
trait DownloadableProductTrait {
	/**
	 * Adds downloadable blocks to the given parent block.
	 *
	 * @param GroupInterface $parent_block The parent block.
	 */
	private function add_downloadable_product_blocks( $parent_block ) {
		// Downloads section.
		$product_downloads_section_group = $parent_block->add_section(
			array(
				'id'             => 'product-downloads-section-group',
				'order'          => 50,
				'attributes'     => array(
					'blockGap' => 'unit-40',
				),
				'hideConditions' => array(
					array(
						'expression' => 'postType === "product" && editedProduct.type !== "simple"',
					),
				),
			)
		);

		$product_downloads_section_group->add_block(
			array(
				'id'         => 'product-downloadable',
				'blockName'  => 'woocommerce/product-toggle-field',
				'order'      => 10,
				'attributes' => array(
					'property'      => 'downloadable',
					'label'         => __( 'Include downloads', 'woocommerce' ),
					'checkedHelp'   => __( 'Add any files you\'d like to make available for the customer to download after purchasing, such as instructions or warranty info.', 'woocommerce' ),
					'uncheckedHelp' => __( 'Add any files you\'d like to make available for the customer to download after purchasing, such as instructions or warranty info.', 'woocommerce' ),
				),
			)
		);

		$product_downloads_section_group->add_subsection(
			array(
				'id'             => 'product-downloads-section',
				'order'          => 20,
				'attributes'     => array(
					'title'       => __( 'Downloads', 'woocommerce' ),
					'description' => sprintf(
						/* translators: %1$s: Downloads settings link opening tag. %2$s: Downloads settings link closing tag. */
						__( 'Add any files you\'d like to make available for the customer to download after purchasing, such as instructions or warranty info. Store-wide updates can be managed in your %1$sproduct settings%2$s.', 'woocommerce' ),
						'<a href="' . admin_url( 'admin.php?page=wc-settings&tab=products&section=downloadable' ) . '" target="_blank" rel="noreferrer">',
						'</a>'
					),
				),
				'hideConditions' => array(
					array(
						'expression' => 'editedProduct.downloadable !== true',
					),
				),
			)
		)->add_block(
			array(
				'id'        => 'product-downloads',
				'blockName' => 'woocommerce/product-downloads-field',
				'order'     => 10,
			)
		);
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit