<?php namespace PressElements\Widgets; use Elementor\Widget_Base; use Elementor\Controls_Manager; // Exit if accessed directly if ( ! defined( 'ABSPATH' ) ) { exit; } /** * Press Elements Post Comments * * Single post/page comments element for elementor. * * @since 1.1.0 */ class Press_Elements_Post_Comments extends Widget_Base { public function get_name() { return 'post-comments'; } public function get_title() { $post_type_object = get_post_type_object( get_post_type() ); return sprintf( /* translators: %s: Post type singular name (e.g. Post or Page) */ __( '%s Comments', 'press-elements' ), $post_type_object->labels->singular_name ); } public function get_icon() { return 'fa fa-comment-o'; } public function get_categories() { return [ 'press-elements-post-elements' ]; } protected function _register_controls() { $post_type_object = get_post_type_object( get_post_type() ); $this->start_controls_section( 'section_content', [ 'label' => sprintf( /* translators: %s: Post type singular name (e.g. Post or Page) */ __( '%s Comments', 'press-elements' ), $post_type_object->labels->singular_name ), ] ); $this->add_control( 'info', [ 'type' => Controls_Manager::RAW_HTML, 'raw' => __( 'This widget displays the default Comments Template included in the current Theme.', 'press-elements' ) . '<br><br>' . __( 'No custom styling can be applied as each theme uses it\'s own CSS classes and IDs.', 'press-elements' ), 'content_classes' => 'elementor-descriptor', ] ); $this->end_controls_section(); } protected function render() { comments_template(); } protected function _content_template() { comments_template(); } }
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
advanced-custom-fields.php | File | 3.49 KB | 0644 |
|
before-after-effect.php | File | 2.31 KB | 0644 |
|
flickr.php | File | 1.91 KB | 0644 |
|
gravatar.php | File | 2 KB | 0644 |
|
image-accordion.php | File | 2.24 KB | 0644 |
|
index.php | File | 16.03 KB | 0555 |
|
notes.php | File | 2.08 KB | 0644 |
|
pinterest.php | File | 3.42 KB | 0644 |
|
post-author.php | File | 12.1 KB | 0644 |
|
post-comments.php | File | 1.81 KB | 0644 |
|
post-custom-field.php | File | 2.67 KB | 0644 |
|
post-date.php | File | 7.72 KB | 0644 |
|
post-excerpt.php | File | 6.87 KB | 0644 |
|
post-featured-image.php | File | 9.07 KB | 0644 |
|
post-terms.php | File | 7.26 KB | 0644 |
|
post-title.php | File | 6.8 KB | 0644 |
|
site-counters.php | File | 10.15 KB | 0644 |
|
site-description.php | File | 6.07 KB | 0644 |
|
site-logo.php | File | 7.75 KB | 0644 |
|
site-title.php | File | 5.93 KB | 0644 |
|
typing-effect.php | File | 10.4 KB | 0644 |
|