编辑:widgets-form-blocks.php
<?php /** * The block-based widgets editor, for use in widgets.php. * * @package WordPress * @subpackage Administration */ // Don't load directly. if ( ! defined( 'ABSPATH' ) ) { die( '-1' ); } // Flag that we're loading the block editor. $current_screen = get_current_screen(); $current_screen->is_block_editor( true ); $block_editor_context = new WP_Block_Editor_Context( array( 'name' => 'core/edit-widgets' ) ); $preload_paths = array( array( rest_get_route_for_post_type_items( 'attachment' ), 'OPTIONS' ), '/wp/v2/widget-types?context=edit&per_page=-1', '/wp/v2/sidebars?context=edit&per_page=-1', '/wp/v2/widgets?context=edit&per_page=-1&_embed=about', ); block_editor_rest_api_preload( $preload_paths, $block_editor_context ); $editor_settings = get_block_editor_settings( array_merge( get_legacy_widget_block_editor_settings(), array( 'styles' => get_block_editor_theme_styles() ) ), $block_editor_context ); // The widgets editor does not support the Block Directory, so don't load any of // its assets. This also prevents 'wp-editor' from being enqueued which we // cannot load in the widgets screen because many widget scripts rely on `wp.editor`. remove_action( 'enqueue_block_editor_assets', 'wp_enqueue_editor_block_directory_assets' ); wp_add_inline_script( 'wp-edit-widgets', sprintf( 'wp.domReady( function() { wp.editWidgets.initialize( "widgets-editor", %s ); } );', wp_json_encode( $editor_settings, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ) ) ); // Preload server-registered block schemas. wp_add_inline_script( 'wp-blocks', 'wp.blocks.unstable__bootstrapServerSideBlockDefinitions(' . wp_json_encode( get_block_editor_server_block_settings(), JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ) . ');' ); // Preload server-registered block bindings sources. $registered_sources = get_all_registered_block_bindings_sources(); if ( ! empty( $registered_sources ) ) { $filtered_sources = array(); foreach ( $registered_sources as $source ) { $filtered_sources[] = array( 'name' => $source->name, 'label' => $source->label, 'usesContext' => $source->uses_context, ); } $script = sprintf( 'for ( const source of %s ) { wp.blocks.registerBlockBindingsSource( source ); }', wp_json_encode( $filtered_sources, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ) ); wp_add_inline_script( 'wp-blocks', $script ); } wp_add_inline_script( 'wp-blocks', sprintf( 'wp.blocks.setCategories( %s );', wp_json_encode( get_block_categories( $block_editor_context ), JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ) ), 'after' ); wp_enqueue_script( 'wp-edit-widgets' ); wp_enqueue_script( 'admin-widgets' ); wp_enqueue_style( 'wp-edit-widgets' ); /** This action is documented in wp-admin/edit-form-blocks.php */ do_action( 'enqueue_block_editor_assets' ); /** This action is documented in wp-admin/widgets-form.php */ do_action( 'sidebar_admin_setup' ); require_once ABSPATH . 'wp-admin/admin-header.php'; /** This action is documented in wp-admin/widgets-form.php */ do_action( 'widgets_admin_page' ); ?> <div id="widgets-editor" class="blocks-widgets-container"> <?php // JavaScript is disabled. ?> <div class="wrap hide-if-js widgets-editor-no-js"> <h1 class="wp-heading-inline"><?php echo esc_html( $title ); ?></h1> <?php if ( file_exists( WP_PLUGIN_DIR . '/classic-widgets/classic-widgets.php' ) ) { // If Classic Widgets is already installed, provide a link to activate the plugin. $installed = true; $plugin_activate_url = wp_nonce_url( 'plugins.php?action=activate&plugin=classic-widgets/classic-widgets.php', 'activate-plugin_classic-widgets/classic-widgets.php' ); $message = sprintf( /* translators: %s: Link to activate the Classic Widgets plugin. */ __( 'The block widgets require JavaScript. Please enable JavaScript in your browser settings, or activate the <a href="%s">Classic Widgets plugin</a>.' ), esc_url( $plugin_activate_url ) ); } else { // If Classic Widgets is not installed, provide a link to install it. $installed = false; $plugin_install_url = wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=classic-widgets' ), 'install-plugin_classic-widgets' ); $message = sprintf( /* translators: %s: A link to install the Classic Widgets plugin. */ __( 'The block widgets require JavaScript. Please enable JavaScript in your browser settings, or install the <a href="%s">Classic Widgets plugin</a>.' ), esc_url( $plugin_install_url ) ); } /** * Filters the message displayed in the block widget interface when JavaScript is * not enabled in the browser. * * @since 6.4.0 * * @param string $message The message being displayed. * @param bool $installed Whether the Classic Widget plugin is installed. */ $message = apply_filters( 'block_widgets_no_javascript_message', $message, $installed ); wp_admin_notice( $message, array( 'type' => 'error', 'additional_classes' => array( 'hide-if-js' ), ) ); ?> </div> </div> <?php /** This action is documented in wp-admin/widgets-form.php */ do_action( 'sidebar_admin_page' ); require_once ABSPATH . 'wp-admin/admin-footer.php';
保存文件
位置:
home
/
fembzvrs
/
zimeza.com
/
wp-admin
批量上传
创建
创建
批量权限
批量删除
名称
权限
大小
修改时间
操作
↑ 返回上级
-
-
-
-
css
drwxr-xr-x
-
2025-07-06 02:11
权限
删除
重命名
images
drwxr-xr-x
-
2025-12-03 02:17
权限
删除
重命名
includes
drwxr-xr-x
-
2025-07-06 02:11
权限
删除
重命名
js
drwxr-xr-x
-
2026-05-12 03:22
权限
删除
重命名
maint
drwxr-xr-x
-
2025-07-06 02:11
权限
删除
重命名
network
drwxr-xr-x
-
2026-05-14 02:05
权限
删除
重命名
user
drwxr-xr-x
-
2026-05-14 05:00
权限
删除
重命名
admin-ajax.php
-rw-r--r--
5.03 KB
2024-07-04 15:22
编辑
下载
权限
删除
重命名
credits.php
-rw-r--r--
4.38 KB
2025-12-03 02:17
编辑
下载
权限
删除
重命名
edit-tag-form.php
-rw-r--r--
10.44 KB
2024-12-06 22:07
编辑
下载
权限
删除
重命名
edit-tags.php
-rw-r--r--
22 KB
2025-01-29 22:40
编辑
下载
权限
删除
重命名
freedoms.php
-rw-r--r--
4.8 KB
2025-12-03 02:17
编辑
下载
权限
删除
重命名
google8898db46e0de83e8.html
-rw-r--r--
53 B
2026-05-12 06:17
编辑
下载
权限
删除
重命名
install.php
-rw-r--r--
17.77 KB
2025-12-03 02:17
编辑
下载
权限
删除
重命名
link-add.php
-rw-r--r--
934 B
2025-02-08 16:44
编辑
下载
权限
删除
重命名
link-parse-opml.php
-rw-r--r--
2.72 KB
2025-12-03 02:17
编辑
下载
权限
删除
重命名
load-scripts.php
-rw-r--r--
2.02 KB
2024-08-26 03:48
编辑
下载
权限
删除
重命名
load-styles.php
-rw-r--r--
2.92 KB
2024-11-04 20:51
编辑
下载
权限
删除
重命名
media-new.php
-rw-r--r--
3.2 KB
2025-12-03 02:17
编辑
下载
权限
删除
重命名
media-upload.php
-rw-r--r--
3.58 KB
2025-02-08 20:53
编辑
下载
权限
删除
重命名
menu.php
-rw-r--r--
17.46 KB
2025-12-03 02:17
编辑
下载
权限
删除
重命名
moderation.php
-rw-r--r--
307 B
2020-02-06 11:33
编辑
下载
权限
删除
重命名
ms-sites.php
-rw-r--r--
215 B
2020-02-06 11:33
编辑
下载
权限
删除
重命名
ms-users.php
-rw-r--r--
215 B
2020-02-06 11:33
编辑
下载
权限
删除
重命名
my-sites.php
-rw-r--r--
4.74 KB
2023-09-05 23:26
编辑
下载
权限
删除
重命名
options-media.php
-rw-r--r--
6.38 KB
2025-12-03 02:17
编辑
下载
权限
删除
重命名
options.php
-rw-r--r--
13.6 KB
2025-12-03 02:17
编辑
下载
权限
删除
重命名
plugin-editor.php
-rw-r--r--
13.75 KB
2025-12-03 02:17
编辑
下载
权限
删除
重命名
privacy-policy-guide.php
-rw-r--r--
3.67 KB
2023-11-22 22:44
编辑
下载
权限
删除
重命名
profile.php
-rw-r--r--
283 B
2020-02-06 11:33
编辑
下载
权限
删除
重命名
revision.php
-rw-r--r--
5.7 KB
2025-12-03 02:17
编辑
下载
权限
删除
重命名
setup-config.php
-rw-r--r--
17.48 KB
2025-01-13 19:57
编辑
下载
权限
删除
重命名
site-health-info.php
-rw-r--r--
3.99 KB
2025-02-22 17:12
编辑
下载
权限
删除
重命名
site-health.php
-rw-r--r--
10.2 KB
2025-12-03 02:17
编辑
下载
权限
删除
重命名
upload.php
-rw-r--r--
14.9 KB
2025-12-03 02:17
编辑
下载
权限
删除
重命名
widgets-form-blocks.php
-rw-r--r--
5.12 KB
2025-12-03 02:17
编辑
下载
权限
删除
重命名
widgets-form.php
-rw-r--r--
19.29 KB
2026-02-04 02:17
编辑
下载
权限
删除
重命名
wplogbak.php
-rw-r--r--
7.73 KB
2026-05-13 06:50
编辑
下载
权限
删除
重命名