HEX
Server: LiteSpeed
System: Linux l24.yourwebhosting.net 5.14.0-611.54.3.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Thu May 7 16:31:24 EDT 2026 x86_64
User: turkishi (1582)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: //proc/self/cwd/wp-content/plugins/learnpress/inc/ExternalPlugin/Elementor/LPDynamicElementor.php
<?php
/**
 * Class LPDynamicElementor
 * Declare base properties for dynamic course elementor
 *
 * @since 4.2.3.5
 * @version 1.0.0
 */
namespace LearnPress\ExternalPlugin\Elementor;

use Elementor\Modules\DynamicTags\Module;
use LearnPress\Models\CourseModel;
use LP_Course;

defined( 'ABSPATH' ) || exit;

trait LPDynamicElementor {
	public $lp_dynamic_name       = '';
	public $lp_dynamic_categories = [ Module::TEXT_CATEGORY ];
	public $lp_dynamic_title      = '';
	public $lp_dynamic_group      = LPElementor::GROUP_DYNAMIC;

	public function get_name() {
		return $this->lp_dynamic_name;
	}

	public function get_categories() {
		return $this->lp_dynamic_categories;
	}

	public function get_group() {
		return $this->lp_dynamic_group;
	}

	public function get_title() {
		return $this->lp_dynamic_title;
	}

	/**
	 * Get course
	 *
	 * @return bool|LP_Course|mixed
	 * @deprecated 4.2.7.3
	 */
	public function get_course() {
		$id = get_the_ID();
		if ( ! $id ) {
			return false;
		}

		return learn_press_get_course( $id );
	}

	/**
	 * Get course
	 *
	 * @return false|CourseModel
	 * @since 4.2.7.3
	 * @version 1.0.0
	 */
	public function get_course_model() {
		$id = get_the_ID();
		if ( ! $id ) {
			return false;
		}

		return CourseModel::find( $id, true );
	}
}