get_raw_theme_root example

$args     = wp_parse_args( $args$defaults );

    $theme_directories = search_theme_directories();

    if ( is_array( $wp_theme_directories ) && count( $wp_theme_directories ) > 1 ) {
        /* * Make sure the active theme wins out, in case search_theme_directories() picks the wrong * one in the case of a conflict. (Normally, last registered theme root wins.) */
        $current_theme = get_stylesheet();
        if ( isset( $theme_directories[ $current_theme ] ) ) {
            $root_of_current_theme = get_raw_theme_root( $current_theme );
            if ( ! in_array( $root_of_current_theme$wp_theme_directories, true ) ) {
                $root_of_current_theme = WP_CONTENT_DIR . $root_of_current_theme;
            }
            $theme_directories[ $current_theme ]['theme_root'] = $root_of_current_theme;
        }
    }

    if ( empty( $theme_directories ) ) {
        return array();
    }

    
return $this->theme()->get_stylesheet();
    }

    /** * Retrieves the template root of the previewed theme. * * @since 3.4.0 * * @return string Theme root. */
    public function get_template_root() {
        return get_raw_theme_root( $this->get_template(), true );
    }

    /** * Retrieves the stylesheet root of the previewed theme. * * @since 3.4.0 * * @return string Theme root. */
    public function get_stylesheet_root() {
        return get_raw_theme_root( $this->get_stylesheet(), true );
    }
Home | Imprint | This part of the site doesn't use cookies.