Files
medicalalert-web-reloaded/wp/wp-content/plugins/imagify/inc/3rd-party/hosting/pressable.php
2024-09-25 09:25:31 -04:00

25 lines
650 B
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
defined( 'ABSPATH' ) || die( 'Cheatin uh?' );
if ( defined( 'IS_PRESSABLE' ) ) :
add_filter( 'imagify_site_root', 'imagify_pressable_site_root', IMAGIFY_INT_MAX );
/**
* Filter the path to the site's root.
*
* @since 1.9.4
* @author Grégory Viguier
*
* @param string|null $root_path Path to the site's root. Default is null.
* @return string
*/
function imagify_pressable_site_root( $root_path ) {
$upload_basedir = trim( wp_normalize_path( WP_CONTENT_DIR ), '/' );
$upload_basedir = explode( '/', $upload_basedir );
$upload_basedir = reset( $upload_basedir );
return '/' . $upload_basedir . '/';
}
endif;