Post Views Counter 1.8.2 has 22 actions and 140 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 Post Views Counter fires an action
add_action( 'pvc_import_before_provider', function( $arg1, $object ) {
// Your code runs here.
}, 10, 2 );
// Change a value Post Views Counter is about to use
add_filter( 'pvc_active_security_plugins', function( $plugins ) {
// Change $plugins here.
return $plugins;
}, 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
-
pvc_import_before_provider
action/** * Fires before an import provider operation starts. */ do_action( 'pvc_import_before_provider', [ 'mode' => $mode, 'provider' => $provider_slug, 'strategy' => $strategy ], $this ); -
pvc_session_created
action/** * Fires when a new anonymous session is created. */ do_action( 'pvc_session_created', $session_state, $content_id, $content_type ); -
pvc_active_security_plugins
filter/** * Filter the recognized security plugin names shown on the Status tab. */ apply_filters( 'pvc_active_security_plugins', $plugins ); -
/** * Filters the BCC recipients for an email summary. */ apply_filters( 'pvc_email_summary_bcc_recipients', $bcc_recipients, $period, $summary_type ); -
/** * Filters the CC recipients for an email summary. */ apply_filters( 'pvc_email_summary_cc_recipients', $cc_recipients, $period, $summary_type ); -
pvc_enable_traffic_signals
filter/** * Filter whether traffic signals should be enabled. */ apply_filters( 'pvc_enable_traffic_signals', true ); -
/** * Filter provider content mapping so it's possible to process non-post URLs. */ apply_filters( 'pvc_import_map_target_to_content', $content, $target, $provider, $tracked_post_types, $this ); -
/** * Filter import provider description parts. */ apply_filters( 'pvc_import_provider_description_parts', $parts, [ 'provider' => sanitize_key( $provider ), 'supports' => array_values( array_filter( array_map( 'sanitize_key', (array) $supports ) ) ) ], $this ); -
pvc_import_provider_query
filter/** * Filter the SQL query used when inserting provider data. */ apply_filters( 'pvc_import_provider_query', $query, [ 'strategy' => sanitize_key( $strategy ), 'provider' => $provider, 'sql_parts' => $sql_parts, 'on_duplicate' => $on_duplicate ], $this ); -
pvc_import_strategies
filter/** * Filter the available import strategies. */ apply_filters( 'pvc_import_strategies', $this->import_strategies, $this ); -
pvc_import_strategy_clause
filter/** * Filter the SQL ON DUPLICATE KEY UPDATE clause used during import. */ apply_filters( 'pvc_import_strategy_clause', $clause, [ 'strategy' => $strategy_key, 'provider' => $provider ], $this ); -
pvc_plugin_status_rows
filter/** * Filter the plugin status rows. */ apply_filters( 'pvc_plugin_status_rows', $rows, $this->settings ); -
pvc_plugin_status_tables
filter/** * Filter the database tables to check for plugin status. */ apply_filters( 'pvc_plugin_status_tables', [], $this->settings ); -
pvc_post_views_read_failed
action/** * Fires when a post Views read failed and its 0 is not a stored total, so a * screen that offers the total for editing can show it as unavailable instead. */ do_action( 'pvc_post_views_read_failed', $post_id, $period ); -
pvc_status_checks
filter/** * Filter the checks an extension adds to the Status tab. */ apply_filters( 'pvc_status_checks', [] ); -
pvc_status_delivery_probe
filter/** * Filter the delivery probe of the active counting mode, for an extension * whose handler counts in it. Return an array with: - url (string): an http or * https URL on this site's host. - method (string): POST or GET. - body * (array): at most ten string fields, for POST only; a GET probe carries its * query in url. - shape (string): how the handler answers, with a JSON content * type: ajax, a refusal whos... */ apply_filters( 'pvc_status_delivery_probe', null, $mode ); -
pvc_status_display_probe
filter/** * Filter the probe of a display endpoint that loads values into cached pages. * The array has the fields of pvc_status_delivery_probe (url, method, body, * shape, status, code) and must name a request the endpoint answers without * counting; the marker is not used. Anything else, or an invalid array, is * ignored. */ apply_filters( 'pvc_status_display_probe', null ); -
pvc_views_read_failed
action/** * Fires when a Views read failed and its zeros are not stored totals, so a * diagnostic can show the read as unavailable. */ do_action( 'pvc_views_read_failed', $args ); -
pvc_admin_display_post_views
filterapply_filters( 'pvc_admin_display_post_views', true ); -
pvc_settings_capability
filterapply_filters( 'pvc_settings_capability', 'manage_options' ); -
apply_filters( 'pvc_visits_object_cache_expire', 300 ); -
pvc_restrict_edit_capability
filterapply_filters( 'pvc_restrict_edit_capability', 'manage_options' ); -
pvc_extend_post_object
filterapply_filters( 'pvc_extend_post_object', false, $query ); -
pvc_object_cache_expire
filterapply_filters( 'pvc_object_cache_expire', 300 ); -
apply_filters( 'pvc_email_summary_traffic_signals_html', $rendered, $data, $settings, $summary_type, $this ); -
pvc_email_summary_period
filterapply_filters( 'pvc_email_summary_period', $period, 'weekly', $now, $this ); -
apply_filters( 'pvc_email_summary_traffic_signals_text', $rendered, $data, $settings, $summary_type, $this ); -
pvc_get_post_views
filterapply_filters( 'pvc_get_post_views', $value, $id, $period, [] ); -
pvc_user_can_see_stats
filterapply_filters( 'pvc_user_can_see_stats', current_user_can( 'publish_posts' ) ); -
pvc_core_flush_lock_ttl
filterapply_filters( 'pvc_core_flush_lock_ttl', 300 ); -
apply_filters( 'pvc_dashboard_widget_default_period', 'this_month', 'post-views' ); -
apply_filters( 'pvc_email_summary_supported_types', [ 'weekly' ] ); -
pvc_get_views
filterapply_filters( 'pvc_get_views', $args['fields'] === 'date=>views' && ! empty( $range ) ? $range : 0 ); -
pvc_get_visits
filterapply_filters( 'pvc_get_visits', [ 'values' => $values, 'availability' => $availability ], $args ); -
pvc_import_after_provider
actiondo_action( 'pvc_import_after_provider', [ 'strategy' => $strategy, 'source' => 'statify', 'use_gmt' => $source['use_gmt'] ] ); -
pvc_import_message_stats
filterapply_filters( 'pvc_import_message_stats', $message_stats, [ 'mode' => $mode, 'source' => 'statify' ] ); -
pvc_ip_resolution_strategy
filterapply_filters( 'pvc_ip_resolution_strategy', 'remote_addr' ); -
pvc_run_check_post
filterapply_filters( 'pvc_run_check_post', true, $post_id ); -
pvc_shortcode_filter_hook
filterapply_filters( 'pvc_shortcode_filter_hook', Post_Views_Counter()->options['display']['position'] ); -
pvc_skip_single_query
filterapply_filters( 'pvc_skip_single_query', false, $data['content_id'], $type, $period, $data['increment'], 'post', $visits_delta ); -
do_action( "{$this->prefix}_configuration_updated", 'settings', $input ); -
apply_filters( "{$this->prefix}_settings_data", [] ); -
do_action( "{$this->prefix}_settings_form", $setting, $page_type, $url_page, $tab_key ); -
apply_filters( "{$this->prefix}_settings_page_class", [ $this->slug . '-settings', $tab_key . '-settings', $this->prefix . '-settings' ] ); -
apply_filters( "{$this->prefix}_settings_pages", [] ); -
apply_filters( "{$this->prefix}_settings_section_prefix", $this->prefix ); -
do_action( "{$this->prefix}_settings_sidebar", $setting, $page_type, $url_page, $tab_key ); -
add_option_{$name}
actiondo_action( "add_option_{$name}", $name, $value ); -
added_option
actiondo_action( 'added_option', $name, $value ); -
editable_roles
filterapply_filters( 'editable_roles', $wp_roles->roles ); -
excerpt_length
filterapply_filters( 'excerpt_length', 55 ); -
excerpt_more
filterapply_filters( 'excerpt_more', ' ' . '[…]' ); -
nonce_user_logged_out
filterapply_filters( 'nonce_user_logged_out', 0, 'wp_rest' ); -
apply_filters_deprecated( 'post_views_counter_settings_data', [ $settings ], '1.7.1', 'pvc_settings_data' ); -
apply_filters_deprecated( 'post_views_counter_settings_pages', [ $pages ], '1.7.1', 'pvc_settings_pages' ); -
pvc_active_caching_plugins
filterapply_filters( 'pvc_active_caching_plugins', $active_plugins ); -
apply_filters( 'pvc_admin_dashboard_script_data', $script_data ); -
pvc_admin_display_views
filterapply_filters( 'pvc_admin_display_views', true, $post->ID ); -
pvc_after_count_visit
actiondo_action( 'pvc_after_count_visit', $post_id, 'post' ); -
do_action( 'pvc_after_update_post_views_count', $post_id ); -
pvc_available_post_types
filterapply_filters( 'pvc_available_post_types', $post_types ); -
pvc_before_check_visit
actiondo_action( 'pvc_before_check_visit', $post_id, $user_id, $user_ip, 'post', $hook_content_data ); -
pvc_before_count_visit
actiondo_action( 'pvc_before_count_visit', $post_id, $user_id, $user_ip, 'post', $hook_content_data ); -
pvc_block_editor_data
filterapply_filters( 'pvc_block_editor_data', $script_data ); -
pvc_core_flush_batch_rows
filterapply_filters( 'pvc_core_flush_batch_rows', 100 ); -
pvc_count_conditions_met
filterapply_filters( 'pvc_count_conditions_met', true, $post_id, $user_id, $user_ip, 'post', $hook_content_data ); -
pvc_count_visit
filterapply_filters( 'pvc_count_visit', $count_visit, $post_id, $user_id, $user_ip, 'post', $hook_content_data ); -
pvc_count_visit_multi
filterapply_filters( 'pvc_count_visit_multi', [ $this, 'count_visit_multi' ] ); -
pvc_counter_html
filterapply_filters( 'pvc_counter_html', $html, [ 'views' ], $content_id, $content_type, $period ); -
pvc_counter_icon
filterapply_filters( 'pvc_counter_icon', $icon, $metric, $content_id, $content_type ); -
pvc_counter_icon_class
filterapply_filters( 'pvc_counter_icon_class', '', $metric, $content_id, $content_type ); -
pvc_crawlers_list
filterapply_filters( 'pvc_crawlers_list', $this->crawlers ); -
pvc_current_scheme_color
filterapply_filters( 'pvc_current_scheme_color', $color ); -
apply_filters( 'pvc_dashboard_post_most_viewed_data', $data, $args ); -
apply_filters( 'pvc_dashboard_post_most_viewed_query_args', [ 'post_type' => $post_types, 'posts_per_page' => 10, 'paged' => false, 'suppress_filters' => false, 'no_found_rows' => true, 'views_query' => [ 'year' => $year, 'month' => $month, 'hide_empty' => true ] ], $period ); -
apply_filters( 'pvc_dashboard_post_views_data', $data, $args ); -
apply_filters( 'pvc_dashboard_post_views_query_args', $core_query_args, $period ); -
apply_filters( 'pvc_dashboard_visit_series_sql', $query, $args, $buckets ); -
do_action( 'pvc_dashboard_widget_content_bottom', $item['id'] ); -
do_action( 'pvc_dashboard_widget_content_insights', $widget_id ); -
do_action( 'pvc_dashboard_widget_content_top', $item['id'] ); -
apply_filters( 'pvc_dashboard_widget_generate_months_formatted', [ 'prev' => '<a class="prev" href="#" data-date="' . ( $dates[0][2] . $dates[0][0] ) . '">‹ ' . $dates[0][1] . ' ' . $dates[0][2] . '</a>', 'current' => '<span class="current">' . $dates[1][1] . ' ' . $dates[1][2] . '</span>', 'next' => $next ], $timestamp, $item ); -
apply_filters( 'pvc_dashboard_widget_generate_months_html', $dates_formatted['prev'] . $dates_formatted['current'] . $dates_formatted['next'], $timestamp, $item ); -
pvc_dashboard_widget_items
filterapply_filters( 'pvc_dashboard_widget_items', [] ); -
apply_filters( 'pvc_delete_post_views_where_clause', $data, $post_id ); -
pvc_display_period_options
filterapply_filters( 'pvc_display_period_options', [ 'total' => __( 'Total Views', 'post-views-counter' ) ] ); -
apply_filters( 'pvc_display_toolbar_statistics', $pvc->options['display']['toolbar_statistics'] ); -
pvc_display_views_count
filterapply_filters( 'pvc_display_views_count', $display ); -
do_action( 'pvc_email_summary_before_query', $context, $this ); -
pvc_email_summary_cache_ttl
filterapply_filters( 'pvc_email_summary_cache_ttl', 300, $query_args, $period, $this ); -
pvc_email_summary_data
filterapply_filters( 'pvc_email_summary_data', $data, $period, $query_args, $this ); -
do_action( 'pvc_email_summary_delivery_finalized', $result, $settings, $period, $source, $is_test, $summary_type, $this ); -
pvc_email_summary_failed
actiondo_action( 'pvc_email_summary_failed', $result['data'], $result['recipient'], $result['headers'], $error, $summary_type ); -
pvc_email_summary_from_name
filterapply_filters( 'pvc_email_summary_from_name', $from_name, $data, $summary_type ); -
pvc_email_summary_html
filterapply_filters( 'pvc_email_summary_html', $html, $data, $summary_type ); -
apply_filters( 'pvc_email_summary_is_duplicate_period', $is_duplicate, $summary_type, $period, $settings, $this ); -
pvc_email_summary_lock_ttl
filterapply_filters( 'pvc_email_summary_lock_ttl', 15 * MINUTE_IN_SECONDS, $context, $this ); -
apply_filters( 'pvc_email_summary_normalized_data', $data, $summary_type, $this ); -
pvc_email_summary_plain_text
filterapply_filters( 'pvc_email_summary_plain_text', $plain_text, $data, $summary_type ); -
apply_filters( 'pvc_email_summary_pro_template_tags', [ '%%content_performance_summary%%', '%%monthly_report_summary%%', '%%top_gainers%%', '%%top_decliners%%', '%%rolling_average_summary%%', '%%projection_summary%%', '%%top_authors%%', '%%top_terms%%', '%%top_sources%%', '%%device_summary%%', '%%browser_summary%%', '%%language_summary%%', '%%suggested_actions%%' ] ); -
pvc_email_summary_query_args
filterapply_filters( 'pvc_email_summary_query_args', $query_args, $period, $settings, $this ); -
pvc_email_summary_recipient
filterapply_filters( 'pvc_email_summary_recipient', (string) $recipient, $period, $summary_type ); -
apply_filters( 'pvc_email_summary_report_label', $label, $cadence, $data, $summary_type ); -
apply_filters( 'pvc_email_summary_report_summary_html', $rendered, $data, $settings, $summary_type, $this ); -
apply_filters( 'pvc_email_summary_report_summary_text', $rendered, $data, $settings, $summary_type, $this ); -
apply_filters( 'pvc_email_summary_report_type_label', $label, $cadence, $data, $summary_type ); -
apply_filters( 'pvc_email_summary_schedule_enabled', $enabled, $settings ); -
apply_filters( 'pvc_email_summary_schedule_recurrence', 'post_views_counter_weekly', $settings ); -
apply_filters( 'pvc_email_summary_schedule_timestamp', $timestamp, $settings ); -
pvc_email_summary_sent
actiondo_action( 'pvc_email_summary_sent', $data, $context['recipient'], $result['headers'], $mail_result, $context['summary_type'] ); -
apply_filters( 'pvc_email_summary_should_flush_pending_counts', true, $context, $this ); -
apply_filters( 'pvc_email_summary_should_send', true, $data, $context['settings'], $context['summary_type'] ); -
pvc_email_summary_subject
filterapply_filters( 'pvc_email_summary_subject', $subject, $data, $summary_type ); -
apply_filters( 'pvc_email_summary_supports_additional_recipients', false, $settings, $this ); -
apply_filters( 'pvc_email_summary_template_tags', $tags, $data, $summary_type ); -
pvc_enqueue_styles
filterapply_filters( 'pvc_enqueue_styles', true ); -
pvc_flush_signals_cache
actiondo_action( 'pvc_flush_signals_cache' ); -
pvc_frontend_script_args
filterapply_filters( 'pvc_frontend_script_args', $args, 'standard' ); -
pvc_frontend_template_html
filterapply_filters( 'pvc_frontend_template_html', $html, $format, $content_id, $content_type, $period, $metrics ); -
pvc_get_counter_modes
filterapply_filters( 'pvc_get_counter_modes', $modes ); -
pvc_get_crawler_regex
filterapply_filters( 'pvc_get_crawler_regex', null, $list ); -
pvc_get_exclusions_regex
filterapply_filters( 'pvc_get_exclusions_regex', null, $this->exclusions ); -
pvc_get_most_viewed_posts
filterapply_filters( 'pvc_get_most_viewed_posts', get_posts( $args ), $args ); -
apply_filters( 'pvc_get_most_viewed_posts_args', $args ); -
apply_filters( 'pvc_get_post_views_period_where', $where, $period, $post_id, $filter_args ); -
pvc_get_views_args
filterapply_filters( 'pvc_get_views_args', $args ); -
pvc_get_views_per_visit
filterapply_filters( 'pvc_get_views_per_visit', (int) $row['views'] / $visits, $args, $availability ); -
pvc_get_views_period_where
filterapply_filters( 'pvc_get_views_period_where', $where, $args ); -
pvc_get_views_query_sql
filterapply_filters( 'pvc_get_views_query_sql', $query, $args, $views_query ); -
apply_filters( 'pvc_import_handle_non_post_row', false, $non_post_context, $this ); -
pvc_import_provider_supports
filterapply_filters( 'pvc_import_provider_supports', $supports, $slug ); -
pvc_import_providers
filterapply_filters( 'pvc_import_providers', [] ); -
pvc_integrations
filterapply_filters( 'pvc_integrations', self::get_base_integrations() ); -
pvc_is_plugin_active
filterapply_filters( 'pvc_is_plugin_active', false, $plugin ); -
pvc_is_posts_page
filterapply_filters( 'pvc_is_posts_page', $result, $object ); -
pvc_maybe_set_cookie
filterapply_filters( 'pvc_maybe_set_cookie', true, $id, 'post', $this->get_public_cookie_filter_data( $cookie, 'post' ) ); -
pvc_metric_dataset_style
filterapply_filters( 'pvc_metric_dataset_style', $style, $metric, $type, $context ); -
pvc_most_viewed_posts_args
filterapply_filters( 'pvc_most_viewed_posts_args', wp_parse_args( $args, $defaults ) ); -
pvc_most_viewed_posts_html
filterapply_filters( 'pvc_most_viewed_posts_html', $html, $args ); -
apply_filters( 'pvc_most_viewed_posts_item_after', $args['item_after'], $post ); -
apply_filters( 'pvc_most_viewed_posts_item_before', $args['item_before'], $post ); -
apply_filters( 'pvc_page_types_display_options', [ 'home' => __( 'Home', 'post-views-counter' ), 'archive' => __( 'Archives', 'post-views-counter' ), 'singular' => __( 'Single posts and pages', 'post-views-counter' ), 'search' => __( 'Search results', 'post-views-counter' ), ] ); -
pvc_period2date
filterapply_filters( 'pvc_period2date', $datetime, $period ); -
apply_filters( 'pvc_post_views_has_content_column', $has_content_column ); -
pvc_post_views_number_format
filterapply_filters( 'pvc_post_views_number_format', $display_value, $id ); -
pvc_post_views_shortcode
filterapply_filters( 'pvc_post_views_shortcode', $html, $atts ); -
apply_filters( 'pvc_post_views_shortcode_atts', $atts, $raw_args, $defaults ); -
apply_filters( 'pvc_reset_counts_where_clause', $where ); -
apply_filters( 'pvc_rest_api_count_post_check', true, $request, $post_id ); -
apply_filters( 'pvc_rest_api_get_post_views_args', [ 'id' => [ 'default' => 0 ], 'metric' => [], 'period' => [ 'default' => 'total' ], 'type' => [ 'default' => 'post' ] ] ); -
apply_filters( 'pvc_rest_api_get_post_views_check', $default, $request ); -
pvc_rest_api_view_post_args
filterapply_filters( 'pvc_rest_api_view_post_args', [ 'id' => [ 'default' => 0, 'sanitize_callback' => 'absint' ], 'storage_type' => [ 'default' => 'cookies' ], 'storage_data' => [ 'default' => '' ], 'storage_data_all' => [ 'default' => '' ], 'storage_capable' => [ 'sanitize_callback' => 'rest_sanitize_boolean' ] ] ); -
pvc_rest_api_view_post_check
filterapply_filters( 'pvc_rest_api_view_post_check', $default, $request ); -
pvc_settings_section_prefix
filterapply_filters( 'pvc_settings_section_prefix', 'pvc' ); -
pvc_storage_buckets
filterapply_filters( 'pvc_storage_buckets', [ 'post' => [] ] ); -
pvc_trusted_proxy_cidrs
filterapply_filters( 'pvc_trusted_proxy_cidrs', [] ); -
apply_filters( 'pvc_update_dashboard_user_options', $user_options, $update, $user_id ); -
pvc_update_post_views
filterapply_filters( 'pvc_update_post_views', $post_id ); -
pvc_update_post_views_count
filterapply_filters( 'pvc_update_post_views_count', $post_views, $post_id ); -
apply_filters( 'pvc_use_session_storage_payload_writes', $this->is_active_session_storage_payload_writes() ); -
pvc_views_increment_amount
filterapply_filters( 'pvc_views_increment_amount', 1, $post_id, 'post' ); -
widget_title
filterapply_filters( 'widget_title', $instance['title'], $instance, $this->id_base );
Generated from Post Views Counter'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: