1, 'daily' => 0, 'is_shortcode' => 1, 'offset' => 0, 'include_cat_ids' => '', 'blog_id' => get_current_blog_id(), ); /** * Filter the default shortcode attributes. * * @since 4.0.0 * * @param array $default_atts Default shortcode attributes. */ $default_atts = apply_filters( 'tptn_shortcode_defaults', $default_atts ); $atts = shortcode_atts( array_merge( \tptn_get_settings_with_defaults(), $wp_query_args, $default_atts ), $atts, 'top-10' ); return \WebberZone\Top_Ten\Frontend\Display::pop_posts( $atts ); } /** * Creates a shortcode [tptn_views daily="0"]. * * @since 3.3.0 * * @param array $atts Shortcode attributes. * @param string $content Content. * @param string $tag Shortcode tag. * @return string Views of the post. */ public static function tptn_views( $atts, $content = null, $tag = '' ) { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed $a = shortcode_atts( array( 'daily' => '0', 'count' => 'total', 'format_number' => true, 'post_id' => get_the_ID(), ), $atts ); // If daily is explicitly set to 1, then pass daily, else pass count. $count = $a['daily'] ? 'daily' : $a['count']; return (string) \WebberZone\Top_Ten\Counter::get_post_count_only( $a['post_id'], $count, 0, array( 'format_number' => $a['format_number'] ) ); } }