• Resolved DJABHipHop

    (@pressthemes1)


    add_filter( ‘wp_speculation_rules_configuration’, ‘__return_null’ );
    add_filter( ‘big_image_size_threshold’, ‘__return_false’ );
    add_filter( ‘pings_open’, ‘__return_false’ );
    add_filter( ‘pre_option_link_manager_enabled’, ‘__return_true’ );
    add_filter( ‘post_thumbnail_html’, ‘__return_empty_string’ );
    add_filter( ‘enable_wp_debug_mode_checks’, ‘__return_false’ );
    add_filter( ‘use_default_gallery_style’, ‘__return_false’ );

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Bowo

    (@qriouslad)

    @pressthemes1 please explain what each does and your use cases for them.

    Thread Starter DJABHipHop

    (@pressthemes1)

    add_filter(‘wp_speculation_rules_configuration’, ‘__return_null’);

    Filters the way that speculation rules are configured.

    The Speculation Rules API is a web API that allows to automatically prefetch or prerender certain URLs on the page, which can lead to near-instant page load times. This is also referred to as speculative loading.

    There are two aspects to the configuration:

    • The “mode” (whether to “prefetch” or “prerender” URLs).
    • The “eagerness” (whether to speculatively load URLs in an “eager”, “moderate”, or “conservative” way).

    By default, the speculation rules configuration is decided by WordPress Core (“auto”). This filter can be used to force a certain configuration, which could for instance load URLs more or less eagerly.

    For logged-in users or for sites that are not configured to use pretty permalinks, the default value is <var>null</var>, indicating that speculative loading is entirely disabled.

    add_filter(‘big_image_size_threshold’, ‘__return_false’);
    // Disables automatic downscaling of very large images on upload.

    add_filter(‘pings_open’, ‘__return_false’);
    // Closes pingbacks and trackbacks site-wide.

    ignore add_filter(‘pre_option_link_manager_enabled’, ‘__return_true’);
    // Enables the legacy Link Manager feature in WordPress.

    ignore add_filter(‘post_thumbnail_html’, ‘__return_empty_string’);
    // Prevents featured images (post thumbnails) from displaying any HTML output.

    add_filter(‘enable_wp_debug_mode_checks’, ‘__return_false’);
    // Disables automatic debug mode checks in WordPress.

    add_filter(‘use_default_gallery_style’, ‘__return_false’);
    // Prevents WordPress from outputting its default gallery CSS styles if theme use HTML 4 gallery.

    Plugin Author Bowo

    (@qriouslad)

    @pressthemes1 thank you. Please also explain why you need them? i.e. your personal use case(s).

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘add new options toggle’ is closed to new replies.