403Webshell
Server IP : 104.26.3.156  /  Your IP : 216.73.216.185
Web Server : nginx/1.27.1
System : Linux us-1 5.15.0-131-generic #141-Ubuntu SMP Fri Jan 10 21:18:28 UTC 2025 x86_64
User : vinodai ( 3134)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system,proc_open,popen,parse_ini_file,show_source
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /storage/v1396/woofsite3/public_html/wp-content/themes/flatsome/inc/woocommerce/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /storage/v1396/woofsite3/public_html/wp-content/themes/flatsome/inc/woocommerce/class-brands.php
<?php
/**
 * Brands class.
 *
 * @package Flatsome\WooCommerce
 */

namespace Flatsome\WooCommerce;

defined( 'ABSPATH' ) || exit;

/**
 * Class Brands
 *
 * @package Flatsome\WooCommerce
 */
final class Brands {

	/**
	 * The single instance of the class.
	 *
	 * @var Brands
	 */
	protected static $instance = null;

	/**
	 * Constructor.
	 */
	private function __construct() {
		if ( ! empty( $GLOBALS['WC_Brands'] ) ) {
			// Remove the default brand meta from the single product meta.
			remove_action( 'woocommerce_product_meta_end', [ $GLOBALS['WC_Brands'], 'show_brand' ] );
			add_action( 'woocommerce_product_meta_end', [ $this, 'render_brand_meta' ], 50 );
		}
	}

	/**
	 * Render the brand meta list.
	 *
	 * Unwrapped is_singular( 'product' ) check from WC_Brands show_brand().
	 *
	 * @see WC_Brands show_brand()
	 */
	public function render_brand_meta() {
		global $post;

		$terms       = get_the_terms( $post->ID, 'product_brand' );
		$brand_count = is_array( $terms ) ? count( $terms ) : 0;
		$taxonomy    = get_taxonomy( 'product_brand' );

		if (
			empty( $terms )
			|| ! is_array( $terms )
			|| is_wp_error( $terms )
			|| ! $taxonomy instanceof \WP_Taxonomy
			|| ! function_exists( 'wc_get_brands' )
		) {
			return;
		}

		$labels = $taxonomy->labels;

		/* translators: %s - Label name */
		$brand_output = wc_get_brands( $post->ID, ', ', ' <span class="posted_in">' . sprintf( _n( '%s: ', '%s: ', $brand_count, 'woocommerce' ), $labels->singular_name, $labels->name ), '</span>' );

		/**
		 * Filter the brand output in product meta.
		 *
		 * @since 9.8.0
		 *
		 * @param string $brand_output The HTML output for brands.
		 * @param array  $terms        Array of brand term objects.
		 * @param int    $post_id      The product ID.
		 */
		echo apply_filters( 'woocommerce_product_brands_output', $brand_output, $terms, $post->ID ); // phpcs:ignore WordPress.Security.EscapeOutput
	}

	/**
	 * Get the instance of the class.
	 *
	 * @return Brands
	 */
	public static function get_instance() {
		if ( is_null( self::$instance ) ) {
			self::$instance = new self();
		}

		return self::$instance;
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit