Related Posts Thumbnails icon
Content & Editing

Related Posts Thumbnails hooks reference

  • By marynixie
  • v6.0.0
  • Updated

Related Posts Thumbnails 6.0.0 has 4 actions and 41 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 Related Posts Thumbnails fires an action
add_action( 'wp_wpb_sdk_after_uninstall', function( $slug ) {
	// Your code runs here.
}, 10, 1 );

// Change a value Related Posts Thumbnails is about to use
add_filter( 'relpoststh_show_all_categories', function( $category_list, $id, $taxonomy, $post_type ) {
	// Change $category_list here.
	return $category_list;
}, 10, 4 );

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

  • related-posts-thumbnails.php line 1177
    /**
     * Modifiy the category listings.
     */
    apply_filters( 'relpoststh_show_all_categories', $category_list, $id, $taxonomy, $post_type );
  • inc/rpt-assets.php line 201
    /**
     * Filter whether RPT frontend assets should load on this request.
     */
    apply_filters( 'rpt_should_load_frontend_assets', $should_load );
  • inc/class-rpt-settings-service.php line 105
    /**
     * Filter thumbnail size options shown in the settings UI.
     */
    apply_filters( 'rpt_thumbnailsizes', $thumbnail_sizes );
  • lib/wpb-sdk/includes/class-wpb-opt-manager.php line 924
    /**
     * Filter allowed SDK opt-out setting keys for AJAX toggles.
     */
    apply_filters( 'wpb_sdk_allowed_opt_out_settings', $allowed, $this->slug );
  • lib/wpb-sdk/includes/wpb-sdk-essential-functions.php line 1032
    /**
     * Filter allowed page slugs for post-opt-in redirect.
     */
    apply_filters( 'wpb_sdk_allowed_redirect_page_slugs', $allowed, $slug, $module );
  • lib/wpb-sdk/includes/class-wpb-sdk-logger.php line 1710
    /**
     * Filter telemetry API base URL for a product.
     */
    apply_filters( 'wpb_sdk_api_endpoint', $endpoint, $slug );
  • lib/wpb-sdk/includes/wpb-sdk-essential-functions.php line 356
    /**
     * Filter products that use a custom opt-in form instead of
     * wpb-sdk-optin-form.php.
     */
    apply_filters( 'wpb_sdk_custom_optin_slugs', $custom, $slug );
  • lib/wpb-sdk/includes/wpb-sdk-essential-functions.php line 638
    /**
     * Filter template variables passed to opt-in view.
     */
    apply_filters( 'wpb_sdk_optin_template_vars', $optin_vars, $slug, $module );
  • lib/wpb-sdk/includes/wpb-sdk-essential-functions.php line 1687
    /**
     * Filter whether visiting the opt-in page should redirect away.
     */
    apply_filters( 'wpb_sdk_should_redirect_from_optin_page', 'yes' === $decision, $slug, $decision );
  • lib/wpb-sdk/includes/class-wpb-sdk-logger.php line 854 · used in 3 places
    do_action( 'wp_wpb_sdk_after_uninstall', $slug );
  • lib/wpb-sdk/includes/wpb-sdk-essential-functions.php line 1073 · used in 3 places
    apply_filters( 'wpb_sdk_optin_redirect_url', $url, $slug, $optin, $redirect_override );
  • rpth_amp

    filter
    inc/class-rpt-related-renderer.php line 120 · used in 2 places
    apply_filters( 'rpth_amp', true );
  • lib/wpb-sdk/includes/class-wpb-sdk-logger.php line 192 · used in 2 places
    do_action( 'wpb_sdk_bootstrap_module', $slug );
  • inc/class-rpt-related-renderer.php line 885
    apply_filters( 'relpost_anchor_attr', $post_id, $rpt_anchor_attrs );
  • inc/class-rpt-related-renderer.php line 178
    apply_filters( 'relpoststh_title_tag', (string) rpt_settings()->rpt_get( 'general.title_tag', 'h2' ) );
  • inc/class-rpt-related-renderer.php line 73
    apply_filters( 'rpt_content_align', '' );
  • related-posts-thumbnails.php line 904
    apply_filters( 'rpt_content_prioirty', 10 );
  • inc/class-rpt-related-query.php line 290
    apply_filters( 'rpt_custom_relationship', array( get_post_type( $post_id ) ) );
  • inc/class-rpt-related-renderer.php line 246
    apply_filters( 'rpt_exclude_post', '' );
  • inc/class-rpt-related-renderer.php line 683
    apply_filters( 'rpt_prevent_img_size_check', false );
  • related-posts-thumbnails.php line 433
    apply_filters( 'rpt_prevent_on_edit', array('divi' => false,) );
  • inc/class-rpt-related-renderer.php line 592
    apply_filters( 'rpt_remove_empty_cfield', false );
  • rpt_top_text

    filter
    inc/class-rpt-related-renderer.php line 383
    apply_filters( 'rpt_top_text', rpt_settings_format_top_text_html( $top_text, $title_tag ) );
  • inc/class-rpt-related-renderer.php line 856
    apply_filters( 'rpt_use_background_thumbnail', false );
  • related-posts-thumbnails.php line 111
    do_action( 'rpt_wpb92640233_loaded' );
  • inc/class-rpt-related-renderer.php line 857
    apply_filters( 'rpt-single-background', 'data-bg="' . esc_url( $url ) . '" style="background: transparent no-repeat scroll 0% 0%; width: ' . esc_attr( $display_sizes['width'] ) . 'px; height: ' . esc_attr( $display_sizes['height'] ) . 'px; aspect-ratio: ' . esc_attr( $context['image_size'] ) . ';"' );
  • inc/class-rpt-related-renderer.php line 482
    apply_filters( 'rpth_after_content', '', $post );
  • widget_title

    filter
    inc/rpt-widget.php line 49
    apply_filters( 'widget_title', $instance['title'] ?? '' );
  • lib/wpb-sdk/includes/wpb-sdk-essential-functions.php line 579
    apply_filters( "wpb_sdk_{$slug}_optin_view_path", $path, $module );
  • lib/wpb-sdk/includes/wpb-sdk-essential-functions.php line 775
    apply_filters( 'wpb_sdk_module_config', $module );
  • lib/wpb-sdk/includes/wpb-sdk-essential-functions.php line 2166
    apply_filters( 'wpb_sdk_optin_admin_user_id', $admin_id, $slug );
  • lib/wpb-sdk/includes/wpb-sdk-essential-functions.php line 477
    apply_filters( "wpb_sdk_optin_logo_url_{$slug}", $logo_url, $module );
  • lib/wpb-sdk/includes/class-wpb-sdk-optin-verification.php line 231
    do_action( 'wpb_sdk_optin_verified', $current_user, $module );
  • lib/wpb-sdk/includes/wpb-sdk-essential-functions.php line 574
    apply_filters( 'wpb_sdk_optin_view_path', $path, $slug, $module );
  • lib/wpb-sdk/includes/wpb-sdk-essential-functions.php line 3291
    apply_filters( 'wpb_sdk_plugin_main_file', '', $slug );
  • lib/wpb-sdk/includes/wpb-sdk-essential-functions.php line 1630
    apply_filters( 'wpb_sdk_should_cleanup_on_uninstall', true, $slug );
  • lib/wpb-sdk/includes/wpb-sdk-essential-functions.php line 2703
    apply_filters( 'wpb_sdk_site_used_centralized_sdk_32', false, $slug, $module );
  • lib/wpb-sdk/includes/wpb-sdk-essential-functions.php line 1613
    apply_filters( 'wpb_sdk_uninstall_option_names', $options, $slug );
  • lib/wpb-sdk/includes/wpb-sdk-essential-functions.php line 1614
    apply_filters( 'wpb_sdk_uninstall_user_meta_keys', array_values( array_unique( array_filter( $user_meta ) ) ), $slug );

Generated from Related Posts Thumbnails'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: