WP-Polls 3.0.3 has 9 actions and 28 filters, read directly from its source code on Nov 17, 2026. The list updates automatically when a new version is released.
How to use these hooks
Actions let you run your own code at a specific moment. Filters let you change a value before the plugin uses it. Put your code in a child theme's functions.php or a code-snippets plugin, never in the plugin's own files, because updates overwrite them.
// Run your own code when WP-Polls fires an action
add_action( 'wp_polls_add_poll', function( $latest_pollid ) {
// Your code runs here.
}, 10, 1 );
// Change a value WP-Polls is about to use
add_filter( 'wp_polls_hostname', function( $value ) {
// Change $value here.
return $value;
}, 10, 1 );Parts of a name in {braces} are filled in at runtime (for example a post type or field ID). Choose Example on any hook for a ready-to-edit snippet.
All hooks
-
wp_polls_hostname
filter/** * This filter is documented in includes/class-wp-polls-vote.php */ apply_filters( 'wp_polls_hostname', '' ); -
wp_polls_round_percentage
filter/** * Filters whether the last answer absorbs the rounding remainder. */ apply_filters( 'wp_polls_round_percentage', false ); -
wp_polls_add_poll
action/** * Fires after a poll has been created. */ do_action( 'wp_polls_add_poll', $latest_pollid ); -
wp_polls_archive
filter/** * Filters the finished polls archive markup. */ apply_filters( 'wp_polls_archive', $pollsarchive_output_archive ); -
wp_polls_capability
filter/** * Filters the capability required to reach a WP-Polls screen. */ apply_filters( 'wp_polls_capability', self::CAPABILITY, $context ); -
wp_polls_cookiepath
filter/** * Filters the path the "already voted" cookie is set on. */ apply_filters( 'wp_polls_cookiepath', SITECOOKIEPATH ); -
wp_polls_delete_poll
action/** * Fires after a poll and its answers and logs have been deleted. */ do_action( 'wp_polls_delete_poll', $poll_id ); -
wp_polls_display_pollresult
action/** * Fires before a poll's results are assembled. */ do_action( 'wp_polls_display_pollresult', $poll_id, $user_voted ); -
wp_polls_display_pollvote
action/** * Fires before a voting form is assembled. */ do_action( 'wp_polls_display_pollvote' ); -
wp_polls_get_poll
action/** * Fires when a poll is asked for and polls are not disabled. */ do_action( 'wp_polls_get_poll' ); -
wp_polls_ipaddress
filter/** * Filters the voter identity recorded against a vote. */ apply_filters( 'wp_polls_ipaddress', wp_hash( self::poll_get_raw_ipaddress() ) ); -
wp_polls_lock_file
filter/** * Filters the path of the advisory lock file guarding one poll's tally. */ apply_filters( 'wp_polls_lock_file', get_temp_dir() . '/wp-blog-' . get_current_blog_id() . '-wp-polls-' . $poll_id . '.lock', $poll_id ); -
wp_polls_log_secret_ballot
filter/** * Filters the voter name printed in the poll log. */ apply_filters( 'wp_polls_log_secret_ballot', removeslashes( $poll_ip->pollip_user ) ); -
wp_polls_log_show_log_filter
filter/** * Filters whether the log filter forms are shown. */ apply_filters( 'wp_polls_log_show_log_filter', true ); -
wp_polls_log_vote
filter/** * Filters whether this vote is written to the poll log. */ apply_filters( 'wp_polls_log_vote', true, $poll_id ); -
wp_polls_needs_assets
filter/** * Filters whether the head enqueues the front end assets. */ apply_filters( 'wp_polls_needs_assets', self::detect_poll() ); -
wp_polls_polls_archive
action/** * Fires before the polls archive is assembled. */ do_action( 'wp_polls_polls_archive' ); -
wp_polls_result_markup
filter/** * Filters the finished result markup for one poll. */ apply_filters( 'wp_polls_result_markup', $temp_pollresult ); -
/** * Filters the result body markup for an answer this visitor did not vote for. */ apply_filters( 'wp_polls_template_resultbody_markup', $template_answer, $poll_answer, $template_variables ); -
/** * Filters the tokens substituted into both result body templates. */ apply_filters( 'wp_polls_template_resultbody_variables', $template_variables ); -
/** * Filters the result body markup for an answer this visitor voted for. */ apply_filters( 'wp_polls_template_resultbody2_markup', $template_answer, $poll_answer, $template_variables ); -
/** * Filters the result header markup. */ apply_filters( 'wp_polls_template_resultheader_markup', $template_question, $poll_question, $template_variables ); -
/** * Filters the tokens substituted into the result header template. */ apply_filters( 'wp_polls_template_resultheader_variables', $template_variables ); -
/** * Filters one answer's voting form markup. */ apply_filters( 'wp_polls_template_votebody_markup', $template_answer, $poll_answer, $template_answer_variables ); -
/** * Filters the tokens substituted into the voting form body template. */ apply_filters( 'wp_polls_template_votebody_variables', $template_answer_variables ); -
/** * Filters the voting form header markup. */ apply_filters( 'wp_polls_template_voteheader_markup', $template_question, $poll_question, $template_question_variables ); -
/** * Filters the tokens substituted into the voting form header template. */ apply_filters( 'wp_polls_template_voteheader_variables', $template_question_variables ); -
wp_polls_trust_proxy
filter/** * Filters whether the usual proxy headers may be trusted. */ apply_filters( 'wp_polls_trust_proxy', defined( 'WP_POLLS_TRUST_PROXY' ) && WP_POLLS_TRUST_PROXY ); -
wp_polls_update_poll
action/** * Fires after a poll's question, answers or dates have been edited. */ do_action( 'wp_polls_update_poll', $pollq_id ); -
wp_polls_vote_poll
action/** * Fires when a vote is about to be recorded, before any guard has run. */ do_action( 'wp_polls_vote_poll' ); -
wp_polls_vote_poll_success
action/** * Fires once a vote has been recorded and the lock released. */ do_action( 'wp_polls_vote_poll_success' ); -
widget_title
filterapply_filters( 'widget_title', esc_attr( $instance['title'] ) );
Generated from WP-Polls's GPL-licensed source code. Hooks inside bundled third-party libraries are not listed.
Can't find the right hook?
We can build the customisation for you. Describe what you need: