aioseo_normalize_assets_host

aioseo_normalize_assets_host

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter

See hook in core

Displaying hooks found in version: all-in-one-seo-pack.4.7.4.2

apply_filters('aioseo_normalize_assets_host') is found 3 times:

  • /app/Common/Traits/Assets.php line 541
    	 */
    	public function normalizeAssetsHost( $path ) {
    		static $paths = [];
    		if ( isset( $paths[ $path ] ) ) {
    			return apply_filters( 'aioseo_normalize_assets_host', $paths[ $path ] );
    		}
    
    		// We need to verify the domain on the $path attribute matches
    		// what's in site_url() for our assets or they won't load.
    		$siteUrl        = site_url();
    		$siteUrlEscaped = aioseo()->helpers->escapeRegex( $siteUrl );
    
  • /app/Common/Traits/Assets.php line 551
    		$siteUrlEscaped = aioseo()->helpers->escapeRegex( $siteUrl );
    		if ( preg_match( "/^$siteUrlEscaped/i", $path ) ) {
    			$paths[ $path ] = $path;
    
    			return apply_filters( 'aioseo_normalize_assets_host', $paths[ $path ] );
    		}
    
    		// We now know that the path doesn't contain the site_url().
    		$newPath        = $path;
    		$siteUrlParsed  = wp_parse_url( $siteUrl );
    		$host           = aioseo()->helpers->escapeRegex( str_replace( 'www.', '', $siteUrlParsed['host'] ) );
    
  • /app/Common/Traits/Assets.php line 577
    		}
    
    		$paths[ $path ] = $newPath;
    
    		return apply_filters( 'aioseo_normalize_assets_host', $paths[ $path ] );
    	}
    
    	/**
    	 * Get all the CSS files which a JS asset depends on.
    	 * This won't work properly unless you've run `npm run build` first.
    	 *