HEX
Server: Apache
System: Linux p3plzcpnl489499.prod.phx3.secureserver.net 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
User: dwauav0tm6jp (6177017)
PHP: 7.4.33
Disabled: NONE
Upload Files
File: /home/dwauav0tm6jp/www/wp-content/plugins/top-10/includes/modules/shortcode.php
<?php
/**
 * Shortcode module
 *
 * @package Top_Ten
 */

/**
 * Creates a shortcode [tptn_list limit="5" heading="1" daily="0"].
 *
 * @since   1.9.9
 * @param   array  $atts       Shortcode attributes.
 * @param   string $content    Content.
 * @return  string  Formatted list of posts generated by tptn_pop_posts
 */
function tptn_shortcode( $atts, $content = null ) {
	global $tptn_settings;

	$atts = shortcode_atts(
		array_merge(
			$tptn_settings,
			array(
				'heading'      => 1,
				'daily'        => 0,
				'is_shortcode' => 1,
				'offset'       => 0,
			)
		),
		$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' );