WP-Polls icon
Forms

WP-Polls hooks reference

  • By Lester Chan
  • v3.0.3 New
  • Updated

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.

functions.phpyour child theme
// 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

  • includes/class-wp-polls-vote.php line 302 · used in 2 places
    /**
     * This filter is documented in includes/class-wp-polls-vote.php
     */
    apply_filters( 'wp_polls_hostname', '' );
  • includes/class-wp-polls-display.php line 420 · used in 2 places
    /**
     * Filters whether the last answer absorbs the rounding remainder.
     */
    apply_filters( 'wp_polls_round_percentage', false );
  • includes/class-wp-polls-screen-add.php line 155
    /**
     * Fires after a poll has been created.
     */
    do_action( 'wp_polls_add_poll', $latest_pollid );
  • includes/class-wp-polls-display.php line 965
    /**
     * Filters the finished polls archive markup.
     */
    apply_filters( 'wp_polls_archive', $pollsarchive_output_archive );
  • includes/class-wp-polls-admin.php line 178
    /**
     * Filters the capability required to reach a WP-Polls screen.
     */
    apply_filters( 'wp_polls_capability', self::CAPABILITY, $context );
  • includes/class-wp-polls-vote.php line 529
    /**
     * Filters the path the "already voted" cookie is set on.
     */
    apply_filters( 'wp_polls_cookiepath', SITECOOKIEPATH );
  • includes/class-wp-polls-poll.php line 165
    /**
     * Fires after a poll and its answers and logs have been deleted.
     */
    do_action( 'wp_polls_delete_poll', $poll_id );
  • includes/class-wp-polls-display.php line 305
    /**
     * Fires before a poll's results are assembled.
     */
    do_action( 'wp_polls_display_pollresult', $poll_id, $user_voted );
  • includes/class-wp-polls-display.php line 85
    /**
     * Fires before a voting form is assembled.
     */
    do_action( 'wp_polls_display_pollvote' );
  • includes/class-wp-polls-display.php line 1108
    /**
     * Fires when a poll is asked for and polls are not disabled.
     */
    do_action( 'wp_polls_get_poll' );
  • includes/class-wp-polls-vote.php line 286
    /**
     * Filters the voter identity recorded against a vote.
     */
    apply_filters( 'wp_polls_ipaddress', wp_hash( self::poll_get_raw_ipaddress() ) );
  • includes/class-wp-polls-vote.php line 385
    /**
     * 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 );
  • includes/class-wp-polls-screen-logs.php line 355
    /**
     * Filters the voter name printed in the poll log.
     */
    apply_filters( 'wp_polls_log_secret_ballot', removeslashes( $poll_ip->pollip_user ) );
  • includes/class-wp-polls-screen-logs.php line 196
    /**
     * Filters whether the log filter forms are shown.
     */
    apply_filters( 'wp_polls_log_show_log_filter', true );
  • includes/class-wp-polls-vote.php line 586
    /**
     * Filters whether this vote is written to the poll log.
     */
    apply_filters( 'wp_polls_log_vote', true, $poll_id );
  • includes/class-wp-polls.php line 141
    /**
     * Filters whether the head enqueues the front end assets.
     */
    apply_filters( 'wp_polls_needs_assets', self::detect_poll() );
  • includes/class-wp-polls-display.php line 634
    /**
     * Fires before the polls archive is assembled.
     */
    do_action( 'wp_polls_polls_archive' );
  • includes/class-wp-polls-display.php line 582
    /**
     * Filters the finished result markup for one poll.
     */
    apply_filters( 'wp_polls_result_markup', $temp_pollresult );
  • includes/class-wp-polls-display.php line 488
    /**
     * 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 );
  • includes/class-wp-polls-display.php line 460
    /**
     * Filters the tokens substituted into both result body templates.
     */
    apply_filters( 'wp_polls_template_resultbody_variables', $template_variables );
  • includes/class-wp-polls-display.php line 475
    /**
     * 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 );
  • includes/class-wp-polls-display.php line 549
    /**
     * Filters the result footer markup shown once the visitor has voted.
     */
    apply_filters( 'wp_polls_template_resultfooter_markup', $template_footer, $poll_question, $template_variables );
  • includes/class-wp-polls-display.php line 536
    /**
     * Filters the tokens substituted into both result footer templates.
     */
    apply_filters( 'wp_polls_template_resultfooter_variables', $template_variables );
  • includes/class-wp-polls-display.php line 561
    /**
     * Filters the result footer markup shown before the visitor has voted.
     */
    apply_filters( 'wp_polls_template_resultfooter2_markup', $template_footer, $poll_question, $template_variables );
  • includes/class-wp-polls-display.php line 381
    /**
     * Filters the result header markup.
     */
    apply_filters( 'wp_polls_template_resultheader_markup', $template_question, $poll_question, $template_variables );
  • includes/class-wp-polls-display.php line 370
    /**
     * Filters the tokens substituted into the result header template.
     */
    apply_filters( 'wp_polls_template_resultheader_variables', $template_variables );
  • includes/class-wp-polls-display.php line 196
    /**
     * Filters one answer's voting form markup.
     */
    apply_filters( 'wp_polls_template_votebody_markup', $template_answer, $poll_answer, $template_answer_variables );
  • includes/class-wp-polls-display.php line 185
    /**
     * Filters the tokens substituted into the voting form body template.
     */
    apply_filters( 'wp_polls_template_votebody_variables', $template_answer_variables );
  • includes/class-wp-polls-display.php line 241
    /**
     * Filters the voting form footer markup.
     */
    apply_filters( 'wp_polls_template_votefooter_markup', $template_footer, $poll_question, $template_footer_variables );
  • includes/class-wp-polls-display.php line 230
    /**
     * Filters the tokens substituted into the voting form footer template.
     */
    apply_filters( 'wp_polls_template_votefooter_variables', $template_footer_variables );
  • includes/class-wp-polls-display.php line 141
    /**
     * Filters the voting form header markup.
     */
    apply_filters( 'wp_polls_template_voteheader_markup', $template_question, $poll_question, $template_question_variables );
  • includes/class-wp-polls-display.php line 130
    /**
     * Filters the tokens substituted into the voting form header template.
     */
    apply_filters( 'wp_polls_template_voteheader_variables', $template_question_variables );
  • includes/class-wp-polls-vote.php line 194
    /**
     * Filters whether the usual proxy headers may be trusted.
     */
    apply_filters( 'wp_polls_trust_proxy', defined( 'WP_POLLS_TRUST_PROXY' ) && WP_POLLS_TRUST_PROXY );
  • includes/class-wp-polls-screen-manage.php line 223
    /**
     * Fires after a poll's question, answers or dates have been edited.
     */
    do_action( 'wp_polls_update_poll', $pollq_id );
  • includes/class-wp-polls-vote.php line 408
    /**
     * Fires when a vote is about to be recorded, before any guard has run.
     */
    do_action( 'wp_polls_vote_poll' );
  • includes/class-wp-polls-vote.php line 622
    /**
     * Fires once a vote has been recorded and the lock released.
     */
    do_action( 'wp_polls_vote_poll_success' );
  • widget_title

    filter
    includes/class-wp-polls-widget.php line 55
    apply_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: