HEX
Server: Apache/2.4.41
System: Linux mainweb 5.4.0-182-generic #202-Ubuntu SMP Fri Apr 26 12:29:36 UTC 2024 x86_64
User: nationalmedicaregrp (1119)
PHP: 8.3.7
Disabled: exec,passthru,shell_exec,system,popen,proc_open,pcntl_exec
Upload Files
File: /home/commandofl/public_html/wp-content/themes/hestia/inc/compatibility/class-hestia-patterns.php
<?php
/**
 * Patterns Compatibility.
 *
 * @package hestia
 */

/**
 * Class Patterns
 *
 * @package hestia
 */
class Hestia_Patterns {
	/**
	 * Define list of the patterns to load.
	 *
	 * @var string[] Patterns list.
	 */
	private $patterns = array(
		'call-to-action',
		'content-1',
		'features-1',
		'features-2',
		'features-3',
		'hero-1',
		'hero-2',
		'pricing-1',
		'pricing-2',
		'stats',
		'team-1',
		'team-2',
		'testimonials-1',
		'testimonials-2',
	);

	/**
	 * Load patterns.
	 */
	public function define_patterns() {
		if ( ! function_exists( 'register_block_pattern' ) ) {
			return;
		}

		if ( ! function_exists( 'register_block_pattern_category' ) ) {
			return;
		}

		register_block_pattern_category(
			'hestia',
			array( 'label' => esc_html( $this->get_theme_name() ) )
		);

		foreach ( $this->patterns as $pattern ) {
			register_block_pattern(
				'hestia/' . $pattern,
				require __DIR__ . '/block-patterns/' . $pattern . '.php'
			);
		}
	}

	/**
	 * Get theme name.
	 *
	 * @return string
	 */
	private function get_theme_name() {
		$theme = wp_get_theme();

		return apply_filters( 'ti_wl_theme_name', $theme->get( 'Name' ) );
	}
}