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/wp-inclu...
File: class-wp-customize-manager.php
$color = sanitize_hex_color_no_hash( $color );
[6000] Fix | Delete
if ( empty( $color ) ) {
[6001] Fix | Delete
$color = get_theme_support( 'custom-header', 'default-text-color' );
[6002] Fix | Delete
}
[6003] Fix | Delete
[6004] Fix | Delete
return $color;
[6005] Fix | Delete
}
[6006] Fix | Delete
[6007] Fix | Delete
/**
[6008] Fix | Delete
* Callback for validating a background setting value.
[6009] Fix | Delete
*
[6010] Fix | Delete
* @since 4.7.0
[6011] Fix | Delete
*
[6012] Fix | Delete
* @param string $value Repeat value.
[6013] Fix | Delete
* @param WP_Customize_Setting $setting Setting.
[6014] Fix | Delete
* @return string|WP_Error Background value or validation error.
[6015] Fix | Delete
*/
[6016] Fix | Delete
public function _sanitize_background_setting( $value, $setting ) {
[6017] Fix | Delete
if ( 'background_repeat' === $setting->id ) {
[6018] Fix | Delete
if ( ! in_array( $value, array( 'repeat-x', 'repeat-y', 'repeat', 'no-repeat' ), true ) ) {
[6019] Fix | Delete
return new WP_Error( 'invalid_value', __( 'Invalid value for background repeat.' ) );
[6020] Fix | Delete
}
[6021] Fix | Delete
} elseif ( 'background_attachment' === $setting->id ) {
[6022] Fix | Delete
if ( ! in_array( $value, array( 'fixed', 'scroll' ), true ) ) {
[6023] Fix | Delete
return new WP_Error( 'invalid_value', __( 'Invalid value for background attachment.' ) );
[6024] Fix | Delete
}
[6025] Fix | Delete
} elseif ( 'background_position_x' === $setting->id ) {
[6026] Fix | Delete
if ( ! in_array( $value, array( 'left', 'center', 'right' ), true ) ) {
[6027] Fix | Delete
return new WP_Error( 'invalid_value', __( 'Invalid value for background position X.' ) );
[6028] Fix | Delete
}
[6029] Fix | Delete
} elseif ( 'background_position_y' === $setting->id ) {
[6030] Fix | Delete
if ( ! in_array( $value, array( 'top', 'center', 'bottom' ), true ) ) {
[6031] Fix | Delete
return new WP_Error( 'invalid_value', __( 'Invalid value for background position Y.' ) );
[6032] Fix | Delete
}
[6033] Fix | Delete
} elseif ( 'background_size' === $setting->id ) {
[6034] Fix | Delete
if ( ! in_array( $value, array( 'auto', 'contain', 'cover' ), true ) ) {
[6035] Fix | Delete
return new WP_Error( 'invalid_value', __( 'Invalid value for background size.' ) );
[6036] Fix | Delete
}
[6037] Fix | Delete
} elseif ( 'background_preset' === $setting->id ) {
[6038] Fix | Delete
if ( ! in_array( $value, array( 'default', 'fill', 'fit', 'repeat', 'custom' ), true ) ) {
[6039] Fix | Delete
return new WP_Error( 'invalid_value', __( 'Invalid value for background size.' ) );
[6040] Fix | Delete
}
[6041] Fix | Delete
} elseif ( 'background_image' === $setting->id || 'background_image_thumb' === $setting->id ) {
[6042] Fix | Delete
$value = empty( $value ) ? '' : sanitize_url( $value );
[6043] Fix | Delete
} else {
[6044] Fix | Delete
return new WP_Error( 'unrecognized_setting', __( 'Unrecognized background setting.' ) );
[6045] Fix | Delete
}
[6046] Fix | Delete
return $value;
[6047] Fix | Delete
}
[6048] Fix | Delete
[6049] Fix | Delete
/**
[6050] Fix | Delete
* Exports header video settings to facilitate selective refresh.
[6051] Fix | Delete
*
[6052] Fix | Delete
* @since 4.7.0
[6053] Fix | Delete
*
[6054] Fix | Delete
* @param array $response Response.
[6055] Fix | Delete
* @param WP_Customize_Selective_Refresh $selective_refresh Selective refresh component.
[6056] Fix | Delete
* @param array $partials Array of partials.
[6057] Fix | Delete
* @return array
[6058] Fix | Delete
*/
[6059] Fix | Delete
public function export_header_video_settings( $response, $selective_refresh, $partials ) {
[6060] Fix | Delete
if ( isset( $partials['custom_header'] ) ) {
[6061] Fix | Delete
$response['custom_header_settings'] = get_header_video_settings();
[6062] Fix | Delete
}
[6063] Fix | Delete
[6064] Fix | Delete
return $response;
[6065] Fix | Delete
}
[6066] Fix | Delete
[6067] Fix | Delete
/**
[6068] Fix | Delete
* Callback for validating the header_video value.
[6069] Fix | Delete
*
[6070] Fix | Delete
* Ensures that the selected video is less than 8MB and provides an error message.
[6071] Fix | Delete
*
[6072] Fix | Delete
* @since 4.7.0
[6073] Fix | Delete
*
[6074] Fix | Delete
* @param WP_Error $validity
[6075] Fix | Delete
* @param mixed $value
[6076] Fix | Delete
* @return mixed
[6077] Fix | Delete
*/
[6078] Fix | Delete
public function _validate_header_video( $validity, $value ) {
[6079] Fix | Delete
$video = get_attached_file( absint( $value ) );
[6080] Fix | Delete
if ( $video ) {
[6081] Fix | Delete
$size = filesize( $video );
[6082] Fix | Delete
if ( $size > 8 * MB_IN_BYTES ) {
[6083] Fix | Delete
$validity->add(
[6084] Fix | Delete
'size_too_large',
[6085] Fix | Delete
__( 'This video file is too large to use as a header video. Try a shorter video or optimize the compression settings and re-upload a file that is less than 8MB. Or, upload your video to YouTube and link it with the option below.' )
[6086] Fix | Delete
);
[6087] Fix | Delete
}
[6088] Fix | Delete
if ( ! str_ends_with( $video, '.mp4' ) && ! str_ends_with( $video, '.mov' ) ) { // Check for .mp4 or .mov format, which (assuming h.264 encoding) are the only cross-browser-supported formats.
[6089] Fix | Delete
$validity->add(
[6090] Fix | Delete
'invalid_file_type',
[6091] Fix | Delete
sprintf(
[6092] Fix | Delete
/* translators: 1: .mp4, 2: .mov */
[6093] Fix | Delete
__( 'Only %1$s or %2$s files may be used for header video. Please convert your video file and try again, or, upload your video to YouTube and link it with the option below.' ),
[6094] Fix | Delete
'<code>.mp4</code>',
[6095] Fix | Delete
'<code>.mov</code>'
[6096] Fix | Delete
)
[6097] Fix | Delete
);
[6098] Fix | Delete
}
[6099] Fix | Delete
}
[6100] Fix | Delete
return $validity;
[6101] Fix | Delete
}
[6102] Fix | Delete
[6103] Fix | Delete
/**
[6104] Fix | Delete
* Callback for validating the external_header_video value.
[6105] Fix | Delete
*
[6106] Fix | Delete
* Ensures that the provided URL is supported.
[6107] Fix | Delete
*
[6108] Fix | Delete
* @since 4.7.0
[6109] Fix | Delete
*
[6110] Fix | Delete
* @param WP_Error $validity
[6111] Fix | Delete
* @param mixed $value
[6112] Fix | Delete
* @return mixed
[6113] Fix | Delete
*/
[6114] Fix | Delete
public function _validate_external_header_video( $validity, $value ) {
[6115] Fix | Delete
$video = sanitize_url( $value );
[6116] Fix | Delete
if ( $video ) {
[6117] Fix | Delete
if ( ! preg_match( '#^https?://(?:www\.)?(?:youtube\.com/watch|youtu\.be/)#', $video ) ) {
[6118] Fix | Delete
$validity->add( 'invalid_url', __( 'Please enter a valid YouTube URL.' ) );
[6119] Fix | Delete
}
[6120] Fix | Delete
}
[6121] Fix | Delete
return $validity;
[6122] Fix | Delete
}
[6123] Fix | Delete
[6124] Fix | Delete
/**
[6125] Fix | Delete
* Callback for sanitizing the external_header_video value.
[6126] Fix | Delete
*
[6127] Fix | Delete
* @since 4.7.1
[6128] Fix | Delete
*
[6129] Fix | Delete
* @param string $value URL.
[6130] Fix | Delete
* @return string Sanitized URL.
[6131] Fix | Delete
*/
[6132] Fix | Delete
public function _sanitize_external_header_video( $value ) {
[6133] Fix | Delete
return sanitize_url( trim( $value ) );
[6134] Fix | Delete
}
[6135] Fix | Delete
[6136] Fix | Delete
/**
[6137] Fix | Delete
* Callback for rendering the custom logo, used in the custom_logo partial.
[6138] Fix | Delete
*
[6139] Fix | Delete
* This method exists because the partial object and context data are passed
[6140] Fix | Delete
* into a partial's render_callback so we cannot use get_custom_logo() as
[6141] Fix | Delete
* the render_callback directly since it expects a blog ID as the first
[6142] Fix | Delete
* argument. When WP no longer supports PHP 5.3, this method can be removed
[6143] Fix | Delete
* in favor of an anonymous function.
[6144] Fix | Delete
*
[6145] Fix | Delete
* @see WP_Customize_Manager::register_controls()
[6146] Fix | Delete
*
[6147] Fix | Delete
* @since 4.5.0
[6148] Fix | Delete
*
[6149] Fix | Delete
* @return string Custom logo.
[6150] Fix | Delete
*/
[6151] Fix | Delete
public function _render_custom_logo_partial() {
[6152] Fix | Delete
return get_custom_logo();
[6153] Fix | Delete
}
[6154] Fix | Delete
}
[6155] Fix | Delete
[6156] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function