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.8.1.1

apply_filters('aioseo_normalize_assets_host') is found 3 times:

  • /app/Common/Traits/Assets.php line 571
    567
    568
    569
    570
    571
    572
    573
    574
    575
    576
    577
    */
    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 581
    577
    578
    579
    580
    581
    582
    583
    584
    585
    586
    587
    $siteUrlEscaped = aioseo()->helpers->escapeRegex( $siteUrl );
    if ( preg_match( "/^$siteUrlEscaped/i", (string) $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 607
    603
    604
    605
    606
    607
    608
    609
    610
    611
    612
    613
        }
     
        $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.
     *