Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/clone/wp-inclu...
File: media.php
*
[6000] Fix | Delete
* @param array $loading_attrs Array of the loading optimization attributes for the element.
[6001] Fix | Delete
* @param string $tag_name The tag name.
[6002] Fix | Delete
* @param array $attr Array of the attributes for the element.
[6003] Fix | Delete
* @return array Updated loading optimization attributes for the element.
[6004] Fix | Delete
*/
[6005] Fix | Delete
function wp_maybe_add_fetchpriority_high_attr( $loading_attrs, $tag_name, $attr ) {
[6006] Fix | Delete
// For now, adding `fetchpriority="high"` is only supported for images.
[6007] Fix | Delete
if ( 'img' !== $tag_name ) {
[6008] Fix | Delete
return $loading_attrs;
[6009] Fix | Delete
}
[6010] Fix | Delete
[6011] Fix | Delete
if ( isset( $attr['fetchpriority'] ) ) {
[6012] Fix | Delete
/*
[6013] Fix | Delete
* While any `fetchpriority` value could be set in `$loading_attrs`,
[6014] Fix | Delete
* for consistency we only do it for `fetchpriority="high"` since that
[6015] Fix | Delete
* is the only possible value that WordPress core would apply on its
[6016] Fix | Delete
* own.
[6017] Fix | Delete
*/
[6018] Fix | Delete
if ( 'high' === $attr['fetchpriority'] ) {
[6019] Fix | Delete
$loading_attrs['fetchpriority'] = 'high';
[6020] Fix | Delete
wp_high_priority_element_flag( false );
[6021] Fix | Delete
}
[6022] Fix | Delete
[6023] Fix | Delete
return $loading_attrs;
[6024] Fix | Delete
}
[6025] Fix | Delete
[6026] Fix | Delete
// Lazy-loading and `fetchpriority="high"` are mutually exclusive.
[6027] Fix | Delete
if ( isset( $loading_attrs['loading'] ) && 'lazy' === $loading_attrs['loading'] ) {
[6028] Fix | Delete
return $loading_attrs;
[6029] Fix | Delete
}
[6030] Fix | Delete
[6031] Fix | Delete
if ( ! wp_high_priority_element_flag() ) {
[6032] Fix | Delete
return $loading_attrs;
[6033] Fix | Delete
}
[6034] Fix | Delete
[6035] Fix | Delete
/**
[6036] Fix | Delete
* Filters the minimum square-pixels threshold for an image to be eligible as the high-priority image.
[6037] Fix | Delete
*
[6038] Fix | Delete
* @since 6.3.0
[6039] Fix | Delete
*
[6040] Fix | Delete
* @param int $threshold Minimum square-pixels threshold. Default 50000.
[6041] Fix | Delete
*/
[6042] Fix | Delete
$wp_min_priority_img_pixels = apply_filters( 'wp_min_priority_img_pixels', 50000 );
[6043] Fix | Delete
[6044] Fix | Delete
if ( $wp_min_priority_img_pixels <= $attr['width'] * $attr['height'] ) {
[6045] Fix | Delete
$loading_attrs['fetchpriority'] = 'high';
[6046] Fix | Delete
wp_high_priority_element_flag( false );
[6047] Fix | Delete
}
[6048] Fix | Delete
[6049] Fix | Delete
return $loading_attrs;
[6050] Fix | Delete
}
[6051] Fix | Delete
[6052] Fix | Delete
/**
[6053] Fix | Delete
* Accesses a flag that indicates if an element is a possible candidate for `fetchpriority='high'`.
[6054] Fix | Delete
*
[6055] Fix | Delete
* @since 6.3.0
[6056] Fix | Delete
* @access private
[6057] Fix | Delete
*
[6058] Fix | Delete
* @param bool $value Optional. Used to change the static variable. Default null.
[6059] Fix | Delete
* @return bool Returns true if high-priority element was marked already, otherwise false.
[6060] Fix | Delete
*/
[6061] Fix | Delete
function wp_high_priority_element_flag( $value = null ) {
[6062] Fix | Delete
static $high_priority_element = true;
[6063] Fix | Delete
[6064] Fix | Delete
if ( is_bool( $value ) ) {
[6065] Fix | Delete
$high_priority_element = $value;
[6066] Fix | Delete
}
[6067] Fix | Delete
[6068] Fix | Delete
return $high_priority_element;
[6069] Fix | Delete
}
[6070] Fix | Delete
[6071] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function