YOP Poll 7.1.1 has 19 actions and 85 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 YOP Poll fires an action
add_action( 'yop_poll_results_notices', function( $poll, $view ) {
// Your code runs here.
}, 10, 2 );
// Change a value YOP Poll is about to use
add_filter( 'yop_poll_vote_replacement', function( $value, $arg2 ) {
// Change $value here.
return $value;
}, 10, 2 );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
-
/** * This action is documented below. */ do_action( 'yop_poll_results_notices', $poll, $view ); -
/** * This filter is documented in includes/REST/class-rest-votes.php */ apply_filters( 'yop_poll_vote_replacement', null, array( 'poll' => $poll, 'access' => $access, 'request' => array(), 'answers' => array(), 'user_id' => $user_id, 'user_email' => $account ? sanitize_email( $account->user_email ) : '', 'user_type' => 'wordpress', 'auth_provider' => 'wordpress', ) ); -
/** * Filters an element's stored meta once the save that created rows it may * refer to has assigned their ids. */ apply_filters( 'yop_poll_element_meta_after_ids', $meta, $id_map, (int) $row['id'], (string) ( $row['etype'] ?? '' ) ); -
/** * How much work a vote costs. */ apply_filters( 'yop_poll_pow_difficulty', self::DIFFICULTY ); -
/** * The indicator drawn beside the control, for a shape this edition cannot draw * itself. */ apply_filters( 'yop_poll_answer_indicator', null, $mark, $is_multiple, $radio_color ); -
/** * Markup above this page's own elements. */ apply_filters( 'yop_poll_before_page', '', $index, $page_context ); -
/** * Filters the detected editor. */ apply_filters( 'yop_poll_detected_editor', array( 'kind' => $kind ) ); -
/** * Whether this element type can be answered, and its required default. */ apply_filters( 'yop_poll_element_answerability', array( 'answerable' => $answerable, 'required_default' => 0 === strpos( $etype, 'question-' ), ), $etype ); -
/** * Attributes an addon needs on this element, beside its styles. */ apply_filters( 'yop_poll_element_attributes', array(), $element, $context ); -
/** * An element's own top and bottom margin. */ apply_filters( 'yop_poll_element_margin', self::resolve_margin( $element ), $element, $context ); -
/** * Whether this visitor had to answer this element. */ apply_filters( 'yop_poll_element_required', Validation_Rules::is_required( $el_meta, $kind['required_default'] ), $el, $answers, $poll ); -
/** * The email address a guest gave, if an addon knows of one. */ apply_filters( 'yop_poll_guest_email', '', $request, $context ); -
/** * Filters how many polls use each integration. */ apply_filters( 'yop_poll_integration_usage', $usage ); -
/** * Fires after core services have registered and addons may safely attach. */ do_action( 'yop_poll_loaded', $this->addon_api ); -
/** * Whether this poll's blocking needs the browser to resolve it. */ apply_filters( 'yop_poll_needs_client_block_check', $needs, $block_voters, $poll ); -
/** * Filters whether a stored write-in is one of the answers its poll's total * counts. */ apply_filters( 'yop_poll_other_answer_is_counted', true, (string) ( $row['status'] ?? '' ), (array) $row ); -
/** * What this page actually renders. */ apply_filters( 'yop_poll_page_elements', $page_elements, $index, $page_context ); -
/** * Filters the notes under one poll's name in the polls list. */ apply_filters( 'yop_poll_poll_row_notes', array(), $item ); -
/** * How many built-in-check challenges one address is handed, and over what. A * limit or window of zero turns the cap off -- the escape hatch for visitors * who genuinely share one address. */ apply_filters( 'yop_poll_pow_rate_limit', array( 'limit' => 30, 'window' => 10 * MINUTE_IN_SECONDS, ), $ip ); -
/** * Allow an addon to keep the poll-level counters in public data — for * example when it renders them through a placeable element rather than the * poll-level option. */ apply_filters( 'yop_poll_preserve_public_counters', $has_total_votes_el, $data ); -
/** * Anything that belongs between the question and its answers. */ apply_filters( 'yop_poll_question_before_answers', '', $element, $context ); -
/** * The shape of this question's radio or checkbox. */ apply_filters( 'yop_poll_question_mark_style', $template, $meta, $context ); -
/** * The answers this results view draws, before anything is counted. */ apply_filters( 'yop_poll_result_answers', (array) $element['subelements'], $element, $view ); -
/** * The answer rows themselves, for a question a bar cannot describe. */ apply_filters( 'yop_poll_result_element_rows', null, $element, $view ); -
/** * Draws a view registered on `yop_poll_results_views`. */ do_action( "yop_poll_results_view_{$view}", $poll ); -
/** * Filters the extra views of one poll's results. */ apply_filters( 'yop_poll_results_views', array(), $poll ); -
/** * Filters the line under a poll's name on its results. */ apply_filters( 'yop_poll_results_votes_note', $note, $poll, (int) $counted, (int) $waiting ); -
/** * Let an addon suppress this notice when it renders consent through its own * placeable element instead — matching React's own `frontendShowPollGdpr` * extension filter (`PollRenderer.jsx:3383`). */ apply_filters( 'yop_poll_show_poll_gdpr', true, $context ); -
/** * Let an addon suppress this notice when it renders the same totals through * its own placeable element — matching React's own `frontendShowPollTotals` * extension filter (`PollRenderer.jsx:3538`). */ apply_filters( 'yop_poll_show_poll_totals', true, $context ); -
/** * Proxies in front of the site whose addresses are public -- a CDN edge ahead * of the site's own proxy, say -- to skip when reading X-Forwarded-For. * Addresses or CIDR ranges, IPv4 or IPv6. */ apply_filters( 'yop_poll_trusted_proxies', array() ); -
/** * Filters the notice shown when a poll has votes that did not count. */ apply_filters( 'yop_poll_uncounted_notice', $notice, $poll_id, $counts ); -
/** * Filters the note under one answer of a vote. */ apply_filters( 'yop_poll_vote_answer_note', array(), $item, $answer ); -
/** * The answers this vote actually carries. */ apply_filters( 'yop_poll_vote_answers', $answers, $poll_elements, $poll ); -
/** * Fires when a held vote is counted. */ do_action( 'yop_poll_vote_counted', $vote_id, $vote ); -
/** * Fires when a held vote is discarded. */ do_action( 'yop_poll_vote_discarded', $vote_id, $vote ); -
/** * Fires when a held vote runs out without being settled. */ do_action( 'yop_poll_vote_expired', $vote_id, $vote ); -
/** * How many votes one address may cast at one poll, and over what. */ apply_filters( 'yop_poll_vote_rate_limit', array( 'limit' => 10, 'window' => MINUTE_IN_SECONDS, ), $ip, $poll_id ); -
/** * Whether the vote endpoint holds a vote to the poll-level consent box. */ apply_filters( 'yop_poll_vote_requires_poll_gdpr', true, $poll, $meta_data ); -
/** * Filters the actions on one vote's row. */ apply_filters( 'yop_poll_vote_row_actions', $actions, $item ); -
/** * Filters the sentence under a held vote's badge. */ apply_filters( 'yop_poll_vote_status_line', '', $item, $status ); -
/** * Filters the states the votes screen lists. */ apply_filters( 'yop_poll_vote_status_tabs', array() ); -
do_action( 'yop_poll_enqueue_poll_assets', $poll, 'block' ); -
do_action( 'yop_poll_after_vote', array_merge( $vote_row, array( 'id' => $vote_id ) ), $vote_context ); -
apply_filters( 'yop_poll_features', array() ); -
apply_filters( 'yop_poll_rest_prepare_poll_request', $body, $request, 'create', null ); -
apply_filters( 'yop_poll_result_answer_sort_text', (string) ( $a['stext'] ?? '' ), $element, $a ); -
apply_filters( 'yop_poll_result_element_summary', '', $element, isset( $element['subelements'] ) ? (array) $element['subelements'] : array() ); -
apply_filters( 'yop_poll_settings_response', $merged, $request ); -
apply_filters( 'yop_poll_validation_errors', $this->errors, $poll, $elements ); -
apply_filters( 'widget_title', $title, $instance, $this->id_base ); -
apply_filters( 'yop_poll_active_vote_count', $count, $poll_id, $args ); -
do_action( 'yop_poll_admin_assets_registered', 'yop-poll-admin' ); -
apply_filters( 'yop_poll_admin_config', $config ); -
apply_filters( 'yop_poll_admin_poll_results', $poll, $request ); -
do_action( 'yop_poll_after_poll_cache_refresh', $poll_id, $data ); -
apply_filters( 'yop_poll_after_poll_markup', '', $poll_id, $poll_data ); -
do_action( 'yop_poll_after_vote_delete', $vote ); -
do_action( 'yop_poll_after_votes_delete_by_poll', (int) $poll_id, $result ); -
apply_filters( 'yop_poll_auto_reset_enabled', $switched_on, $poll, $meta_data ); -
do_action( 'yop_poll_before_auto_reset', $snapshot, $meta_data, $reset_on ); -
do_action( 'yop_poll_before_poll_cache_refresh', $poll_id ); -
do_action( 'yop_poll_before_vote', $vote_context ); -
apply_filters( 'yop_poll_block_identity_args', array(), $block_type, array( 'poll_id' => $poll_id, 'ipaddress' => $ip, 'user_id' => $user_id, 'voter_id' => $voter_id, 'tracking_id' => $tracking_id, 'voter_fingerprint' => $fingerprint, 'user_email' => $user_email, ) ); -
apply_filters( 'yop_poll_container_attributes', array(), $poll_id, $poll_data ); -
do_action( 'yop_poll_core_schema_ready', YOP_POLL_VERSION, $this->addon_api ); -
apply_filters( 'yop_poll_cron_schedules', $schedules ); -
apply_filters( 'yop_poll_cron_services', array( new Cron\Cron_Auto_Reset() ), $this->addon_api ); -
apply_filters( 'yop_poll_element_meta_defaults', array(), $context ); -
apply_filters( 'yop_poll_element_meta_sanitize', $meta, $context ); -
apply_filters( 'yop_poll_element_types', array( 'question-text' => array( 'has_subelements' => true ), 'standard-single-line-text' => array( 'has_subelements' => false ), 'standard-text-block' => array( 'has_subelements' => false ), 'standard-divider' => array( 'has_subelements' => false ), ) ); -
do_action( 'yop_poll_frontend_assets_registered', 'yop-poll' ); -
apply_filters( 'yop_poll_frontend_config', $config ); -
apply_filters( 'yop_poll_generated_step_types', array( 'question-text-slider' ) ); -
apply_filters( 'yop_poll_last_vote_for_identity', $last_vote, $poll_id, $args ); -
apply_filters( 'yop_poll_message_defaults', $core ); -
apply_filters( 'yop_poll_other_answer_status', 'active', $element_id, $el_meta, $poll_id ); -
do_action( 'yop_poll_poll_cache_invalidated', $poll_id ); -
apply_filters( 'yop_poll_poll_meta_defaults', array(), $context ); -
apply_filters( 'yop_poll_poll_meta_sanitize', $meta, $context ); -
apply_filters( 'yop_poll_prepare_auto_reset_snapshot', $snapshot, $meta_data, $reset_on ); -
apply_filters( 'yop_poll_prepare_public_poll_data', $data, $include_counts, $force_counts ); -
apply_filters( 'yop_poll_prepare_vote_log', array( 'identity' => $base_log, 'vote_data' => $vote_data_json, ), $identity_context ); -
apply_filters( 'yop_poll_prepare_vote_row', $vote_row, $vote_context ); -
apply_filters( 'yop_poll_public_poll_data', $data, $force_counts ); -
apply_filters( "yop_poll_render_element_{$etype}", '', $element, $context ); -
apply_filters( 'yop_poll_rest_controllers', array( new REST\REST_Polls(), new REST\REST_Elements(), new REST\REST_Votes(), new REST\REST_Bans(), new REST\REST_Settings(), new REST\REST_Templates(), ), $this->addon_api ); -
apply_filters( 'yop_poll_result_answer_content', self::inline( (string) ( $sub['stext'] ?? '' ) ), $element, $sub, $index ); -
apply_filters( 'yop_poll_result_question_types', array( 'question-text' ) ); -
apply_filters( 'yop_poll_secret_settings_fields', self::SECRET_FIELDS ); -
apply_filters( 'yop_poll_settings_capability', 'manage_options' ); -
apply_filters( 'yop_poll_settings_defaults', $defaults ); -
apply_filters( 'yop_poll_settings_sanitize', $sanitized, $body, $existing, $request ); -
apply_filters( 'yop_poll_subelement_meta_defaults', array(), $context ); -
apply_filters( 'yop_poll_subelement_meta_sanitize', $meta, $context ); -
apply_filters( 'yop_poll_subelement_text', $value, $etype, $sub ); -
apply_filters( 'yop_poll_template_available', $available, $item, $request ); -
apply_filters( 'yop_poll_template_locations', $locations ); -
apply_filters( 'yop_poll_templates', $items, $request ); -
do_action( 'yop_poll_templates_registered', $owner, $rows ); -
apply_filters( 'yop_poll_validate_vote', null, $vote_context ); -
apply_filters( 'yop_poll_vote_auth_providers', $providers ); -
apply_filters( 'yop_poll_vote_privacy_available', false, $identity_context ); -
apply_filters( 'yop_poll_vote_request', $body, $request ); -
apply_filters( 'yop_poll_vote_weight', 1, $vote_context );
Generated from YOP Poll's GPL-licensed source code. Hooks inside bundled third-party libraries are not listed.
Done for you
Rather have it built for you?
Tell us what should change and we’ll write and test the code using these hooks.
Custom hook snippet
from $49
A small, update-safe change built on the plugin’s own hooks.
- Code written against the plugin’s actions and filters
- Tested on a staging copy of your site
- Install instructions included
Typical turnaround: 2–3 business days
Choose thisPlugin customisation
from $149
New features or changed behaviour, without editing the plugin’s files.
- Built as a companion plugin, so updates never wipe it
- Exact quote before we start
- Tested on staging, then deployed
Typical turnaround: 3–7 business days
Choose thisNot sure which fits? Describe what you need and we’ll suggest the simplest option.
Can't find the right hook?
We can build the customisation for you. Describe what you need: