WP File Manager
Current Path:
/
www
/
htdocs
/
w0103d72
/
Kronauer-20191025
/
extranet
/
wp-includes
/
blocks
/
Name
Action
..
archives
archives.php
Edit
audio
avatar
avatar.php
Edit
block
block.php
Edit
blocks-json.php
Edit
button
button.php
Edit
buttons
calendar
calendar.php
Edit
categories
categories.php
Edit
code
column
columns
comment-author-name
comment-author-name.php
Edit
comment-content
comment-content.php
Edit
comment-date
comment-date.php
Edit
comment-edit-link
comment-edit-link.php
Edit
comment-reply-link
comment-reply-link.php
Edit
comment-template
comment-template.php
Edit
comments
comments-pagination
comments-pagination-next
comments-pagination-next.php
Edit
comments-pagination-numbers
comments-pagination-numbers.php
Edit
comments-pagination-previous
comments-pagination-previous.php
Edit
comments-pagination.php
Edit
comments-title
comments-title.php
Edit
comments.php
Edit
cover
cover.php
Edit
details
embed
file
file.php
Edit
footnotes
footnotes.php
Edit
freeform
gallery
gallery.php
Edit
group
heading
heading.php
Edit
home-link
home-link.php
Edit
html
image
image.php
Edit
index.php
Edit
latest-comments
latest-comments.php
Edit
latest-posts
latest-posts.php
Edit
legacy-widget
legacy-widget.php
Edit
list
list-item
list.php
Edit
loginout
loginout.php
Edit
media-text
media-text.php
Edit
missing
more
navigation
navigation-link
navigation-link.php
Edit
navigation-submenu
navigation-submenu.php
Edit
navigation.php
Edit
nextpage
page-list
page-list-item
page-list-item.php
Edit
page-list.php
Edit
paragraph
pattern
pattern.php
Edit
post-author
post-author-biography
post-author-biography.php
Edit
post-author-name
post-author-name.php
Edit
post-author.php
Edit
post-comments-form
post-comments-form.php
Edit
post-content
post-content.php
Edit
post-date
post-date.php
Edit
post-excerpt
post-excerpt.php
Edit
post-featured-image
post-featured-image.php
Edit
post-navigation-link
post-navigation-link.php
Edit
post-template
post-template.php
Edit
post-terms
post-terms.php
Edit
post-title
post-title.php
Edit
preformatted
pullquote
query
query-no-results
query-no-results.php
Edit
query-pagination
query-pagination-next
query-pagination-next.php
Edit
query-pagination-numbers
query-pagination-numbers.php
Edit
query-pagination-previous
query-pagination-previous.php
Edit
query-pagination.php
Edit
query-title
query-title.php
Edit
query.php
Edit
quote
read-more
read-more.php
Edit
require-dynamic-blocks.php
Edit
require-static-blocks.php
Edit
rss
rss.php
Edit
search
search.php
Edit
separator
shortcode
shortcode.php
Edit
site-logo
site-logo.php
Edit
site-tagline
site-tagline.php
Edit
site-title
site-title.php
Edit
social-link
social-link.php
Edit
social-links
spacer
table
tag-cloud
tag-cloud.php
Edit
template-part
template-part.php
Edit
term-description
term-description.php
Edit
text-columns
verse
video
widget-group
widget-group.php
Edit
Editing: legacy-widget.php
<?php /** * Server-side rendering of the `core/legacy-widget` block. * * @package WordPress */ /** * Renders the 'core/legacy-widget' block. * * @since 5.8.0 * * @global int $wp_widget_factory. * * @param array $attributes The block attributes. * * @return string Rendered block. */ function render_block_core_legacy_widget( $attributes ) { global $wp_widget_factory; if ( isset( $attributes['id'] ) ) { $sidebar_id = wp_find_widgets_sidebar( $attributes['id'] ); return wp_render_widget( $attributes['id'], $sidebar_id ); } if ( ! isset( $attributes['idBase'] ) ) { return ''; } $id_base = $attributes['idBase']; $widget_key = $wp_widget_factory->get_widget_key( $id_base ); $widget_object = $wp_widget_factory->get_widget_object( $id_base ); if ( ! $widget_key || ! $widget_object ) { return ''; } if ( isset( $attributes['instance']['encoded'], $attributes['instance']['hash'] ) ) { $serialized_instance = base64_decode( $attributes['instance']['encoded'] ); if ( ! hash_equals( wp_hash( $serialized_instance ), (string) $attributes['instance']['hash'] ) ) { return ''; } $instance = unserialize( $serialized_instance ); } else { $instance = array(); } $args = array( 'widget_id' => $widget_object->id, 'widget_name' => $widget_object->name, ); ob_start(); the_widget( $widget_key, $instance, $args ); return ob_get_clean(); } /** * Registers the 'core/legacy-widget' block. * * @since 5.8.0 */ function register_block_core_legacy_widget() { register_block_type_from_metadata( __DIR__ . '/legacy-widget', array( 'render_callback' => 'render_block_core_legacy_widget', ) ); } add_action( 'init', 'register_block_core_legacy_widget' ); /** * Intercepts any request with legacy-widget-preview in the query param and, if * set, renders a page containing a preview of the requested Legacy Widget * block. * * @since 5.8.0 */ function handle_legacy_widget_preview_iframe() { if ( empty( $_GET['legacy-widget-preview'] ) ) { return; } if ( ! current_user_can( 'edit_theme_options' ) ) { return; } define( 'IFRAME_REQUEST', true ); ?> <!doctype html> <html <?php language_attributes(); ?>> <head> <meta charset="<?php bloginfo( 'charset' ); ?>" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <link rel="profile" href="https://gmpg.org/xfn/11" /> <?php wp_head(); ?> <style> /* Reset theme styles */ html, body, #page, #content { padding: 0 !important; margin: 0 !important; } /* Hide root level text nodes */ body { font-size: 0 !important; } /* Hide non-widget elements */ body *:not(#page):not(#content):not(.widget):not(.widget *) { display: none !important; font-size: 0 !important; height: 0 !important; left: -9999px !important; max-height: 0 !important; max-width: 0 !important; opacity: 0 !important; pointer-events: none !important; position: absolute !important; top: -9999px !important; transform: translate(-9999px, -9999px) !important; visibility: hidden !important; z-index: -999 !important; } /* Restore widget font-size */ .widget { font-size: var(--global--font-size-base); } </style> </head> <body <?php body_class(); ?>> <div id="page" class="site"> <div id="content" class="site-content"> <?php $registry = WP_Block_Type_Registry::get_instance(); $block = $registry->get_registered( 'core/legacy-widget' ); echo $block->render( $_GET['legacy-widget-preview'] ); ?> </div><!-- #content --> </div><!-- #page --> <?php wp_footer(); ?> </body> </html> <?php exit; } // Use admin_init instead of init to ensure get_current_screen function is already available. // This isn't strictly required, but enables better compatibility with existing plugins. // See: https://github.com/WordPress/gutenberg/issues/32624. add_action( 'admin_init', 'handle_legacy_widget_preview_iframe', 20 );