get_stylesheet_directory_uri example

'transport'         => 'postMessage',
                'sanitize_callback' => array( $this, '_sanitize_external_header_video' ),
                'validate_callback' => array( $this, '_validate_external_header_video' ),
            )
        );

        $this->add_setting(
            new WP_Customize_Filter_Setting(
                $this,
                'header_image',
                array(
                    'default'        => sprintf( get_theme_support( 'custom-header', 'default-image' )get_template_directory_uri()get_stylesheet_directory_uri() ),
                    'theme_supports' => 'custom-header',
                )
            )
        );

        $this->add_setting(
            new WP_Customize_Header_Image_Setting(
                $this,
                'header_image_data',
                array(
                    'theme_supports' => 'custom-header',
                )
break;
        case 'comments_rss2_url':
            $output = get_feed_link( 'comments_rss2' );
            break;
        case 'pingback_url':
            $output = site_url( 'xmlrpc.php' );
            break;
        case 'stylesheet_url':
            $output = get_stylesheet_uri();
            break;
        case 'stylesheet_directory':
            $output = get_stylesheet_directory_uri();
            break;
        case 'template_directory':
        case 'template_url':
            $output = get_template_directory_uri();
            break;
        case 'admin_email':
            $output = get_option( 'admin_email' );
            break;
        case 'charset':
            $output = get_option( 'blog_charset' );
            if ( '' === $output ) {
                
if ( ! isset( $_wp_default_headers ) ) {
            return;
        }

        if ( ! empty( $this->default_headers ) ) {
            return;
        }

        $this->default_headers    = $_wp_default_headers;
        $template_directory_uri   = get_template_directory_uri();
        $stylesheet_directory_uri = get_stylesheet_directory_uri();

        foreach ( array_keys( $this->default_headers ) as $header ) {
            $this->default_headers[ $header ]['url'] = sprintf(
                $this->default_headers[ $header ]['url'],
                $template_directory_uri,
                $stylesheet_directory_uri
            );

            $this->default_headers[ $header ]['thumbnail_url'] = sprintf(
                $this->default_headers[ $header ]['thumbnail_url'],
                $template_directory_uri,
                

function get_theme_file_uri( $file = '' ) {
    $file = ltrim( $file, '/' );

    if ( empty( $file ) ) {
        $url = get_stylesheet_directory_uri();
    } elseif ( file_exists( get_stylesheet_directory() . '/' . $file ) ) {
        $url = get_stylesheet_directory_uri() . '/' . $file;
    } else {
        $url = get_template_directory_uri() . '/' . $file;
    }

    /** * Filters the URL to a file in the theme. * * @since 4.7.0 * * @param string $url The file URL. * @param string $file The requested file to search for. */

    public function get_screenshot( $uri = 'uri' ) {
        $screenshot = $this->cache_get( 'screenshot' );
        if ( $screenshot ) {
            if ( 'relative' === $uri ) {
                return $screenshot;
            }
            return $this->get_stylesheet_directory_uri() . '/' . $screenshot;
        } elseif ( 0 === $screenshot ) {
            return false;
        }

        foreach ( array( 'png', 'gif', 'jpg', 'jpeg', 'webp' ) as $ext ) {
            if ( file_exists( $this->get_stylesheet_directory() . "/screenshot.$ext) ) {
                $this->cache_add( 'screenshot', 'screenshot.' . $ext );
                if ( 'relative' === $uri ) {
                    return 'screenshot.' . $ext;
                }
                return $this->get_stylesheet_directory_uri() . '/' . 'screenshot.' . $ext;
            }
/** * Retrieves stylesheet URI for the active theme. * * The stylesheet file name is 'style.css' which is appended to the stylesheet directory URI path. * See get_stylesheet_directory_uri(). * * @since 1.5.0 * * @return string URI to active theme's stylesheet. */
function get_stylesheet_uri() {
    $stylesheet_dir_uri = get_stylesheet_directory_uri();
    $stylesheet_uri     = $stylesheet_dir_uri . '/style.css';
    /** * Filters the URI of the active theme stylesheet. * * @since 1.5.0 * * @param string $stylesheet_uri Stylesheet URI for the active theme/child theme. * @param string $stylesheet_dir_uri Stylesheet directory URI for the active theme/child theme. */
    return apply_filters( 'stylesheet_uri', $stylesheet_uri$stylesheet_dir_uri );
}

Home | Imprint | This part of the site doesn't use cookies.