# easy-elements/1.2.9/widgets/post-content/post-content.php

Easy Elements for Elementor – Addons &amp; Website Templates, version 1.2.9. 588 lines.

- Page: https://pluginprobe.com/plugins/easy-elements/1.2.9/code/widgets/post-content/post-content.php
- Raw: https://pluginprobe.com/plugins/easy-elements/1.2.9/raw/widgets/post-content/post-content.php
- Modified: 2026-01-06T13:07:24+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/easy-elements/1.2.9/code/widgets/post-content/post-content.php#L10-L20`.

```php
<?php
namespace Easyel\EasyElements\Widgets;
use Elementor\Controls_Manager;
use Elementor\Widget_Base;

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

class Easyel_Free_Post_content_Widget extends \Elementor\Widget_Base {

	public function get_name() {
		return 'eel-post-content';
	}

	public function get_title() {
		return __( 'Post Content', 'easy-elements' );
	}

	public function get_icon() {
		return 'easyicon easyelIcon-post-content';
	}

	public function get_categories() {
		return [ 'easyelements_category' ];
	}

	public function get_keywords() {
        return [ 'post', 'content', 'link', 'click', 'text' ];
    }

	public function get_style_depends() {
        return [
            'eel-post-content',
        ];
    }


	protected function register_controls() {

	    $this->start_controls_section(
	        'content_section',
	        [
	            'label' => esc_html__('Content Style', 'easy-elements'),
	            'tab' => Controls_Manager::TAB_CONTENT,
	        ]
	    );
		
		$this->add_control(
			'content_color',
			[
				'label' => esc_html__('Color', 'easy-elements'),
				'type' => Controls_Manager::COLOR,
				'selectors' => [
					'{{WRAPPER}} .eel-post-content' => 'color: {{VALUE}};',
				],
			]
		);

		$this->add_group_control(
			\Elementor\Group_Control_Typography::get_type(),
			[
				'name' => 'content_typography',
				'selector' => '{{WRAPPER}} .eel-post-content',
			]
		);

		$this->add_control(
			'global_heading',
			[
				'label' => esc_html__( 'Global Heading', 'easy-elements' ),
				'type' => \Elementor\Controls_Manager::HEADING,	
				'separator' => 'after',				
			]
		);	

		$this->add_control(
			'global_color',
			[
				'label' => esc_html__('Color', 'easy-elements'),
				'type' => Controls_Manager::COLOR,
				'selectors' => [
					'{{WRAPPER}} .eel-post-content h1, {{WRAPPER}} .eel-post-content h2, {{WRAPPER}} .eel-post-content h3, {{WRAPPER}} .eel-post-content h4, {{WRAPPER}} .eel-post-content h5, {{WRAPPER}} .eel-post-content h6' => 'color: {{VALUE}};',
				],				
			]
		);

		$this->add_group_control(
			\Elementor\Group_Control_Typography::get_type(),
			[
				'name' => 'global_typography',
				'selector' => '{{WRAPPER}} .eel-post-content h1, {{WRAPPER}} .eel-post-content h2, {{WRAPPER}} .eel-post-content h3, {{WRAPPER}} .eel-post-content h4, {{WRAPPER}} .eel-post-content h5, {{WRAPPER}} .eel-post-content h6',
			]
		);

		$this->add_responsive_control(
            'global_margin',
            [
                'label'      => __( 'Margin', 'easy-elements' ),
                'type'       => \Elementor\Controls_Manager::DIMENSIONS,
                'size_units' => [ 'px', 'em', '%' ],
                'selectors'  => [
                    '{{WRAPPER}} .eel-post-content h1, {{WRAPPER}} .eel-post-content h2, {{WRAPPER}} .eel-post-content h3, {{WRAPPER}} .eel-post-content h4, {{WRAPPER}} .eel-post-content h5, {{WRAPPER}} .eel-post-content h6' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                ],
            ]
        );

		$this->add_control(
			'strong_heading',
			[
				'label' => esc_html__( 'Strong Style', 'easy-elements' ),
				'type' => \Elementor\Controls_Manager::HEADING,	
				'separator' => 'after',				
			]
		);

		$this->add_control(
			'strong_color',
			[
				'label' => esc_html__('Color', 'easy-elements'),
				'type' => Controls_Manager::COLOR,
				'selectors' => [
					'{{WRAPPER}} .eel-post-content strong' => 'color: {{VALUE}};',
				],				
			]
		);

		$this->add_group_control(
			\Elementor\Group_Control_Typography::get_type(),
			[
				'name' => 'strong_typography',
				'selector' => '{{WRAPPER}} .eel-post-content strong',
			]
		);

		$this->add_control(
			'link_heading',
			[
				'label' => esc_html__( 'Link Style', 'easy-elements' ),
				'type' => \Elementor\Controls_Manager::HEADING,	
				'separator' => 'after',				
			]
		);

		$this->add_control(
			'link_color',
			[
				'label' => esc_html__('Color', 'easy-elements'),
				'type' => Controls_Manager::COLOR,
				'selectors' => [
					'{{WRAPPER}} .eel-post-content a' => 'color: {{VALUE}};',
				],				
			]
		);

		$this->add_group_control(
			\Elementor\Group_Control_Typography::get_type(),
			[
				'name' => 'link_typography',
				'selector' => '{{WRAPPER}} .eel-post-content a',
			]
		);
		
		$this->end_controls_section();

		$this->start_controls_section(
	        'content_section_heading',
	        [
	            'label' => esc_html__('Heading Style', 'easy-elements'),
	            'tab' => Controls_Manager::TAB_CONTENT,
	        ]
	    );

		$this->add_control(
			'h1_heading',
			[
				'label' => esc_html__( 'H1 Heading', 'easy-elements' ),
				'type' => \Elementor\Controls_Manager::HEADING,				
			]
		);
		
		$this->add_control(
			'h1_color',
			[
				'label' => esc_html__('Color', 'easy-elements'),
				'type' => Controls_Manager::COLOR,
				'selectors' => [
					'{{WRAPPER}} .eel-post-content h1' => 'color: {{VALUE}};',
				],
			]
		);

		$this->add_group_control(
			\Elementor\Group_Control_Typography::get_type(),
			[
				'name' => 'h1_typography',
				'selector' => '{{WRAPPER}} .eel-post-content h1',
			]
		);

		$this->add_responsive_control(
            'h1_margin',
            [
                'label'      => __( 'Margin', 'easy-elements' ),
                'type'       => \Elementor\Controls_Manager::DIMENSIONS,
                'size_units' => [ 'px', 'em', '%' ],
                'selectors'  => [
                    '{{WRAPPER}} .eel-post-content h1' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                ],
            ]
        );

		$this->add_control(
			'h2_heading',
			[
				'label' => esc_html__( 'H2 Heading', 'easy-elements' ),
				'type' => \Elementor\Controls_Manager::HEADING,				
			]
		);
		
		$this->add_control(
			'h2_color',
			[
				'label' => esc_html__('Color', 'easy-elements'),
				'type' => Controls_Manager::COLOR,
				'selectors' => [
					'{{WRAPPER}} .eel-post-content h2' => 'color: {{VALUE}};',
				],
			]
		);

		$this->add_group_control(
			\Elementor\Group_Control_Typography::get_type(),
			[
				'name' => 'h2_typography',
				'selector' => '{{WRAPPER}} .eel-post-content h2',
			]
		);

		$this->add_responsive_control(
            'h2_margin',
            [
                'label'      => __( 'Margin', 'easy-elements' ),
                'type'       => \Elementor\Controls_Manager::DIMENSIONS,
                'size_units' => [ 'px', 'em', '%' ],
                'selectors'  => [
                    '{{WRAPPER}} .eel-post-content h2' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                ],
            ]
        );
		
		$this->add_control(
			'h3_heading',
			[
				'label' => esc_html__( 'H3 Heading', 'easy-elements' ),
				'type' => \Elementor\Controls_Manager::HEADING,				
			]
		);

		$this->add_control(
			'h3_color',
			[
				'label' => esc_html__('Color', 'easy-elements'),
				'type' => Controls_Manager::COLOR,
				'selectors' => [
					'{{WRAPPER}} .eel-post-content h3' => 'color: {{VALUE}};',
				],
			]
		);

		$this->add_group_control(
			\Elementor\Group_Control_Typography::get_type(),
			[
				'name' => 'h3_typography',
				'selector' => '{{WRAPPER}} .eel-post-content h3',
			]
		);

		$this->add_responsive_control(
            'h3_margin',
            [
                'label'      => __( 'Margin', 'easy-elements' ),
                'type'       => \Elementor\Controls_Manager::DIMENSIONS,
                'size_units' => [ 'px', 'em', '%' ],
                'selectors'  => [
                    '{{WRAPPER}} .eel-post-content h3' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                ],
            ]
        );

		$this->add_control(
			'h4_heading',
			[
				'label' => esc_html__( 'H4 Heading', 'easy-elements' ),
				'type' => \Elementor\Controls_Manager::HEADING,				
			]
		);
		
		$this->add_control(
			'h4_color',
			[
				'label' => esc_html__('Color', 'easy-elements'),
				'type' => Controls_Manager::COLOR,
				'selectors' => [
					'{{WRAPPER}} .eel-post-content h4' => 'color: {{VALUE}};',
				],
			]
		);

		$this->add_group_control(
			\Elementor\Group_Control_Typography::get_type(),
			[
				'name' => 'h4_typography',
				'selector' => '{{WRAPPER}} .eel-post-content h4',
			]
		);

		$this->add_responsive_control(
            'h4_margin',
            [
                'label'      => __( 'Margin', 'easy-elements' ),
                'type'       => \Elementor\Controls_Manager::DIMENSIONS,
                'size_units' => [ 'px', 'em', '%' ],
                'selectors'  => [
                    '{{WRAPPER}} .eel-post-content h4' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                ],
            ]
        );

		$this->add_control(
			'h5_heading',
			[
				'label' => esc_html__( 'H5 Heading', 'easy-elements' ),
				'type' => \Elementor\Controls_Manager::HEADING,				
			]
		);

		$this->add_control(
			'h5_color',
			[
				'label' => esc_html__('Color', 'easy-elements'),
				'type' => Controls_Manager::COLOR,
				'selectors' => [
					'{{WRAPPER}} .eel-post-content h5' => 'color: {{VALUE}};',
				],
			]
		);

		$this->add_group_control(
			\Elementor\Group_Control_Typography::get_type(),
			[
				'name' => 'h5_typography',
				'selector' => '{{WRAPPER}} .eel-post-content h5',
			]
		);

		$this->add_responsive_control(
            'h5_margin',
            [
                'label'      => __( 'Margin', 'easy-elements' ),
                'type'       => \Elementor\Controls_Manager::DIMENSIONS,
                'size_units' => [ 'px', 'em', '%' ],
                'selectors'  => [
                    '{{WRAPPER}} .eel-post-content h5' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                ],
            ]
        );

		$this->add_control(
			'h6_heading',
			[
				'label' => esc_html__( 'H6 Heading', 'easy-elements' ),
				'type' => \Elementor\Controls_Manager::HEADING,	
				'separator' => 'after',				
			]
		);	

		$this->add_control(
			'h6_color',
			[
				'label' => esc_html__('Color', 'easy-elements'),
				'type' => Controls_Manager::COLOR,
				'selectors' => [
					'{{WRAPPER}} .eel-post-content h6' => 'color: {{VALUE}};',
				],				
			]
		);

		$this->add_group_control(
			\Elementor\Group_Control_Typography::get_type(),
			[
				'name' => 'h6_typography',
				'selector' => '{{WRAPPER}} .eel-post-content h6',
			]
		);

		$this->add_responsive_control(
            'h6_margin',
            [
                'label'      => __( 'Margin', 'easy-elements' ),
                'type'       => \Elementor\Controls_Manager::DIMENSIONS,
                'size_units' => [ 'px', 'em', '%' ],
                'selectors'  => [
                    '{{WRAPPER}} .eel-post-content h6' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                ],
            ]
        );
		
		$this->end_controls_section();

		$this->start_controls_section(
	        'ul_content_section',
	        [
	            'label' => esc_html__('Others Style', 'easy-elements'),
	            'tab' => Controls_Manager::TAB_CONTENT,
	        ]
	    );

		$this->add_control(
			'ul_heading',
			[
				'label' => esc_html__( 'UL Style', 'easy-elements' ),
				'type' => \Elementor\Controls_Manager::HEADING,	
				'separator' => 'after',				
			]
		);
		$this->add_control(
			'ul_color',
			[
				'label' => esc_html__('Color', 'easy-elements'),
				'type' => Controls_Manager::COLOR,
				'selectors' => [
					'{{WRAPPER}} .eel-post-content ul' => 'color: {{VALUE}};',
				],				
			]
		);

		$this->add_group_control(
			\Elementor\Group_Control_Typography::get_type(),
			[
				'name' => 'ul_typography',
				'selector' => '{{WRAPPER}} .eel-post-content ul',
			]
		);

		$this->add_responsive_control(
            'ul_margin',
            [
                'label'      => __( 'Margin', 'easy-elements' ),
                'type'       => \Elementor\Controls_Manager::DIMENSIONS,
                'size_units' => [ 'px', 'em', '%' ],
                'selectors'  => [
                    '{{WRAPPER}} .eel-post-content ul' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                ],
            ]
        );

		$this->add_responsive_control(
            'ul_padding',
            [
                'label'      => __( 'Padding', 'easy-elements' ),
                'type'       => \Elementor\Controls_Manager::DIMENSIONS,
                'size_units' => [ 'px', 'em', '%' ],
                'selectors'  => [
                    '{{WRAPPER}} .eel-post-content ul' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                ],
            ]
        );

		$this->add_control(
			'li_heading',
			[
				'label' => esc_html__( 'LI Style', 'easy-elements' ),
				'type' => \Elementor\Controls_Manager::HEADING,	
				'separator' => 'after',				
			]
		);

		$this->add_responsive_control(
            'li_margin',
            [
                'label'      => __( 'Margin', 'easy-elements' ),
                'type'       => \Elementor\Controls_Manager::DIMENSIONS,
                'size_units' => [ 'px', 'em', '%' ],
                'selectors'  => [
                    '{{WRAPPER}} .eel-post-content ul > li' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                ],
            ]
        );

		$this->add_responsive_control(
            'li_padding',
            [
                'label'      => __( 'Padding', 'easy-elements' ),
                'type'       => \Elementor\Controls_Manager::DIMENSIONS,
                'size_units' => [ 'px', 'em', '%' ],
                'selectors'  => [
                    '{{WRAPPER}} .eel-post-content ul > li' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                ],
            ]
        );

		$this->add_control(
			'p_heading',
			[
				'label' => esc_html__( 'Paragraph Style', 'easy-elements' ),
				'type' => \Elementor\Controls_Manager::HEADING,	
				'separator' => 'after',				
			]
		);

		$this->add_responsive_control(
            'p__margin',
            [
                'label'      => __( 'Margin', 'easy-elements' ),
                'type'       => \Elementor\Controls_Manager::DIMENSIONS,
                'size_units' => [ 'px', 'em', '%' ],
                'selectors'  => [
                    '{{WRAPPER}} .eel-post-content p' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                ],
            ]
        );

		$this->add_control(
			'p_img_heading',
			[
				'label' => esc_html__( 'Paragraph Image Style', 'easy-elements' ),
				'type' => \Elementor\Controls_Manager::HEADING,	
				'separator' => 'after',				
			]
		);

		$this->add_responsive_control(
            'p_image_margin',
            [
                'label'      => __( 'Margin', 'easy-elements' ),
                'type'       => \Elementor\Controls_Manager::DIMENSIONS,
                'size_units' => [ 'px', 'em', '%' ],
                'selectors'  => [
                    '{{WRAPPER}} .eel-post-content img' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                ],
            ]
        );

		$this->end_controls_section();

	}

	protected function render() {
		global $post;

		$is_editor = defined('ELEMENTOR_VERSION') && \Elementor\Plugin::$instance->editor->is_edit_mode();

		$post_id = function_exists('easyel_get_prepared_post_id') ? easyel_get_prepared_post_id() : get_the_ID();

		$post_obj = get_post($post_id);
		if ( ! $post_obj instanceof \WP_Post ) {
			echo $is_editor 
				? '<p>' . esc_html__('Post content will appear here on the frontend.', 'easy-elements') . '</p>'
				: '';
			return;
		}

		$original_post = $post;
		$post = $post_obj;
		setup_postdata($post);

		echo '<div class="eel-post-content">';
		if ($is_editor) {
			// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
			echo apply_filters('the_content', $post->post_content);
		} else {
			$content = \Elementor\Plugin::$instance->frontend->get_builder_content_for_display($post_id);
			if (empty($content)) {
				
				$content = apply_filters('the_content', $post->post_content);
			}
			// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
			echo $content;
		}
		echo '</div>';

		// Restore original $post
		wp_reset_postdata();
		$post = $original_post;
	}
}

```
