Code Modernization: Use the ** operator instead of the pow() function in wp_convert_bytes_to_hr() for better performance.

Use the `MB_IN_BYTES` constant instead of the `pow()` function in `WP_Customize_Manager::_validate_header_video()` for better readability.

Props ayeshrajans, jrf.
Fixes #48083.

git-svn-id: https://develop.svn.wordpress.org/trunk@46225 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov
2019-09-21 12:48:29 +00:00
parent 4d6ca5bfe5
commit 4eb545aba0
2 changed files with 2 additions and 2 deletions

View File

@@ -5926,7 +5926,7 @@ final class WP_Customize_Manager {
$video = get_attached_file( absint( $value ) );
if ( $video ) {
$size = filesize( $video );
if ( 8 < $size / pow( 1024, 2 ) ) { // Check whether the size is larger than 8MB.
if ( $size > 8 * MB_IN_BYTES ) {
$validity->add(
'size_too_large',
__( '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.' )