Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Print rtmedia who like html
- *
- * @param int $like_count ( Total like Count )
- * @param bool|string $user_like_it ( login user like it or not )
- *
- * @return string HTML
- */
- if ( ! function_exists( 'rtmedia_who_like_html' ) ) {
- function rtmedia_who_like_html( $like_count, $user_like_it ) {
- $like_count = ( $like_count ) ? $like_count : false;
- $user_like_it = ( $user_like_it ) ? true : false;
- $like_count_new = $like_count;
- $html = '';
- if ( $like_count == 1 && $user_like_it ) {
- /**
- * rtmedia you like text
- * @param $html TEXT
- * @param int $like_count Total Like
- * @param int $user_like_it User Like it or Not
- * @return html TEXT to display
- */
- $html = apply_filters( 'rtmedia_like_html_you_only_like', esc_html__( 'You like this', 'buddypress-media' ), $like_count, $user_like_it );
- } elseif ( $like_count ) {
- if ( $like_count > 1 && $user_like_it ) {
- /**
- * rtmedia you and
- * @param $html TEXT
- * @param int $like_count Total Like
- * @param int $user_like_it User Like it or Not
- * @return html TEXT to display
- */
- $html .= apply_filters( 'rtmedia_like_html_you_and_more_like', esc_html__( 'You and ', 'buddypress-media' ), $like_count, $user_like_it );
- $like_count_new--;
- }
- /**
- * rtmedia Disaply count
- * @param int $like_count Total Like
- * @param int $user_like_it User Like it or Not
- * @return INT Count to display
- */
- $html .= apply_filters( 'rtmedia_like_html_you_and_more_like', $like_count, $user_like_it );
- /**
- * rtmedia person or people likes it
- * @param $html TEXT
- * @param int $like_count Total Like
- * @param int $user_like_it User Like it or Not
- * @return html TEXT to display
- */
- $html .= apply_filters( 'rtmedia_like_html_othe_likes_this', _n( ' person likes this', ' people like this', $like_count_new, 'buddypress-media' ) ,$like_count, $user_like_it );
- }
- /**
- * rtmedia return whole HTML
- * @param $html TEXT
- * @param int $like_count Total Like
- * @param int $user_like_it User Like it or Not
- * @return html TEXT to display
- */
- $html = apply_filters( 'rtmedia_who_like_html', $html ,$like_count, $user_like_it );
- return $html;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment