<?php
/**
 * Business Interface Social Snap compatibility functions.
 *
 * @package     Business Interface
 * @author      WPInterface Team
 * @since       1.1.0
 */

if ( ! function_exists( 'business_interface_entry_meta_shares' ) ) :
	/**
	 * Add share count information to entry meta.
	 *
	 * @since 1.1.0
	 */
	function business_interface_entry_meta_shares() {

		$share_count = socialsnap_get_total_share_count();

		// Icon.
		$icon = business_interface()->icons->get_meta_icon( 'share', business_interface()->icons->get_svg( 'share-2', array( 'aria-hidden' => 'true' ) ) );

		$output = sprintf(
			'<span class="share-count">%3$s%1$s %2$s</span>',
			socialsnap_format_number( $share_count ),
			esc_html( _n( 'Share', 'Shares', $share_count, 'business-interface' ) ),
			$icon
		);

		echo wp_kses( apply_filters( 'business_interface_entry_share_count', $output ), business_interface_get_allowed_html_tags() );
	}
endif;
