function widget($args, $instance) { extract($args, EXTR_SKIP); $title = empty($instance['title']) ? ' ' : apply_filters('widget_title', $instance['title']); $showcount = empty($instance['showcount']) ? '5' : $instance['showcount']; $showcount = (int) $showcount; echo $before_widget; echo $before_title . $title . $after_title; echo '<span class="wpvtopvoted">' . wpv_top_voted_calc($showcount) . '</span>'; echo $after_widget; }
function wpv_top_ajax_submit() { $nonce = $_POST['wpv_nonce']; if (!wp_verify_nonce($nonce, 'wpv_submit_nonce')) { wp_die('Don\'t Cheat!'); } $showcount = get_option('wpv-top-voted-scount'); if ($showcount !== FALSE) { echo wpv_top_voted_calc($showcount); } exit; }