403Webshell
Server IP : 172.67.158.161  /  Your IP : 3.140.196.48
Web Server : LiteSpeed
System : Linux business53.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64
User : giankuin ( 1871)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/giankuin/khowordpress.com/wp-content/plugins/woocommerce/src/Internal/Admin/BlockTemplates/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/giankuin/khowordpress.com/wp-content/plugins/woocommerce/src/Internal/Admin/BlockTemplates/BlockFormattedTemplateTrait.php
<?php

namespace Automattic\WooCommerce\Internal\Admin\BlockTemplates;

/**
 * Trait for block formatted template.
 */
trait BlockFormattedTemplateTrait {
	/**
	 * Get the block configuration as a formatted template.
	 *
	 * @return array The block configuration as a formatted template.
	 */
	public function get_formatted_template(): array {
		$arr = array(
			$this->get_name(),
			array_merge(
				$this->get_attributes(),
				array(
					'_templateBlockId'    => $this->get_id(),
					'_templateBlockOrder' => $this->get_order(),
				),
				! empty( $this->get_hide_conditions() ) ? array(
					'_templateBlockHideConditions' => $this->get_formatted_hide_conditions(),
				) : array(),
				! empty( $this->get_disable_conditions() ) ? array(
					'_templateBlockDisableConditions' => $this->get_formatted_disable_conditions(),
				) : array(),
			),
		);

		return $arr;
	}

	/**
	 * Get the block hide conditions formatted for inclusion in a formatted template.
	 */
	private function get_formatted_hide_conditions(): array {
		return $this->format_conditions( $this->get_hide_conditions() );
	}

	/**
	 * Get the block disable conditions formatted for inclusion in a formatted template.
	 */
	private function get_formatted_disable_conditions(): array {
		return $this->format_conditions( $this->get_disable_conditions() );
	}

	/**
	 * Formats conditions in the expected format to include in the template.
	 *
	 * @param array $conditions The conditions to format.
	 */
	private function format_conditions( $conditions ): array {
		$formatted_expressions = array_map(
			function( $condition ) {
				return array(
					'expression' => $condition['expression'],
				);
			},
			array_values( $conditions )
		);

		return $formatted_expressions;
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit