Home Forums WTI Like Post PRO Text next to image if has votes Reply To: Text next to image if has votes

#225
Webtechideas
Keymaster

That hook is slightly modified. You can use the following piece of code. You can see it will show different messages if it has 1 vote and more than 1 votes. In case there are no votes, it will simply show the default message.

add_filter( 'wti_like_post_load_message', 'wti_like_post_load_message', 10, 4 );

function wti_like_post_load_message( $post_id, $like_count, $unlike_count, $msg ) {
	if ( $like_count == 1 ) {
		$msg = 'What about you, do you like the image?';
	} else if ( $like_count > 1 ) {
		$msg = 'Users already like this image.';
	}
	
	return $msg;
}

Thanks