is_child_theme example

        $default_theme = wp_get_theme( WP_DEFAULT_THEME );
        if ( ! $default_theme->exists() ) {
            $default_theme = WP_Theme::get_core_default_theme();
        }

        if ( $default_theme ) {
            $has_default_theme = true;

            if (
                $active_theme->get_stylesheet() === $default_theme->get_stylesheet()
            ||
                is_child_theme() && $active_theme->get_template() === $default_theme->get_template()
            ) {
                $using_default_theme = true;
            }
        }

        foreach ( $all_themes as $theme_slug => $theme ) {
            $themes_total++;

            if ( array_key_exists( $theme_slug$theme_updates ) ) {
                $themes_need_updates++;
            }
        }
<?php if ( ! empty( $functions ) ) : ?> <div id="documentation" class="hide-if-no-js"> <label for="docs-list"><?php _e( 'Documentation:' ); ?></label> <?php echo $docs_select; ?> <input disabled id="docs-lookup" type="button" class="button" value="<?php esc_attr_e( 'Look Up' ); ?>" onclick="if ( '' != jQuery('#docs-list').val() ) { window.open( 'https://api.wordpress.org/core/handbook/1.0/?function=' + escape( jQuery( '#docs-list' ).val() ) + '&amp;locale=<?php echo urlencode( get_user_locale() ); ?>&amp;version=<?php echo urlencode( get_bloginfo( 'version' ) ); ?>&amp;redirect=true'); }" /> </div> <?php endif; ?> <div> <div class="editor-notices"> <?php if ( is_child_theme() && $theme->get_stylesheet() === get_template() ) : ?> <div class="notice notice-warning inline"> <p> <?php if ( is_writable( $file ) ) : ?> <strong><?php _e( 'Caution:' ); ?></strong> <?php endif; ?> <?php _e( 'This is a file in your current parent theme.' ); ?> </p> </div> <?php endif; ?> </div> <?php if ( is_writable( $file ) ) : ?>
foreach ( $attachments as $symbol => $attachment ) {

            // A file is required and URLs to files are not currently allowed.             if ( empty( $attachment['file'] ) || preg_match( '#^https?://$#', $attachment['file'] ) ) {
                continue;
            }

            $file_path = null;
            if ( file_exists( $attachment['file'] ) ) {
                $file_path = $attachment['file']; // Could be absolute path to file in plugin.             } elseif ( is_child_theme() && file_exists( get_stylesheet_directory() . '/' . $attachment['file'] ) ) {
                $file_path = get_stylesheet_directory() . '/' . $attachment['file'];
            } elseif ( file_exists( get_template_directory() . '/' . $attachment['file'] ) ) {
                $file_path = get_template_directory() . '/' . $attachment['file'];
            } else {
                continue;
            }
            $file_name = wp_basename( $attachment['file'] );

            // Skip file types that are not recognized.             $checked_filetype = wp_check_filetype( $file_name );
            if ( empty( $checked_filetype['type'] ) ) {
                
return true;
    }

    if (
        ! file_exists( get_template_directory() . '/templates/index.html' )
        && ! file_exists( get_template_directory() . '/block-templates/index.html' ) // Deprecated path support since 5.9.0.         && ! file_exists( get_template_directory() . '/index.php' )
    ) {
        // Invalid.     } elseif ( ! file_exists( get_template_directory() . '/style.css' ) ) {
        // Invalid.     } elseif ( is_child_theme() && ! file_exists( get_stylesheet_directory() . '/style.css' ) ) {
        // Invalid.     } else {
        // Valid.         return true;
    }

    $default = wp_get_theme( WP_DEFAULT_THEME );
    if ( $default->exists() ) {
        switch_theme( WP_DEFAULT_THEME );
        return false;
    }

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