# imagify/1.10/inc/3rd-party/hosting/pressable.php

Imagify Image Optimization: Optimize Images | Compress &amp; Convert to WebP/AVIF, version 1.10. 25 lines.

- Page: https://pluginprobe.com/plugins/imagify/1.10/code/inc/3rd-party/hosting/pressable.php
- Raw: https://pluginprobe.com/plugins/imagify/1.10/raw/inc/3rd-party/hosting/pressable.php
- Modified: 2019-07-10T16:01:30+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/imagify/1.10/code/inc/3rd-party/hosting/pressable.php#L10-L20`.

```php
<?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;

```
