I find the solution.
Change this:
function add_voting_handler($atts, $content = null)
{
global $post;
$pattern = '#(<a.[^>]*?>)?<img[^>]*src="([^"]*)"[^>/]*?/>(?(1)\s*</a>)#isU';
//Process nested content first
$content = do_shortcode($content);
$content = preg_replace_callback($pattern, "get_image_votes", $content);
return $content;
}
add_shortcode('add_voting', 'add_voting_handler' );
Into this:
function add_voting_handler($content)
{
global $post;
$pattern = '#(<a.[^>]*?>)?<img[^>]*src="([^"]*)"[^>/]*?/>(?(1)\s*</a>)#isU';
$content = preg_replace_callback($pattern, "get_image_votes", $content);
return $content;
}
add_filter('the_content','add_voting_handler',10,4);
It works perfect for me.
Now, all images in your posts will have the voting system, without using shortcodes.