1, 'daily' => 0, 'is_shortcode' => 1, 'offset' => 0, 'include_cat_ids' => '', ) ), $atts, 'top-10' ); return tptn_pop_posts( $atts ); } add_shortcode( 'tptn_list', 'tptn_shortcode' ); /** * Creates a shortcode [tptn_views daily="0"]. * * @since 1.9.9 * @param array $atts Shortcode attributes. * @param string $content Content. * @return string Views of the post */ function tptn_shortcode_views( $atts, $content = null ) { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed $a = shortcode_atts( array( 'daily' => '0', 'count' => 'total', ), $atts ); // If daily is explicitly set to 1, then pass daily, else pass count. $count = $a['daily'] ? 'daily' : $a['count']; return get_tptn_post_count_only( get_the_ID(), $count ); } add_shortcode( 'tptn_views', 'tptn_shortcode_views' );