-
Notifications
You must be signed in to change notification settings - Fork 7
Internal Shortcode | [Comment_Count]
EkoJr edited this page Jan 22, 2017
·
1 revision
Adds the number of comments with a post/page.
[comment_count]
(string) Amount of comments.
[comment_count]
Returns
9
File: advanced-post-list/includes/class/apl_shortcodes.php
/**
* Post Comment Count Shortcode.
*
* Desc: Adds the Post Comment_Count, which displays the amount of comments
* per post.
*
* 1. Add to return Post Comment_Count.
* 2. Return string.
*
* @since 0.1.0
* @version 0.4.0 - Changed to Class function, and uses WP's built-in
* functions for setting default attributes & do_shortcode().
*
* @param array $atts None.
* @return string Post->Comment_Count.
*/
public function comment_count($atts)
{
//INIT
$atts_value = shortcode_atts( array(), $atts, 'comment_count');
$return_str = '';
//STEP 1
$return_str .= $this->_post->comment_count;
//STEP 2
return $return_str;
}