mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-10-07 08:07:16 +00:00
Update @wordpress packages
Update packages to include these bug fixes from Gutenberg: - Update Pattern block category and add documentation - Fix non existent menu handling in nav block - Make Reusable blocks available in the Site Editor - Add caching to WP_Theme_JSON_Resolver_Gutenberg::get_user_data_from_custom_post_type() - theme.json: add appearanceTools flag to opt-in into appearance UI controls - Update the block theme folders to templates and parts - Remove reference to gutenberg_, swap with wp_ - Use table layout in templates list screen - Update featured image placeholder graphic. - [Inserter]: Adjust order of theme blocks and reorder inserter items - Implement suitable fallback for Nav block on front end of site when no menu selected - Toggle Group Control: add tooltip - Use first non-empty Nav post as primary fallback for Nav block - Change .nvmrc and documentation for Node.js version (LTS to 14.18.1) - Update: Migrate global styles user database data on the rest endpoint - Update global styles public API - Update: Rename user preset origin to custom - Try always generating navigation post title - Show all templates and template parts on the site editor list screens - Highlight "Site" in the navigation panel - Fix template part slug generation when creating through the block placeholder - [Block Library - Post Title]: Fix render error when setting Page to homepage - Add 'Clear customizations' button to template list page - Gallery v1: Allow clicks within replace media placeholder state - Site Editor: Set the <title> on the list page to be same as the CPT name - Gallery: Fix stuck image size options loader - Cover: Fix undo trap - Add success and error snackbars to the templates list page - Fix: theme colors cannot override defaults - Fix: Color palette is not being stored - Add elements support to the typography panel in global styles - Make links plural in global styles - Add: Gradient palette editor - Update some small style regressions in the template list - Add: Transparency support on global styles colors - Fix: apply by slug on all origins - Render empty Nav block if no fallback block can be utilised - Allow filtering of Nav block fallback - Fix Nav block fallback DB query to match on full block grammar start tag - Remove unstable max pages attribute from Nav block - DateTimePicker: set PM hours correctly - Update delete template button - Site Editor: Template list add rename action - Fix Nav block editing wrong entity on creation of new Menu - [REST] Restore the missing double slash in the ID received by /templates - Add icons to navigation sidebar items - Update function names for the public global styles API functions - Templates Controller: Add missing 'is_custom' prop - Rename gutenberg_ to wp_ for some functions that land in WordPress 5.9 - [Block Library - Template Part]:Remove support for conversion to Reusable block - Global Styles: Call "palettes" and not "color palettes" on panel label - Add button text when no colors found - Update: Global Styes: Count all color palette origins on the palette counter - Rename navigationMenuId to ref - Offset the parent iframe when computing Popover position - Fix: Failing PHPUnit test - Show theme, plugin or author in Added By column with appropriate icon or avatar - Add origin and author to template rest api See #54487. Props talldanwp, mamaduka, oandregal. git-svn-id: https://develop.svn.wordpress.org/trunk@52275 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -85,7 +85,7 @@ function block_core_calendar_has_published_posts() {
|
||||
}
|
||||
|
||||
// On single sites we try our own cached option first.
|
||||
$has_published_posts = get_option( 'gutenberg_calendar_block_has_published_posts', null );
|
||||
$has_published_posts = get_option( 'wp_calendar_block_has_published_posts', null );
|
||||
if ( null !== $has_published_posts ) {
|
||||
return (bool) $has_published_posts;
|
||||
}
|
||||
@@ -103,7 +103,7 @@ function block_core_calendar_has_published_posts() {
|
||||
function block_core_calendar_update_has_published_posts() {
|
||||
global $wpdb;
|
||||
$has_published_posts = (bool) $wpdb->get_var( "SELECT 1 as test FROM {$wpdb->posts} WHERE post_type = 'post' AND post_status = 'publish' LIMIT 1" );
|
||||
update_option( 'gutenberg_calendar_block_has_published_posts', $has_published_posts );
|
||||
update_option( 'wp_calendar_block_has_published_posts', $has_published_posts );
|
||||
return $has_published_posts;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,8 @@
|
||||
* Build an array with CSS classes and inline styles defining the colors
|
||||
* which will be applied to the navigation markup in the front-end.
|
||||
*
|
||||
* @param array $attributes Navigation block attributes.
|
||||
* @param array $attributes Navigation block attributes.
|
||||
*
|
||||
* @return array Colors CSS classes and inline styles.
|
||||
*/
|
||||
function block_core_navigation_build_css_colors( $attributes ) {
|
||||
@@ -99,7 +100,8 @@ function block_core_navigation_build_css_colors( $attributes ) {
|
||||
* Build an array with CSS classes and inline styles defining the font sizes
|
||||
* which will be applied to the navigation markup in the front-end.
|
||||
*
|
||||
* @param array $attributes Navigation block attributes.
|
||||
* @param array $attributes Navigation block attributes.
|
||||
*
|
||||
* @return array Font size CSS classes and inline styles.
|
||||
*/
|
||||
function block_core_navigation_build_css_font_sizes( $attributes ) {
|
||||
@@ -132,6 +134,100 @@ function block_core_navigation_render_submenu_icon() {
|
||||
return '<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12" fill="none" role="img" aria-hidden="true" focusable="false"><path d="M1.50002 4L6.00002 8L10.5 4" stroke-width="1.5"></path></svg>';
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Finds the first non-empty `wp_navigation` Post.
|
||||
*
|
||||
* @return WP_Post|null the first non-empty Navigation or null.
|
||||
*/
|
||||
function block_core_navigation_get_first_non_empty_navigation() {
|
||||
// Order and orderby args set to mirror those in `wp_get_nav_menus`
|
||||
// see:
|
||||
// - https://github.com/WordPress/wordpress-develop/blob/ba943e113d3b31b121f77a2d30aebe14b047c69d/src/wp-includes/nav-menu.php#L613-L619.
|
||||
// - https://developer.wordpress.org/reference/classes/wp_query/#order-orderby-parameters.
|
||||
$navigation_posts = get_posts(
|
||||
array(
|
||||
'post_type' => 'wp_navigation',
|
||||
'order' => 'ASC',
|
||||
'orderby' => 'name',
|
||||
'posts_per_page' => 1, // only the first post.
|
||||
's' => '<!-- wp:', // look for block indicators to ensure we only include non-empty Navigations.
|
||||
)
|
||||
);
|
||||
return count( $navigation_posts ) ? $navigation_posts[0] : null;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter out empty "null" blocks from the block list.
|
||||
* 'parse_blocks' includes a null block with '\n\n' as the content when
|
||||
* it encounters whitespace. This is not a bug but rather how the parser
|
||||
* is designed.
|
||||
*
|
||||
* @param array $parsed_blocks the parsed blocks to be normalized.
|
||||
* @return array the normalized parsed blocks.
|
||||
*/
|
||||
function block_core_navigation_filter_out_empty_blocks( $parsed_blocks ) {
|
||||
$filtered = array_filter(
|
||||
$parsed_blocks,
|
||||
function( $block ) {
|
||||
return isset( $block['blockName'] );
|
||||
}
|
||||
);
|
||||
|
||||
// Reset keys.
|
||||
return array_values( $filtered );
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the appropriate fallback to be used on the front of the
|
||||
* site when there is no menu assigned to the Nav block.
|
||||
*
|
||||
* This aims to mirror how the fallback mechanic for wp_nav_menu works.
|
||||
* See https://developer.wordpress.org/reference/functions/wp_nav_menu/#more-information.
|
||||
*
|
||||
* @return array the array of blocks to be used as a fallback.
|
||||
*/
|
||||
function block_core_navigation_get_fallback_blocks() {
|
||||
$page_list_fallback = array(
|
||||
array(
|
||||
'blockName' => 'core/page-list',
|
||||
'attrs' => array(
|
||||
'__unstableMaxPages' => 4,
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
$registry = WP_Block_Type_Registry::get_instance();
|
||||
|
||||
// If `core/page-list` is not registered then return empty blocks.
|
||||
$fallback_blocks = $registry->is_registered( 'core/page-list' ) ? $page_list_fallback : array();
|
||||
|
||||
// Default to a list of Pages.
|
||||
|
||||
$navigation_post = block_core_navigation_get_first_non_empty_navigation();
|
||||
|
||||
// Prefer using the first non-empty Navigation as fallback if available.
|
||||
if ( $navigation_post ) {
|
||||
$maybe_fallback = block_core_navigation_filter_out_empty_blocks( parse_blocks( $navigation_post->post_content ) );
|
||||
|
||||
// Normalizing blocks may result in an empty array of blocks if they were all `null` blocks.
|
||||
// In this case default to the (Page List) fallback.
|
||||
$fallback_blocks = ! empty( $maybe_fallback ) ? $maybe_fallback : $fallback_blocks;
|
||||
}
|
||||
|
||||
/**
|
||||
* Filters the fallback experience for the Navigation block.
|
||||
*
|
||||
* Returning a falsey value will opt out of the fallback and cause the block not to render.
|
||||
* To customise the blocks provided return an array of blocks - these should be valid
|
||||
* children of the `core/navigation` block.
|
||||
*
|
||||
* @param array[] default fallback blocks provided by the default block mechanic.
|
||||
*/
|
||||
return apply_filters( 'block_core_navigation_render_fallback', $fallback_blocks );
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders the `core/navigation` block on server.
|
||||
*
|
||||
@@ -142,6 +238,11 @@ function block_core_navigation_render_submenu_icon() {
|
||||
* @return string Returns the post content with the legacy widget added.
|
||||
*/
|
||||
function render_block_core_navigation( $attributes, $content, $block ) {
|
||||
|
||||
// Flag used to indicate whether the rendered output is considered to be
|
||||
// a fallback (i.e. the block has no menu associated with it).
|
||||
$is_fallback = false;
|
||||
|
||||
/**
|
||||
* Deprecated:
|
||||
* The rgbTextColor and rgbBackgroundColor attributes
|
||||
@@ -187,13 +288,17 @@ function render_block_core_navigation( $attributes, $content, $block ) {
|
||||
$area = $block->context['navigationArea'];
|
||||
$mapping = get_option( 'wp_navigation_areas', array() );
|
||||
if ( ! empty( $mapping[ $area ] ) ) {
|
||||
$attributes['navigationMenuId'] = $mapping[ $area ];
|
||||
$attributes['ref'] = $mapping[ $area ];
|
||||
}
|
||||
}
|
||||
|
||||
// Load inner blocks from the navigation post.
|
||||
// Ensure that blocks saved with the legacy ref attribute name (navigationMenuId) continue to render.
|
||||
if ( array_key_exists( 'navigationMenuId', $attributes ) ) {
|
||||
$navigation_post = get_post( $attributes['navigationMenuId'] );
|
||||
$attributes['ref'] = $attributes['navigationMenuId'];
|
||||
}
|
||||
// Load inner blocks from the navigation post.
|
||||
if ( array_key_exists( 'ref', $attributes ) ) {
|
||||
$navigation_post = get_post( $attributes['ref'] );
|
||||
if ( ! isset( $navigation_post ) ) {
|
||||
return '';
|
||||
}
|
||||
@@ -202,20 +307,26 @@ function render_block_core_navigation( $attributes, $content, $block ) {
|
||||
|
||||
// 'parse_blocks' includes a null block with '\n\n' as the content when
|
||||
// it encounters whitespace. This code strips it.
|
||||
$compacted_blocks = array_filter(
|
||||
$parsed_blocks,
|
||||
function( $block ) {
|
||||
return isset( $block['blockName'] );
|
||||
}
|
||||
);
|
||||
$compacted_blocks = block_core_navigation_filter_out_empty_blocks( $parsed_blocks );
|
||||
|
||||
// TODO - this uses the full navigation block attributes for the
|
||||
// context which could be refined.
|
||||
$inner_blocks = new WP_Block_List( $compacted_blocks, $attributes );
|
||||
}
|
||||
|
||||
// If there are no inner blocks then fallback to rendering an appropriate fallback.
|
||||
if ( empty( $inner_blocks ) ) {
|
||||
return '';
|
||||
$is_fallback = true; // indicate we are rendering the fallback.
|
||||
|
||||
$fallback_blocks = block_core_navigation_get_fallback_blocks();
|
||||
|
||||
// Fallback my have been filtered so do basic test for validity.
|
||||
if ( empty( $fallback_blocks ) || ! is_array( $fallback_blocks ) ) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$inner_blocks = new WP_Block_List( $fallback_blocks, $attributes );
|
||||
|
||||
}
|
||||
|
||||
// Restore legacy classnames for submenu positioning.
|
||||
@@ -234,7 +345,8 @@ function render_block_core_navigation( $attributes, $content, $block ) {
|
||||
$colors['css_classes'],
|
||||
$font_sizes['css_classes'],
|
||||
$is_responsive_menu ? array( 'is-responsive' ) : array(),
|
||||
$layout_class ? array( $layout_class ) : array()
|
||||
$layout_class ? array( $layout_class ) : array(),
|
||||
$is_fallback ? array( 'is-fallback' ) : array()
|
||||
);
|
||||
|
||||
$inner_blocks_html = '';
|
||||
@@ -323,8 +435,8 @@ function render_block_core_navigation( $attributes, $content, $block ) {
|
||||
/**
|
||||
* Register the navigation block.
|
||||
*
|
||||
* @uses render_block_core_navigation()
|
||||
* @throws WP_Error An WP_Error exception parsing the block definition.
|
||||
* @uses render_block_core_navigation()
|
||||
*/
|
||||
function register_block_core_navigation() {
|
||||
register_block_type_from_metadata(
|
||||
@@ -341,6 +453,7 @@ add_action( 'init', 'register_block_core_navigation' );
|
||||
* Filter that changes the parsed attribute values of navigation blocks contain typographic presets to contain the values directly.
|
||||
*
|
||||
* @param array $parsed_block The block being rendered.
|
||||
*
|
||||
* @return array The block being rendered without typographic presets.
|
||||
*/
|
||||
function block_core_navigation_typographic_presets_backcompatibility( $parsed_block ) {
|
||||
@@ -364,6 +477,7 @@ function block_core_navigation_typographic_presets_backcompatibility( $parsed_bl
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $parsed_block;
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
],
|
||||
"textdomain": "default",
|
||||
"attributes": {
|
||||
"navigationMenuId": {
|
||||
"ref": {
|
||||
"type": "number"
|
||||
},
|
||||
"textColor": {
|
||||
|
||||
@@ -1 +1 @@
|
||||
<?php return array('dependencies' => array(), 'version' => '8591fc81d18e61a0f33b213b1fe35e52');
|
||||
<?php return array('dependencies' => array(), 'version' => '133b84f32422a9ad94c4533f85fa4e87');
|
||||
@@ -1 +1 @@
|
||||
<?php return array('dependencies' => array(), 'version' => '4942262e50480536aae4cd504a13f19c');
|
||||
<?php return array('dependencies' => array(), 'version' => 'f3cbbfbf9b9c434c39d6f77037d5267c');
|
||||
@@ -293,6 +293,11 @@ function render_block_core_page_list( $attributes, $content, $block ) {
|
||||
|
||||
$nested_pages = block_core_page_list_nest_pages( $top_level_pages, $pages_with_children );
|
||||
|
||||
// Limit the number of items to be visually displayed.
|
||||
if ( ! empty( $attributes['__unstableMaxPages'] ) ) {
|
||||
$nested_pages = array_slice( $nested_pages, 0, $attributes['__unstableMaxPages'] );
|
||||
}
|
||||
|
||||
$is_navigation_child = array_key_exists( 'showSubmenuIcon', $block->context );
|
||||
|
||||
$open_submenus_on_click = array_key_exists( 'openSubmenusOnClick', $block->context ) ? $block->context['openSubmenusOnClick'] : false;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"apiVersion": 2,
|
||||
"name": "core/pattern",
|
||||
"title": "Pattern",
|
||||
"category": "design",
|
||||
"category": "theme",
|
||||
"description": "Show a block pattern.",
|
||||
"supports": {
|
||||
"html": false,
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"apiVersion": 2,
|
||||
"name": "core/post-terms",
|
||||
"title": "Post Terms",
|
||||
"category": "design",
|
||||
"category": "theme",
|
||||
"description": "Post terms.",
|
||||
"textdomain": "default",
|
||||
"attributes": {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"apiVersion": 2,
|
||||
"name": "core/query-title",
|
||||
"title": "Query Title",
|
||||
"category": "design",
|
||||
"category": "theme",
|
||||
"description": "Display the query title.",
|
||||
"textdomain": "default",
|
||||
"attributes": {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"apiVersion": 2,
|
||||
"name": "core/site-logo",
|
||||
"title": "Site Logo",
|
||||
"category": "layout",
|
||||
"category": "theme",
|
||||
"description": "Display a graphic to represent this site. Update the block, and the changes apply everywhere it’s used. This is different than the site icon, which is the smaller image visible in your dashboard, browser tabs, etc used to help others recognize this site.",
|
||||
"textdomain": "default",
|
||||
"attributes": {
|
||||
|
||||
@@ -154,7 +154,7 @@
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
border: 1px dashed currentColor;
|
||||
opacity: 0.3;
|
||||
opacity: 0.4;
|
||||
pointer-events: none;
|
||||
border-radius: inherit;
|
||||
}
|
||||
@@ -194,7 +194,7 @@
|
||||
height: 100%;
|
||||
stroke: currentColor;
|
||||
stroke-dasharray: 3;
|
||||
opacity: 0.3;
|
||||
opacity: 0.4;
|
||||
}
|
||||
.wp-block-site-logo.wp-block-site-logo.is-selected .components-button.components-button {
|
||||
background: var(--wp-admin-theme-color);
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
.wp-block[data-align=center]>.wp-block-site-logo{margin-right:auto;margin-left:auto;text-align:center}.wp-block-site-logo a{pointer-events:none}.wp-block-site-logo:not(.is-default-size){display:table}.wp-block-site-logo.is-default-size{width:120px}.wp-block-site-logo.is-default-size img{height:auto;width:100%}.wp-block-site-logo .custom-logo-link{cursor:inherit}.wp-block-site-logo .custom-logo-link:focus{box-shadow:none}.wp-block-site-logo .custom-logo-link.is-transient img{opacity:.3}.wp-block-site-logo img{display:block;height:auto;max-width:100%}.wp-block-site-logo.wp-block-site-logo .components-placeholder,.wp-block-site-logo.wp-block-site-logo .components-resizable-box__container{border-radius:inherit}.wp-block-site-logo.wp-block-site-logo.is-default-size .components-placeholder{height:120px;width:120px}.wp-block-site-logo.wp-block-site-logo .components-placeholder{justify-content:center;align-items:center;box-shadow:none;padding:0;min-height:48px;min-width:48px;height:100%;width:100%;color:currentColor;background:transparent}.wp-block-site-logo.wp-block-site-logo .components-placeholder .components-form-file-upload{display:none}.wp-block-site-logo.wp-block-site-logo .components-placeholder .components-placeholder__preview{position:absolute;top:4px;left:4px;bottom:4px;right:4px;background:hsla(0,0%,100%,.8);display:flex;align-items:center;justify-content:center}.wp-block-site-logo.wp-block-site-logo .components-placeholder .components-drop-zone__content-text{display:none}.wp-block-site-logo.wp-block-site-logo .components-placeholder:before{content:"";display:block;position:absolute;top:0;left:0;bottom:0;right:0;border:1px dashed;opacity:.3;pointer-events:none;border-radius:inherit}.wp-block-site-logo.wp-block-site-logo .components-placeholder .components-placeholder__fieldset{width:auto}.wp-block-site-logo.wp-block-site-logo .components-placeholder .components-button.components-button{color:inherit;padding:0;display:flex;justify-content:center;align-items:center;width:48px;height:48px;border-radius:50%;position:relative;visibility:hidden;background:transparent;transition:all .1s linear}@media (prefers-reduced-motion:reduce){.wp-block-site-logo.wp-block-site-logo .components-placeholder .components-button.components-button{transition-duration:0s;transition-delay:0s}}.wp-block-site-logo.wp-block-site-logo .components-placeholder .components-button.components-button>svg{color:#fff}.wp-block-site-logo.wp-block-site-logo .components-placeholder .components-placeholder__illustration{position:absolute;top:0;left:0;bottom:0;right:0;width:100%;height:100%;stroke:currentColor;stroke-dasharray:3;opacity:.3}.wp-block-site-logo.wp-block-site-logo.is-selected .components-button.components-button{background:var(--wp-admin-theme-color);border-color:var(--wp-admin-theme-color);border-style:solid;color:#fff;opacity:1;visibility:visible}
|
||||
.wp-block[data-align=center]>.wp-block-site-logo{margin-right:auto;margin-left:auto;text-align:center}.wp-block-site-logo a{pointer-events:none}.wp-block-site-logo:not(.is-default-size){display:table}.wp-block-site-logo.is-default-size{width:120px}.wp-block-site-logo.is-default-size img{height:auto;width:100%}.wp-block-site-logo .custom-logo-link{cursor:inherit}.wp-block-site-logo .custom-logo-link:focus{box-shadow:none}.wp-block-site-logo .custom-logo-link.is-transient img{opacity:.3}.wp-block-site-logo img{display:block;height:auto;max-width:100%}.wp-block-site-logo.wp-block-site-logo .components-placeholder,.wp-block-site-logo.wp-block-site-logo .components-resizable-box__container{border-radius:inherit}.wp-block-site-logo.wp-block-site-logo.is-default-size .components-placeholder{height:120px;width:120px}.wp-block-site-logo.wp-block-site-logo .components-placeholder{justify-content:center;align-items:center;box-shadow:none;padding:0;min-height:48px;min-width:48px;height:100%;width:100%;color:currentColor;background:transparent}.wp-block-site-logo.wp-block-site-logo .components-placeholder .components-form-file-upload{display:none}.wp-block-site-logo.wp-block-site-logo .components-placeholder .components-placeholder__preview{position:absolute;top:4px;left:4px;bottom:4px;right:4px;background:hsla(0,0%,100%,.8);display:flex;align-items:center;justify-content:center}.wp-block-site-logo.wp-block-site-logo .components-placeholder .components-drop-zone__content-text{display:none}.wp-block-site-logo.wp-block-site-logo .components-placeholder:before{content:"";display:block;position:absolute;top:0;left:0;bottom:0;right:0;border:1px dashed;opacity:.4;pointer-events:none;border-radius:inherit}.wp-block-site-logo.wp-block-site-logo .components-placeholder .components-placeholder__fieldset{width:auto}.wp-block-site-logo.wp-block-site-logo .components-placeholder .components-button.components-button{color:inherit;padding:0;display:flex;justify-content:center;align-items:center;width:48px;height:48px;border-radius:50%;position:relative;visibility:hidden;background:transparent;transition:all .1s linear}@media (prefers-reduced-motion:reduce){.wp-block-site-logo.wp-block-site-logo .components-placeholder .components-button.components-button{transition-duration:0s;transition-delay:0s}}.wp-block-site-logo.wp-block-site-logo .components-placeholder .components-button.components-button>svg{color:#fff}.wp-block-site-logo.wp-block-site-logo .components-placeholder .components-placeholder__illustration{position:absolute;top:0;left:0;bottom:0;right:0;width:100%;height:100%;stroke:currentColor;stroke-dasharray:3;opacity:.4}.wp-block-site-logo.wp-block-site-logo.is-selected .components-button.components-button{background:var(--wp-admin-theme-color);border-color:var(--wp-admin-theme-color);border-style:solid;color:#fff;opacity:1;visibility:visible}
|
||||
@@ -154,7 +154,7 @@
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
border: 1px dashed currentColor;
|
||||
opacity: 0.3;
|
||||
opacity: 0.4;
|
||||
pointer-events: none;
|
||||
border-radius: inherit;
|
||||
}
|
||||
@@ -194,7 +194,7 @@
|
||||
height: 100%;
|
||||
stroke: currentColor;
|
||||
stroke-dasharray: 3;
|
||||
opacity: 0.3;
|
||||
opacity: 0.4;
|
||||
}
|
||||
.wp-block-site-logo.wp-block-site-logo.is-selected .components-button.components-button {
|
||||
background: var(--wp-admin-theme-color);
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
.wp-block[data-align=center]>.wp-block-site-logo{margin-left:auto;margin-right:auto;text-align:center}.wp-block-site-logo a{pointer-events:none}.wp-block-site-logo:not(.is-default-size){display:table}.wp-block-site-logo.is-default-size{width:120px}.wp-block-site-logo.is-default-size img{height:auto;width:100%}.wp-block-site-logo .custom-logo-link{cursor:inherit}.wp-block-site-logo .custom-logo-link:focus{box-shadow:none}.wp-block-site-logo .custom-logo-link.is-transient img{opacity:.3}.wp-block-site-logo img{display:block;height:auto;max-width:100%}.wp-block-site-logo.wp-block-site-logo .components-placeholder,.wp-block-site-logo.wp-block-site-logo .components-resizable-box__container{border-radius:inherit}.wp-block-site-logo.wp-block-site-logo.is-default-size .components-placeholder{height:120px;width:120px}.wp-block-site-logo.wp-block-site-logo .components-placeholder{justify-content:center;align-items:center;box-shadow:none;padding:0;min-height:48px;min-width:48px;height:100%;width:100%;color:currentColor;background:transparent}.wp-block-site-logo.wp-block-site-logo .components-placeholder .components-form-file-upload{display:none}.wp-block-site-logo.wp-block-site-logo .components-placeholder .components-placeholder__preview{position:absolute;top:4px;right:4px;bottom:4px;left:4px;background:hsla(0,0%,100%,.8);display:flex;align-items:center;justify-content:center}.wp-block-site-logo.wp-block-site-logo .components-placeholder .components-drop-zone__content-text{display:none}.wp-block-site-logo.wp-block-site-logo .components-placeholder:before{content:"";display:block;position:absolute;top:0;right:0;bottom:0;left:0;border:1px dashed;opacity:.3;pointer-events:none;border-radius:inherit}.wp-block-site-logo.wp-block-site-logo .components-placeholder .components-placeholder__fieldset{width:auto}.wp-block-site-logo.wp-block-site-logo .components-placeholder .components-button.components-button{color:inherit;padding:0;display:flex;justify-content:center;align-items:center;width:48px;height:48px;border-radius:50%;position:relative;visibility:hidden;background:transparent;transition:all .1s linear}@media (prefers-reduced-motion:reduce){.wp-block-site-logo.wp-block-site-logo .components-placeholder .components-button.components-button{transition-duration:0s;transition-delay:0s}}.wp-block-site-logo.wp-block-site-logo .components-placeholder .components-button.components-button>svg{color:#fff}.wp-block-site-logo.wp-block-site-logo .components-placeholder .components-placeholder__illustration{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;stroke:currentColor;stroke-dasharray:3;opacity:.3}.wp-block-site-logo.wp-block-site-logo.is-selected .components-button.components-button{background:var(--wp-admin-theme-color);border-color:var(--wp-admin-theme-color);border-style:solid;color:#fff;opacity:1;visibility:visible}
|
||||
.wp-block[data-align=center]>.wp-block-site-logo{margin-left:auto;margin-right:auto;text-align:center}.wp-block-site-logo a{pointer-events:none}.wp-block-site-logo:not(.is-default-size){display:table}.wp-block-site-logo.is-default-size{width:120px}.wp-block-site-logo.is-default-size img{height:auto;width:100%}.wp-block-site-logo .custom-logo-link{cursor:inherit}.wp-block-site-logo .custom-logo-link:focus{box-shadow:none}.wp-block-site-logo .custom-logo-link.is-transient img{opacity:.3}.wp-block-site-logo img{display:block;height:auto;max-width:100%}.wp-block-site-logo.wp-block-site-logo .components-placeholder,.wp-block-site-logo.wp-block-site-logo .components-resizable-box__container{border-radius:inherit}.wp-block-site-logo.wp-block-site-logo.is-default-size .components-placeholder{height:120px;width:120px}.wp-block-site-logo.wp-block-site-logo .components-placeholder{justify-content:center;align-items:center;box-shadow:none;padding:0;min-height:48px;min-width:48px;height:100%;width:100%;color:currentColor;background:transparent}.wp-block-site-logo.wp-block-site-logo .components-placeholder .components-form-file-upload{display:none}.wp-block-site-logo.wp-block-site-logo .components-placeholder .components-placeholder__preview{position:absolute;top:4px;right:4px;bottom:4px;left:4px;background:hsla(0,0%,100%,.8);display:flex;align-items:center;justify-content:center}.wp-block-site-logo.wp-block-site-logo .components-placeholder .components-drop-zone__content-text{display:none}.wp-block-site-logo.wp-block-site-logo .components-placeholder:before{content:"";display:block;position:absolute;top:0;right:0;bottom:0;left:0;border:1px dashed;opacity:.4;pointer-events:none;border-radius:inherit}.wp-block-site-logo.wp-block-site-logo .components-placeholder .components-placeholder__fieldset{width:auto}.wp-block-site-logo.wp-block-site-logo .components-placeholder .components-button.components-button{color:inherit;padding:0;display:flex;justify-content:center;align-items:center;width:48px;height:48px;border-radius:50%;position:relative;visibility:hidden;background:transparent;transition:all .1s linear}@media (prefers-reduced-motion:reduce){.wp-block-site-logo.wp-block-site-logo .components-placeholder .components-button.components-button{transition-duration:0s;transition-delay:0s}}.wp-block-site-logo.wp-block-site-logo .components-placeholder .components-button.components-button>svg{color:#fff}.wp-block-site-logo.wp-block-site-logo .components-placeholder .components-placeholder__illustration{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;stroke:currentColor;stroke-dasharray:3;opacity:.4}.wp-block-site-logo.wp-block-site-logo.is-selected .components-button.components-button{background:var(--wp-admin-theme-color);border-color:var(--wp-admin-theme-color);border-style:solid;color:#fff;opacity:1;visibility:visible}
|
||||
@@ -2,7 +2,7 @@
|
||||
"apiVersion": 2,
|
||||
"name": "core/site-tagline",
|
||||
"title": "Site Tagline",
|
||||
"category": "design",
|
||||
"category": "theme",
|
||||
"description": "Describe in a few words what the website is about. The tagline can be used in search results or when sharing on social networks even if it's not displayed in the theme design.",
|
||||
"keywords": [ "description" ],
|
||||
"textdomain": "default",
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"apiVersion": 2,
|
||||
"name": "core/site-title",
|
||||
"title": "Site Title",
|
||||
"category": "design",
|
||||
"category": "theme",
|
||||
"description": "Displays the name of this site. Update the block, and the changes apply everywhere it’s used. This will also appear in the browser title bar and in search results.",
|
||||
"textdomain": "default",
|
||||
"attributes": {
|
||||
|
||||
@@ -53,7 +53,8 @@ function render_block_core_template_part( $attributes ) {
|
||||
} else {
|
||||
// Else, if the template part was provided by the active theme,
|
||||
// render the corresponding file content.
|
||||
$template_part_file_path = get_theme_file_path( '/block-template-parts/' . $attributes['slug'] . '.html' );
|
||||
$theme_folders = get_block_theme_folders();
|
||||
$template_part_file_path = get_theme_file_path( '/' . $theme_folders['wp_template_part'] . '/' . $attributes['slug'] . '.html' );
|
||||
if ( 0 === validate_file( $attributes['slug'] ) && file_exists( $template_part_file_path ) ) {
|
||||
$content = file_get_contents( $template_part_file_path );
|
||||
$content = is_string( $content ) && '' !== $content
|
||||
|
||||
@@ -29,7 +29,8 @@
|
||||
"spacing": {
|
||||
"padding": true
|
||||
},
|
||||
"__experimentalLayout": true
|
||||
"__experimentalLayout": true,
|
||||
"reusable": false
|
||||
},
|
||||
"editorStyle": "wp-block-template-part-editor"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user