WordPress.org

Support

Support » Plugins and Hacks » [Resolved] new shortcode [poll="id"] don't work

[Resolved] new shortcode [poll="id"] don't work

  • New shortcode doesn’t process properly, so it always shows the latest poll.
    The function for processing it hadn’t changed since last plugin update, so I made quick draft fixes to solve this situation untill plugin developers won’t fix it.
    wp-polls.php (line 735)

    function poll_shortcode($atts) {
    	extract(shortcode_atts(array('id' => 0, 'type' => 'vote'), $atts));
    	if(!is_feed()) {
    		$id = intval($id);
    		/**/
    		$id_new = intval(trim($atts[0], '="\''));
    		if(!$id)
    			$id = $id_new;
    		/**/
    		if($type == 'vote') {
    			return get_poll($id, false);
    		} elseif($type == 'result') {
    			return display_pollresult($id);
    		}
    	} else {
    		return __('Note: There is a poll embedded within this post, please visit the site to participate in this post\'s poll.', 'wp-polls');
    	}
    }

    https://wordpress.org/plugins/wp-polls/

Viewing 9 replies - 1 through 9 (of 9 total)
Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘[Resolved] new shortcode [poll="id"] don't work’ is closed to new replies.