rebase from live enviornment

This commit is contained in:
Rachit Bhargava
2024-01-09 22:14:20 -05:00
parent ff0b49a046
commit 3a22fcaa4a
15968 changed files with 2344674 additions and 45234 deletions

View File

@@ -0,0 +1,30 @@
<?php
defined( 'ABSPATH' ) || die( 'Cheatin uh?' );
if ( defined( 'WPCOMSH_VERSION' ) ) :
add_filter( 'imagify_site_root', 'imagify_wpcom_site_root', IMAGIFY_INT_MAX );
/**
* Filter the path to the site's root.
*
* @since 1.8.4
* @author Grégory Viguier
*
* @param string|null $root_path Path to the site's root. Default is null.
* @return string|null
*/
function imagify_wpcom_site_root( $root_path ) {
$upload_basedir = imagify_get_filesystem()->get_upload_basedir( true );
if ( strpos( $upload_basedir, '/wp-content/' ) === false ) {
// Uh oooooh...
return $root_path;
}
$upload_basedir = explode( '/wp-content/', $upload_basedir );
$upload_basedir = reset( $upload_basedir );
return $upload_basedir . '/';
}
endif;