HEX
Server: Apache
System: Linux webm020.cluster127.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64
User: bohousj (181416)
PHP: 8.4.22
Disabled: _dyuweyrj4,_dyuweyrj4r,dl
Upload Files
File: /home/bohousj/www/wp-content/plugins/happy-elementor-addons-pro/classes/loop-template.php
<?php
namespace Happy_Addons_Pro;

if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly.
}

/**
 * Elementor template library local source.
 *
 * Elementor template library local source handler class is responsible for
 * handling local Elementor templates saved by the user locally on his site.
 *
 * @since 1.0.0
 */
class Loop_Template {

	private static $instance = null;

	public function init() {
		add_filter('happyaddons/theme-builder/template-types', [ $this, 'loop_template_add'], 10, 1);
		add_action( 'wp_head', [ $this, 'loop_template_editor_width' ] );
	}

	public function loop_template_add($template_types) {
		$template_types['loop-template'] = esc_html__('Loop Template', 'happy-addons-pro');
		return $template_types;
	}

	public function loop_template_editor_width() {
		if( 'loop-template' == get_post_meta(get_the_ID(), '_ha_library_type', true) ) {
			echo '<style>
				.ha_library-template.ha_library-template-elementor_canvas {
					display: flex;
					justify-content: center;
					align-items: center;
					min-height: 100vh;
				}
				.elementor.elementor-edit-area.elementor-edit-mode {
					width: 500px;
				}
				.elementor.elementor-edit-area.elementor-edit-mode .elementor-section-wrap:has(.elementor-element) + #elementor-add-new-section {
					display: none;
				}
				.elementor.elementor-edit-area.elementor-edit-mode .elementor-section-wrap:has(.elementor-element) {
					padding-bottom: 100px;
				}
			</style>';
		}
	}

	public static function instance() {
		if ( null === self::$instance ) {
			self::$instance = new self();
			// self::$instance->init();
		}

		return self::$instance;
	}
}

Loop_Template::instance()->init();