PATH:
home
/
bnathsfovv
/
elhiyad.info
/
wp-includes
<?php /** * Theme previews using the Site Editor for block themes. * * @package WordPress */ /** * Filters the blog option to return the path for the previewed theme. * * @since 6.3.0 * * @param string $current_stylesheet The current theme's stylesheet or template path. * @return string The previewed theme's stylesheet or template path. */ function wp_get_theme_preview_path( $current_stylesheet = null ) { if ( ! current_user_can( 'switch_themes' ) ) { return $current_stylesheet; } $preview_stylesheet = ! empty( $_GET['wp_theme_preview'] ) ? sanitize_text_field( wp_unslash( $_GET['wp_theme_preview'] ) ) : null; $wp_theme = wp_get_theme( $preview_stylesheet ); if ( ! is_wp_error( $wp_theme->errors() ) ) { if ( current_filter() === 'template' ) { $theme_path = $wp_theme->get_template(); } else { $theme_path = $wp_theme->get_stylesheet(); } return sanitize_text_field( $theme_path ); } return $current_stylesheet; } /** * Adds a middleware to `apiFetch` to set the theme for the preview. * This adds a `wp_theme_preview` URL parameter to API requests from the Site Editor, so they also respond as if the theme is set to the value of the parameter. * * @since 6.3.0 */ function wp_attach_theme_preview_middleware() { // Don't allow non-admins to preview themes. if ( ! current_user_can( 'switch_themes' ) ) { return; } wp_add_inline_script( 'wp-api-fetch', sprintf( 'wp.apiFetch.use( wp.apiFetch.createThemePreviewMiddleware( %s ) );', wp_json_encode( sanitize_text_field( wp_unslash( $_GET['wp_theme_preview'] ) ), JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ) ), 'after' ); } /** * Set a JavaScript constant for theme activation. * * Sets the JavaScript global WP_BLOCK_THEME_ACTIVATE_NONCE containing the nonce * required to activate a theme. For use within the site editor. * * @see https://github.com/WordPress/gutenberg/pull/41836 * * @since 6.3.0 * @access private */ function wp_block_theme_activate_nonce() { $nonce_handle = 'switch-theme_' . wp_get_theme_preview_path(); ?> <script> window.WP_BLOCK_THEME_ACTIVATE_NONCE = <?php echo wp_json_encode( wp_create_nonce( $nonce_handle ), JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ); ?>; </script> <?php } /** * Add filters and actions to enable Block Theme Previews in the Site Editor. * * The filters and actions should be added after `pluggable.php` is included as they may * trigger code that uses `current_user_can()` which requires functionality from `pluggable.php`. * * @since 6.3.2 */ function wp_initialize_theme_preview_hooks() { if ( ! empty( $_GET['wp_theme_preview'] ) ) { add_filter( 'stylesheet', 'wp_get_theme_preview_path' ); add_filter( 'template', 'wp_get_theme_preview_path' ); add_action( 'init', 'wp_attach_theme_preview_middleware' ); add_action( 'admin_head', 'wp_block_theme_activate_nonce' ); } }
[+]
..
[-] block-editor.php
[edit]
[+]
fonts
[-] fonts.php
[edit]
[+]
ID3
[-] class-wp-block-patterns-registry.php
[edit]
[+]
blocks
[-] class-wp-recovery-mode-email-service.php
[edit]
[-] class-requests.php
[edit]
[-] class-wp-http-ixr-client.php
[edit]
[-] functions.wp-styles.php
[edit]
[+]
Text
[-] theme-i18n.json
[edit]
[+]
build
[-] abilities-api.php
[edit]
[+]
Requests
[-] class-wp-text-diff-renderer-table.php
[edit]
[-] class-wp-list-util.php
[edit]
[+]
sodium_compat
[-] class-walker-nav-menu.php
[edit]
[-] class-wp-recovery-mode.php
[edit]
[+]
block-supports
[+]
rest-api
[-] view-transitions.php
[edit]
[+]
customize
[-] class-wp-block-metadata-registry.php
[edit]
[+]
theme-compat
[-] pluggable-deprecated.php
[edit]
[+]
php-compat
[-] ms-site.php
[edit]
[-] class-wp-http-cookie.php
[edit]
[-] bookmark.php
[edit]
[-] class-wp-text-diff-renderer-inline.php
[edit]
[-] class-wp-block-bindings-registry.php
[edit]
[-] class-wp-term-query.php
[edit]
[-] class-pop3.php
[edit]
[-] locale.php
[edit]
[-] class-wp-block-list.php
[edit]
[+]
IXR
[-] class-wp-http-requests-hooks.php
[edit]
[+]
images
[-] plugin.php
[edit]
[-] class-wp-block-template.php
[edit]
[+]
abilities-api
[+]
SimplePie
[+]
PHPMailer
[-] embed-template.php
[edit]
[-] class-wp-recovery-mode-cookie-service.php
[edit]
[-] cron.php
[edit]
[+]
css
[-] connectors.php
[edit]
[-] class-wp-block-type.php
[edit]
[+]
html-api
[+]
widgets
[-] class-wp-http-proxy.php
[edit]
[-] class-walker-category-dropdown.php
[edit]
[-] admin-bar.php
[edit]
[-] class-wpdb.php
[edit]
[-] feed-rss2-comments.php
[edit]
[+]
style-engine
[-] post-template.php
[edit]
[-] class-wp-http-requests-response.php
[edit]
[-] class-wp-http-encoding.php
[edit]
[+]
sitemaps
[-] class-wp-block-pattern-categories-registry.php
[edit]
[+]
block-bindings
[-] class-wp-speculation-rules.php
[edit]
[-] class-wp-recovery-mode-key-service.php
[edit]
[-] class-wp-icons-registry.php
[edit]
[+]
certificates
[-] media.php
[edit]
[-] class-wp-user-meta-session-tokens.php
[edit]
[-] canonical.php
[edit]
[-] class-wp-date-query.php
[edit]
[-] class-oembed.php
[edit]
[+]
interactivity-api
[-] class-wp-block-supports.php
[edit]
[+]
assets
[-] class-wp-theme-json.php
[edit]
[-] class-wp-http.php
[edit]
[-] class-wp-tax-query.php
[edit]
[-] class-wp-user.php
[edit]
[-] class.wp-scripts.php
[edit]
[-] class-wp-simplepie-sanitize-kses.php
[edit]
[-] class-wp-classic-to-block-menu-converter.php
[edit]
[-] class-wp-block-type-registry.php
[edit]
[-] class-wp-plugin-dependencies.php
[edit]
[-] block-bindings.php
[edit]
[+]
php-ai-client
[+]
ai-client
[-] ms-default-filters.php
[edit]
[-] class-http.php
[edit]
[-] block-i18n.json
[edit]
[+]
block-patterns
[-] ms-network.php
[edit]
[+]
js
[-] vars.php
[edit]
[-] theme-previews.php
[edit]
[+]
pomo
[-] template.php
[edit]
[-] class-wp-recovery-mode-link-service.php
[edit]
[-] class-wp-metadata-lazyloader.php
[edit]
[-] atomlib.php
[edit]
[-] default-filters.php
[edit]
[-] kses.php
[edit]
[-] class-wp-customize-setting.php
[edit]
[-] author-template.php
[edit]
[-] ai-client.php
[edit]
[-] class-wp-post-type.php
[edit]
[+]
l10n
[-] ms-files.php
[edit]
[-] class-wp-locale-switcher.php
[edit]
[-] global-styles-and-settings.php
[edit]
[-] blocks.php
[edit]