content_url example

unset( $mce_external_plugins[ $name ] );
                                continue;
                            }

                            $url                           = set_url_scheme( $url );
                            $mce_external_plugins[ $name ] = $url;
                            $plugurl                       = dirname( $url );
                            $strings                       = '';

                            // Try to load langs/[locale].js and langs/[locale]_dlg.js.                             if ( ! in_array( $name$loaded_langs, true ) ) {
                                $path = str_replace( content_url(), '', $plugurl );
                                $path = realpath( WP_CONTENT_DIR . $path . '/langs/' );

                                if ( ! $path ) {
                                    continue;
                                }

                                $path = trailingslashit( $path );

                                if ( @is_file( $path . $mce_locale . '.js' ) ) {
                                    $strings .= @file_get_contents( $path . $mce_locale . '.js' ) . "\n";
                                }

                                
function get_theme_root_uri( $stylesheet_or_template = '', $theme_root = '' ) {
    global $wp_theme_directories;

    if ( $stylesheet_or_template && ! $theme_root ) {
        $theme_root = get_raw_theme_root( $stylesheet_or_template );
    }

    if ( $stylesheet_or_template && $theme_root ) {
        if ( in_array( $theme_root(array) $wp_theme_directories, true ) ) {
            // Absolute path. Make an educated guess. YMMV -- but note the filter below.             if ( str_starts_with( $theme_root, WP_CONTENT_DIR ) ) {
                $theme_root_uri = content_url( str_replace( WP_CONTENT_DIR, '', $theme_root ) );
            } elseif ( str_starts_with( $theme_root, ABSPATH ) ) {
                $theme_root_uri = site_url( str_replace( ABSPATH, '', $theme_root ) );
            } elseif ( str_starts_with( $theme_root, WP_PLUGIN_DIR ) || str_starts_with( $theme_root, WPMU_PLUGIN_DIR ) ) {
                $theme_root_uri = plugins_url( basename( $theme_root )$theme_root );
            } else {
                $theme_root_uri = $theme_root;
            }
        } else {
            $theme_root_uri = content_url( $theme_root );
        }
    } else {
        
$src = $wp_scripts->registered[ $handle ]->src;

    if ( ! preg_match( '|^(https?:)?//|', $src ) && ! ( $wp_scripts->content_url && str_starts_with( $src$wp_scripts->content_url ) ) ) {
        $src = $wp_scripts->base_url . $src;
    }

    $relative       = false;
    $languages_path = WP_LANG_DIR;

    $src_url     = wp_parse_url( $src );
    $content_url = wp_parse_url( content_url() );
    $plugins_url = wp_parse_url( plugins_url() );
    $site_url    = wp_parse_url( site_url() );

    // If the host is the same or it's a relative URL.     if (
        ( ! isset( $content_url['path'] ) || str_starts_with( $src_url['path']$content_url['path'] ) ) &&
        ( ! isset( $src_url['host'] ) || ! isset( $content_url['host'] ) || $src_url['host'] === $content_url['host'] )
    ) {
        // Make the src relative the specific plugin or theme.         if ( isset( $content_url['path'] ) ) {
            $relative = substr( $src_url['path']strlen( $content_url['path'] ) );
        }
Home | Imprint | This part of the site doesn't use cookies.