apply_filters( ‘wp_min_priority_img_pixels’, int $threshold )

Filters the minimum square-pixels threshold for an image to be eligible as the high-priority image.

Parameters

$thresholdint
Minimum square-pixels threshold. Default 50000.

Source

$wp_min_priority_img_pixels = apply_filters( 'wp_min_priority_img_pixels', 50000 );

Changelog

VersionDescription
6.3.0Introduced.

User Contributed Notes

  1. Skip to note 2 content

    Filter minimum square-pixels threshold value for small thumbnail images that appear in lists or grids, a minimum of 200×200 pixels might be suitable.

    /**
     * Filters to set the minimum square-pixels threshold for an image to be eligible as the high-priority image.
     *
     * @param int  $threshold Minimum threshold value.
     * @return int $threshold Modified threshold value.
     */
    function set_min_priority_img_pixels( $threshold ){
        // Set minimum threshold of 200x200 pixels for small thumbnail images.
        $threshold = 40000;
        return $threshold;
    }
    add_filter( 'wp_min_priority_img_pixels', 'set_min_priority_img_pixels' );

You must log in before being able to contribute a note or feedback.