<?php

add_action('the_content', 'wp_superlike_add_button_to_content');

	/**
	* @This function should display the button
	* @automatically to any blog post
	* @uses saved settings
	*/
	function wp_superlike_add_button_to_content($content) {
	
		global $wp_superlike, $post;
		
		$wp_content = null;
		
		$position = $wp_superlike->get_option('add_to_content_after');
		
		switch ($position) {
			case 'before':
				$wp_content .= wp_superlike();
				$wp_content .= $content;
				break;
			case 'after':
				$wp_content .= $content;
				$wp_content .= wp_superlike();
				break;
			case 'left':
				$wp_content .= wp_superlike();
				$wp_content .= $content;
				break;
			case 'right';
				$wp_content .= wp_superlike();
				$wp_content .= $content;
				break;
			case 'both':
				$wp_content .= wp_superlike();
				$wp_content .= $content;
				$wp_content .= wp_superlike();
				break;
			default:
				$wp_content = $content;
				break;
		}
		
		if ($wp_superlike->get_option('add_to_content') == 0 || $wp_superlike->do_not_show_on_post($post->ID) ) {
			$wp_content = $content;
		}
		
		return $wp_content;
	
	}