Repository URL to install this package:
|
Version:
3.5.0 ▾
|
<?php
namespace ZionBuilderPro\Elements\PostComments;
use ZionBuilder\Elements\Element;
// Prevent direct access
if ( ! defined( 'ABSPATH' ) ) {
return;
}
/**
* Class PostComments
*
* @package ZionBuilder\Elements
*/
class PostComments extends Element {
/**
* Get type
*
* Returns the unique id for the element
*
* @return string The element id/type
*/
public function get_type() {
return 'post_comments';
}
/**
* Get name
*
* Returns the name for the element
*
* @return string The element name
*/
public function get_name() {
return __( 'Post comments', 'zionbuilder' );
}
/**
* Get Category
*
* Will return the element category
*
* @return string
*/
public function get_category() {
return 'content';
}
/**
* Get keywords
*
* Returns the keywords for this element
*
* @return array<string> The list of element keywords
*/
public function get_keywords() {
return [ 'comments' ];
}
/**
* Get Element Icon
*
* Returns the icon used in add elements panel for this element
*
* @return string The element icon
*/
public function get_element_icon() {
return 'element-comments';
}
/**
* Registers the element options
*
* @param \ZionBuilder\Options\Options $options The Options instance
*
* @return void
*/
public function options( $options ) {
}
/**
* Get style elements
*
* Returns a list of elements/tags that for which you
* want to show style options
*
* @return void
*/
public function on_register_styles() {
}
/**
* Enqueue element scripts for both frontend and editor
*
* @return void
*/
public function enqueue_scripts() {
}
/**
* Enqueue element styles for both frontend and editor
*
* If you want to use the ZionBuilder cache system you must use
* the enqueue_editor_style(), enqueue_element_style() functions
*
* @return void
*/
public function enqueue_styles() {
}
/**
* Renders the element based on options
*
* @param \ZionBuilder\Options\Options $options
*
* @return void
*/
public function render( $options ) {
// If comments are open or we have at least one comment, load up the comment template.
if ( comments_open() || get_comments_number() ) :
comments_template();
endif;
}
public function server_render( $config ) {
if ( comments_open() || get_comments_number() ) :
comments_template();
else:
echo __('Comments are disabled for this post', 'zionbuilder-pro');
endif;
}
}