mirror of
git://develop.git.wordpress.org/
synced 2025-01-16 20:38:35 +01:00
Editor: Update packages for 6.7 Beta 1.
Syncs `@wordpress/*` packages to the `wp-6.7` npm tag. Fixes #61906. Props peterwilsoncc, gziolo, kevin940726. git-svn-id: https://develop.svn.wordpress.org/trunk@59072 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
d46067a776
commit
1ad25bb143
@ -1151,6 +1151,7 @@ module.exports = function(grunt) {
|
||||
flatten: true,
|
||||
src: [
|
||||
BUILD_DIR + 'wp-includes/js/dist/block-editor.js',
|
||||
BUILD_DIR + 'wp-includes/js/dist/commands.js',
|
||||
],
|
||||
dest: BUILD_DIR + 'wp-includes/js/dist/'
|
||||
}
|
||||
|
6854
package-lock.json
generated
6854
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
145
package.json
145
package.json
@ -27,12 +27,12 @@
|
||||
"@lodder/grunt-postcss": "^3.1.1",
|
||||
"@playwright/test": "1.45.0",
|
||||
"@pmmmwh/react-refresh-webpack-plugin": "0.5.15",
|
||||
"@wordpress/babel-preset-default": "8.0.1",
|
||||
"@wordpress/dependency-extraction-webpack-plugin": "6.0.2",
|
||||
"@wordpress/e2e-test-utils": "11.0.1",
|
||||
"@wordpress/e2e-test-utils-playwright": "1.0.1",
|
||||
"@wordpress/prettier-config": "4.0.1",
|
||||
"@wordpress/scripts": "28.0.2",
|
||||
"@wordpress/babel-preset-default": "8.8.2",
|
||||
"@wordpress/dependency-extraction-webpack-plugin": "6.8.1",
|
||||
"@wordpress/e2e-test-utils": "11.8.1",
|
||||
"@wordpress/e2e-test-utils-playwright": "1.8.1",
|
||||
"@wordpress/prettier-config": "4.8.1",
|
||||
"@wordpress/scripts": "30.0.2",
|
||||
"autoprefixer": "10.4.19",
|
||||
"chalk": "5.3.0",
|
||||
"check-node-version": "4.2.1",
|
||||
@ -78,72 +78,73 @@
|
||||
"webpack-livereload-plugin": "3.0.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"@wordpress/a11y": "4.0.1",
|
||||
"@wordpress/annotations": "3.0.2",
|
||||
"@wordpress/api-fetch": "7.0.1",
|
||||
"@wordpress/autop": "4.0.1",
|
||||
"@wordpress/blob": "4.0.1",
|
||||
"@wordpress/block-directory": "5.0.9",
|
||||
"@wordpress/block-editor": "13.0.7",
|
||||
"@wordpress/block-library": "9.0.8",
|
||||
"@wordpress/block-serialization-default-parser": "5.0.1",
|
||||
"@wordpress/blocks": "13.0.3",
|
||||
"@wordpress/commands": "1.0.3",
|
||||
"@wordpress/components": "28.0.3",
|
||||
"@wordpress/compose": "7.0.1",
|
||||
"@wordpress/core-commands": "1.0.7",
|
||||
"@wordpress/core-data": "7.0.7",
|
||||
"@wordpress/customize-widgets": "5.0.8",
|
||||
"@wordpress/data": "10.0.2",
|
||||
"@wordpress/data-controls": "4.0.2",
|
||||
"@wordpress/dataviews": "2.0.5",
|
||||
"@wordpress/date": "5.0.1",
|
||||
"@wordpress/deprecated": "4.0.1",
|
||||
"@wordpress/dom": "4.0.1",
|
||||
"@wordpress/dom-ready": "4.0.1",
|
||||
"@wordpress/edit-post": "8.0.9",
|
||||
"@wordpress/edit-site": "6.0.9",
|
||||
"@wordpress/edit-widgets": "6.0.8",
|
||||
"@wordpress/editor": "14.0.8",
|
||||
"@wordpress/element": "6.0.1",
|
||||
"@wordpress/escape-html": "3.0.1",
|
||||
"@wordpress/format-library": "5.0.7",
|
||||
"@wordpress/hooks": "4.0.1",
|
||||
"@wordpress/html-entities": "4.0.1",
|
||||
"@wordpress/i18n": "5.0.1",
|
||||
"@wordpress/icons": "10.0.2",
|
||||
"@wordpress/interactivity": "6.0.2",
|
||||
"@wordpress/interactivity-router": "2.0.2",
|
||||
"@wordpress/interface": "6.0.3",
|
||||
"@wordpress/is-shallow-equal": "5.0.1",
|
||||
"@wordpress/keyboard-shortcuts": "5.0.2",
|
||||
"@wordpress/keycodes": "4.0.1",
|
||||
"@wordpress/list-reusable-blocks": "5.0.3",
|
||||
"@wordpress/media-utils": "5.0.1",
|
||||
"@wordpress/notices": "5.0.2",
|
||||
"@wordpress/nux": "9.0.3",
|
||||
"@wordpress/patterns": "2.0.7",
|
||||
"@wordpress/plugins": "7.0.3",
|
||||
"@wordpress/preferences": "4.0.3",
|
||||
"@wordpress/preferences-persistence": "2.0.1",
|
||||
"@wordpress/primitives": "4.0.1",
|
||||
"@wordpress/priority-queue": "3.0.1",
|
||||
"@wordpress/private-apis": "1.0.2",
|
||||
"@wordpress/redux-routine": "5.0.1",
|
||||
"@wordpress/reusable-blocks": "5.0.7",
|
||||
"@wordpress/rich-text": "7.0.2",
|
||||
"@wordpress/router": "1.0.2",
|
||||
"@wordpress/server-side-render": "5.0.3",
|
||||
"@wordpress/shortcode": "4.0.1",
|
||||
"@wordpress/style-engine": "2.0.2",
|
||||
"@wordpress/sync": "1.0.1",
|
||||
"@wordpress/token-list": "3.0.1",
|
||||
"@wordpress/undo-manager": "1.0.1",
|
||||
"@wordpress/url": "4.0.1",
|
||||
"@wordpress/viewport": "6.0.2",
|
||||
"@wordpress/warning": "3.0.1",
|
||||
"@wordpress/widgets": "4.0.7",
|
||||
"@wordpress/wordcount": "4.0.1",
|
||||
"@wordpress/a11y": "4.8.1",
|
||||
"@wordpress/annotations": "3.8.1",
|
||||
"@wordpress/api-fetch": "7.8.1",
|
||||
"@wordpress/autop": "4.8.1",
|
||||
"@wordpress/blob": "4.8.1",
|
||||
"@wordpress/block-directory": "5.8.3",
|
||||
"@wordpress/block-editor": "14.3.1",
|
||||
"@wordpress/block-library": "9.8.2",
|
||||
"@wordpress/block-serialization-default-parser": "5.8.1",
|
||||
"@wordpress/blocks": "13.8.1",
|
||||
"@wordpress/commands": "1.8.1",
|
||||
"@wordpress/components": "28.8.1",
|
||||
"@wordpress/compose": "7.8.1",
|
||||
"@wordpress/core-commands": "1.8.1",
|
||||
"@wordpress/core-data": "7.8.1",
|
||||
"@wordpress/customize-widgets": "5.8.2",
|
||||
"@wordpress/data": "10.8.1",
|
||||
"@wordpress/data-controls": "4.8.1",
|
||||
"@wordpress/dataviews": "4.4.1",
|
||||
"@wordpress/date": "5.8.1",
|
||||
"@wordpress/deprecated": "4.8.1",
|
||||
"@wordpress/dom": "4.8.1",
|
||||
"@wordpress/dom-ready": "4.8.1",
|
||||
"@wordpress/edit-post": "8.8.3",
|
||||
"@wordpress/edit-site": "6.8.3",
|
||||
"@wordpress/edit-widgets": "6.8.2",
|
||||
"@wordpress/editor": "14.8.3",
|
||||
"@wordpress/element": "6.8.1",
|
||||
"@wordpress/escape-html": "3.8.1",
|
||||
"@wordpress/fields": "0.0.2",
|
||||
"@wordpress/format-library": "5.8.1",
|
||||
"@wordpress/hooks": "4.8.1",
|
||||
"@wordpress/html-entities": "4.8.1",
|
||||
"@wordpress/i18n": "5.8.1",
|
||||
"@wordpress/icons": "10.8.1",
|
||||
"@wordpress/interactivity": "6.8.2",
|
||||
"@wordpress/interactivity-router": "2.8.2",
|
||||
"@wordpress/interface": "6.8.1",
|
||||
"@wordpress/is-shallow-equal": "5.8.1",
|
||||
"@wordpress/keyboard-shortcuts": "5.8.1",
|
||||
"@wordpress/keycodes": "4.8.1",
|
||||
"@wordpress/list-reusable-blocks": "5.8.1",
|
||||
"@wordpress/media-utils": "5.8.1",
|
||||
"@wordpress/notices": "5.8.1",
|
||||
"@wordpress/nux": "9.8.1",
|
||||
"@wordpress/patterns": "2.8.1",
|
||||
"@wordpress/plugins": "7.8.1",
|
||||
"@wordpress/preferences": "4.8.1",
|
||||
"@wordpress/preferences-persistence": "2.8.1",
|
||||
"@wordpress/primitives": "4.8.1",
|
||||
"@wordpress/priority-queue": "3.8.1",
|
||||
"@wordpress/private-apis": "1.8.1",
|
||||
"@wordpress/redux-routine": "5.8.1",
|
||||
"@wordpress/reusable-blocks": "5.8.1",
|
||||
"@wordpress/rich-text": "7.8.1",
|
||||
"@wordpress/router": "1.8.1",
|
||||
"@wordpress/server-side-render": "5.8.1",
|
||||
"@wordpress/shortcode": "4.8.1",
|
||||
"@wordpress/style-engine": "2.8.1",
|
||||
"@wordpress/sync": "1.8.1",
|
||||
"@wordpress/token-list": "3.8.1",
|
||||
"@wordpress/undo-manager": "1.8.1",
|
||||
"@wordpress/url": "4.8.1",
|
||||
"@wordpress/viewport": "6.8.1",
|
||||
"@wordpress/warning": "3.8.1",
|
||||
"@wordpress/widgets": "4.8.1",
|
||||
"@wordpress/wordcount": "4.8.1",
|
||||
"backbone": "1.6.0",
|
||||
"clipboard": "2.0.11",
|
||||
"core-js-url-browser": "3.6.4",
|
||||
|
@ -737,10 +737,14 @@ $_old_files = array(
|
||||
'wp-includes/blocks/query-title/editor.min.css',
|
||||
'wp-includes/blocks/query-title/editor-rtl.css',
|
||||
'wp-includes/blocks/query-title/editor-rtl.min.css',
|
||||
'wp-includes/blocks/tag-cloud/editor.css',
|
||||
'wp-includes/blocks/tag-cloud/editor.min.css',
|
||||
'wp-includes/blocks/tag-cloud/editor-rtl.css',
|
||||
'wp-includes/blocks/tag-cloud/editor-rtl.min.css',
|
||||
/*
|
||||
* Restored in WordPress 6.7
|
||||
*
|
||||
* 'wp-includes/blocks/tag-cloud/editor.css',
|
||||
* 'wp-includes/blocks/tag-cloud/editor.min.css',
|
||||
* 'wp-includes/blocks/tag-cloud/editor-rtl.css',
|
||||
* 'wp-includes/blocks/tag-cloud/editor-rtl.min.css',
|
||||
*/
|
||||
// 6.1
|
||||
'wp-includes/blocks/post-comments.php',
|
||||
'wp-includes/blocks/post-comments',
|
||||
|
File diff suppressed because one or more lines are too long
@ -8,6 +8,10 @@
|
||||
"keywords": [ "music", "sound", "podcast", "recording" ],
|
||||
"textdomain": "default",
|
||||
"attributes": {
|
||||
"blob": {
|
||||
"type": "string",
|
||||
"__experimentalRole": "local"
|
||||
},
|
||||
"src": {
|
||||
"type": "string",
|
||||
"source": "attribute",
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -93,6 +93,7 @@
|
||||
"__experimentalTextTransform": true,
|
||||
"__experimentalTextDecoration": true,
|
||||
"__experimentalLetterSpacing": true,
|
||||
"__experimentalWritingMode": true,
|
||||
"__experimentalDefaultControls": {
|
||||
"fontSize": true
|
||||
}
|
||||
|
@ -13,8 +13,16 @@
|
||||
"align": [ "wide", "full" ],
|
||||
"html": false,
|
||||
"__experimentalExposeControlsToChildren": true,
|
||||
"color": {
|
||||
"gradients": true,
|
||||
"text": false,
|
||||
"__experimentalDefaultControls": {
|
||||
"background": true
|
||||
}
|
||||
},
|
||||
"spacing": {
|
||||
"blockGap": true,
|
||||
"blockGap": [ "horizontal", "vertical" ],
|
||||
"padding": true,
|
||||
"margin": [ "top", "bottom" ],
|
||||
"__experimentalDefaultControls": {
|
||||
"blockGap": true
|
||||
@ -33,6 +41,18 @@
|
||||
"fontSize": true
|
||||
}
|
||||
},
|
||||
"__experimentalBorder": {
|
||||
"color": true,
|
||||
"radius": true,
|
||||
"style": true,
|
||||
"width": true,
|
||||
"__experimentalDefaultControls": {
|
||||
"color": true,
|
||||
"radius": true,
|
||||
"style": true,
|
||||
"width": true
|
||||
}
|
||||
},
|
||||
"layout": {
|
||||
"allowSwitching": false,
|
||||
"allowInheriting": false,
|
||||
|
@ -9,20 +9,26 @@
|
||||
* Renders the `core/categories` block on server.
|
||||
*
|
||||
* @since 5.0.0
|
||||
* @since 6.7.0 Enable client-side rendering if enhancedPagination context is true.
|
||||
*
|
||||
* @param array $attributes The block attributes.
|
||||
* @param array $attributes The block attributes.
|
||||
* @param string $content Block default content.
|
||||
* @param WP_Block $block Block instance.
|
||||
*
|
||||
* @return string Returns the categories list/dropdown markup.
|
||||
*/
|
||||
function render_block_core_categories( $attributes ) {
|
||||
function render_block_core_categories( $attributes, $content, $block ) {
|
||||
static $block_id = 0;
|
||||
++$block_id;
|
||||
|
||||
$taxonomy = get_taxonomy( $attributes['taxonomy'] );
|
||||
|
||||
$args = array(
|
||||
'echo' => false,
|
||||
'hierarchical' => ! empty( $attributes['showHierarchy'] ),
|
||||
'orderby' => 'name',
|
||||
'show_count' => ! empty( $attributes['showPostCounts'] ),
|
||||
'taxonomy' => $attributes['taxonomy'],
|
||||
'title_li' => '',
|
||||
'hide_empty' => empty( $attributes['showEmpty'] ),
|
||||
);
|
||||
@ -33,10 +39,20 @@ function render_block_core_categories( $attributes ) {
|
||||
if ( ! empty( $attributes['displayAsDropdown'] ) ) {
|
||||
$id = 'wp-block-categories-' . $block_id;
|
||||
$args['id'] = $id;
|
||||
$args['show_option_none'] = __( 'Select Category' );
|
||||
$wrapper_markup = '<div %1$s><label class="screen-reader-text" for="' . esc_attr( $id ) . '">' . __( 'Categories' ) . '</label>%2$s</div>';
|
||||
$items_markup = wp_dropdown_categories( $args );
|
||||
$type = 'dropdown';
|
||||
$args['name'] = $taxonomy->query_var;
|
||||
$args['value_field'] = 'slug';
|
||||
$args['show_option_none'] = sprintf(
|
||||
/* translators: %s: taxonomy's singular name */
|
||||
__( 'Select %s' ),
|
||||
$taxonomy->labels->singular_name
|
||||
);
|
||||
|
||||
$show_label = empty( $attributes['showLabel'] ) ? ' screen-reader-text' : '';
|
||||
$default_label = $taxonomy->label;
|
||||
$label_text = ! empty( $attributes['label'] ) ? $attributes['label'] : $default_label;
|
||||
$wrapper_markup = '<div %1$s><label class="wp-block-categories__label' . $show_label . '" for="' . esc_attr( $id ) . '">' . $label_text . '</label>%2$s</div>';
|
||||
$items_markup = wp_dropdown_categories( $args );
|
||||
$type = 'dropdown';
|
||||
|
||||
if ( ! is_admin() ) {
|
||||
// Inject the dropdown script immediately after the select dropdown.
|
||||
@ -48,9 +64,19 @@ function render_block_core_categories( $attributes ) {
|
||||
);
|
||||
}
|
||||
} else {
|
||||
$args['show_option_none'] = $taxonomy->labels->no_terms;
|
||||
|
||||
$wrapper_markup = '<ul %1$s>%2$s</ul>';
|
||||
$items_markup = wp_list_categories( $args );
|
||||
$type = 'list';
|
||||
|
||||
if ( ! empty( $block->context['enhancedPagination'] ) ) {
|
||||
$p = new WP_HTML_Tag_Processor( $items_markup );
|
||||
while ( $p->next_tag( 'a' ) ) {
|
||||
$p->set_attribute( 'data-wp-on--click', 'core/query::actions.navigate' );
|
||||
}
|
||||
$items_markup = $p->get_updated_html();
|
||||
}
|
||||
}
|
||||
|
||||
$wrapper_attributes = get_block_wrapper_attributes( array( 'class' => "wp-block-categories-{$type}" ) );
|
||||
@ -78,8 +104,8 @@ function build_dropdown_script_block_core_categories( $dropdown_id ) {
|
||||
( function() {
|
||||
var dropdown = document.getElementById( '<?php echo esc_js( $dropdown_id ); ?>' );
|
||||
function onCatChange() {
|
||||
if ( dropdown.options[ dropdown.selectedIndex ].value > 0 ) {
|
||||
location.href = "<?php echo esc_url( home_url() ); ?>/?cat=" + dropdown.options[ dropdown.selectedIndex ].value;
|
||||
if ( dropdown.options[ dropdown.selectedIndex ].value !== -1 ) {
|
||||
location.href = "<?php echo esc_url( home_url() ); ?>/?" + dropdown.name + '=' + dropdown.options[ dropdown.selectedIndex ].value;
|
||||
}
|
||||
}
|
||||
dropdown.onchange = onCatChange;
|
||||
|
@ -2,11 +2,16 @@
|
||||
"$schema": "https://schemas.wp.org/trunk/block.json",
|
||||
"apiVersion": 3,
|
||||
"name": "core/categories",
|
||||
"title": "Categories List",
|
||||
"title": "Terms List",
|
||||
"category": "widgets",
|
||||
"description": "Display a list of all categories.",
|
||||
"description": "Display a list of all terms of a given taxonomy.",
|
||||
"keywords": [ "categories" ],
|
||||
"textdomain": "default",
|
||||
"attributes": {
|
||||
"taxonomy": {
|
||||
"type": "string",
|
||||
"default": "category"
|
||||
},
|
||||
"displayAsDropdown": {
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
@ -26,8 +31,17 @@
|
||||
"showEmpty": {
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"label": {
|
||||
"type": "string",
|
||||
"__experimentalRole": "content"
|
||||
},
|
||||
"showLabel": {
|
||||
"type": "boolean",
|
||||
"default": true
|
||||
}
|
||||
},
|
||||
"usesContext": [ "enhancedPagination" ],
|
||||
"supports": {
|
||||
"align": true,
|
||||
"html": false,
|
||||
@ -54,6 +68,18 @@
|
||||
},
|
||||
"interactivity": {
|
||||
"clientNavigation": true
|
||||
},
|
||||
"__experimentalBorder": {
|
||||
"radius": true,
|
||||
"color": true,
|
||||
"width": true,
|
||||
"style": true,
|
||||
"__experimentalDefaultControls": {
|
||||
"radius": true,
|
||||
"color": true,
|
||||
"width": true,
|
||||
"style": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"editorStyle": "wp-block-categories-editor",
|
||||
|
@ -48,10 +48,12 @@
|
||||
},
|
||||
"__experimentalBorder": {
|
||||
"color": true,
|
||||
"radius": true,
|
||||
"style": true,
|
||||
"width": true,
|
||||
"__experimentalDefaultControls": {
|
||||
"color": true,
|
||||
"radius": true,
|
||||
"style": true,
|
||||
"width": true
|
||||
}
|
||||
|
@ -51,6 +51,19 @@
|
||||
},
|
||||
"interactivity": {
|
||||
"clientNavigation": true
|
||||
},
|
||||
"__experimentalBorder": {
|
||||
"radius": true,
|
||||
"color": true,
|
||||
"width": true,
|
||||
"style": true,
|
||||
"__experimentalDefaultControls": {
|
||||
"radius": true,
|
||||
"color": true,
|
||||
"width": true,
|
||||
"style": true
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"style": "wp-block-comment-author-name"
|
||||
}
|
||||
|
@ -35,6 +35,18 @@
|
||||
"fontSize": true
|
||||
}
|
||||
},
|
||||
"__experimentalBorder": {
|
||||
"radius": true,
|
||||
"color": true,
|
||||
"width": true,
|
||||
"style": true,
|
||||
"__experimentalDefaultControls": {
|
||||
"radius": true,
|
||||
"color": true,
|
||||
"width": true,
|
||||
"style": true
|
||||
}
|
||||
},
|
||||
"spacing": {
|
||||
"padding": [ "horizontal", "vertical" ],
|
||||
"__experimentalDefaultControls": {
|
||||
@ -42,5 +54,6 @@
|
||||
}
|
||||
},
|
||||
"html": false
|
||||
}
|
||||
},
|
||||
"style": "wp-block-comment-content"
|
||||
}
|
||||
|
@ -28,11 +28,13 @@ function render_block_core_comment_date( $attributes, $content, $block ) {
|
||||
$classes = ( isset( $attributes['style']['elements']['link']['color']['text'] ) ) ? 'has-link-color' : '';
|
||||
|
||||
$wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $classes ) );
|
||||
$formatted_date = get_comment_date(
|
||||
isset( $attributes['format'] ) ? $attributes['format'] : '',
|
||||
$comment
|
||||
);
|
||||
$link = get_comment_link( $comment );
|
||||
if ( isset( $attributes['format'] ) && 'human-diff' === $attributes['format'] ) {
|
||||
// translators: %s: human-readable time difference.
|
||||
$formatted_date = sprintf( __( '%s ago' ), human_time_diff( get_comment_date( 'U', $comment ) ) );
|
||||
} else {
|
||||
$formatted_date = get_comment_date( empty( $attributes['format'] ) ? '' : $attributes['format'], $comment );
|
||||
}
|
||||
$link = get_comment_link( $comment );
|
||||
|
||||
if ( ! empty( $attributes['isLink'] ) ) {
|
||||
$formatted_date = sprintf( '<a href="%1s">%2s</a>', esc_url( $link ), $formatted_date );
|
||||
|
@ -47,6 +47,19 @@
|
||||
},
|
||||
"interactivity": {
|
||||
"clientNavigation": true
|
||||
},
|
||||
"__experimentalBorder": {
|
||||
"radius": true,
|
||||
"color": true,
|
||||
"width": true,
|
||||
"style": true,
|
||||
"__experimentalDefaultControls": {
|
||||
"radius": true,
|
||||
"color": true,
|
||||
"width": true,
|
||||
"style": true
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"style": "wp-block-comment-date"
|
||||
}
|
||||
|
@ -30,7 +30,11 @@
|
||||
},
|
||||
"spacing": {
|
||||
"margin": true,
|
||||
"padding": true
|
||||
"padding": true,
|
||||
"__experimentalDefaultControls": {
|
||||
"margin": false,
|
||||
"padding": false
|
||||
}
|
||||
},
|
||||
"typography": {
|
||||
"fontSize": true,
|
||||
@ -47,6 +51,13 @@
|
||||
},
|
||||
"interactivity": {
|
||||
"clientNavigation": true
|
||||
},
|
||||
"__experimentalBorder": {
|
||||
"radius": true,
|
||||
"color": true,
|
||||
"width": true,
|
||||
"style": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"style": "wp-block-comment-edit-link"
|
||||
}
|
||||
|
@ -25,7 +25,11 @@
|
||||
},
|
||||
"spacing": {
|
||||
"margin": true,
|
||||
"padding": true
|
||||
"padding": true,
|
||||
"__experimentalDefaultControls": {
|
||||
"margin": false,
|
||||
"padding": false
|
||||
}
|
||||
},
|
||||
"typography": {
|
||||
"fontSize": true,
|
||||
@ -40,6 +44,13 @@
|
||||
"fontSize": true
|
||||
}
|
||||
},
|
||||
"__experimentalBorder": {
|
||||
"radius": true,
|
||||
"color": true,
|
||||
"width": true,
|
||||
"style": true
|
||||
},
|
||||
"html": false
|
||||
}
|
||||
},
|
||||
"style": "wp-block-comment-reply-link"
|
||||
}
|
||||
|
@ -31,6 +31,18 @@
|
||||
},
|
||||
"interactivity": {
|
||||
"clientNavigation": true
|
||||
},
|
||||
"__experimentalBorder": {
|
||||
"radius": true,
|
||||
"color": true,
|
||||
"width": true,
|
||||
"style": true,
|
||||
"__experimentalDefaultControls": {
|
||||
"radius": true,
|
||||
"color": true,
|
||||
"width": true,
|
||||
"style": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"style": "wp-block-comment-template"
|
||||
|
@ -37,7 +37,7 @@ function render_block_core_comments_pagination_next( $attributes, $content, $blo
|
||||
$label .= $pagination_arrow;
|
||||
}
|
||||
|
||||
$next_comments_link = get_next_comments_link( $label, $max_page );
|
||||
$next_comments_link = get_next_comments_link( $label, $max_page, $comment_vars['paged'] ?? null );
|
||||
|
||||
remove_filter( 'next_posts_link_attributes', $filter_link_attributes );
|
||||
|
||||
|
@ -29,7 +29,8 @@ function render_block_core_comments_pagination_previous( $attributes, $content,
|
||||
};
|
||||
add_filter( 'previous_comments_link_attributes', $filter_link_attributes );
|
||||
|
||||
$previous_comments_link = get_previous_comments_link( $label );
|
||||
$comment_vars = build_comment_query_vars_from_block( $block );
|
||||
$previous_comments_link = get_previous_comments_link( $label, $comment_vars['paged'] ?? null );
|
||||
|
||||
remove_filter( 'previous_comments_link_attributes', $filter_link_attributes );
|
||||
|
||||
|
@ -23,6 +23,9 @@
|
||||
"level": {
|
||||
"type": "number",
|
||||
"default": 2
|
||||
},
|
||||
"levelOptions": {
|
||||
"type": "array"
|
||||
}
|
||||
},
|
||||
"supports": {
|
||||
|
@ -21,7 +21,7 @@ function render_block_core_file( $attributes, $content ) {
|
||||
if ( ! empty( $attributes['displayPreview'] ) ) {
|
||||
$suffix = wp_scripts_get_suffix();
|
||||
if ( defined( 'IS_GUTENBERG_PLUGIN' ) && IS_GUTENBERG_PLUGIN ) {
|
||||
$module_url = gutenberg_url( '/build/interactivity/file.min.js' );
|
||||
$module_url = gutenberg_url( '/build-module/block-library/file/view.min.js' );
|
||||
}
|
||||
|
||||
wp_register_script_module(
|
||||
|
@ -11,6 +11,10 @@
|
||||
"id": {
|
||||
"type": "number"
|
||||
},
|
||||
"blob": {
|
||||
"type": "string",
|
||||
"__experimentalRole": "local"
|
||||
},
|
||||
"href": {
|
||||
"type": "string"
|
||||
},
|
||||
@ -70,6 +74,18 @@
|
||||
"link": true
|
||||
}
|
||||
},
|
||||
"__experimentalBorder": {
|
||||
"radius": true,
|
||||
"color": true,
|
||||
"width": true,
|
||||
"style": true,
|
||||
"__experimentalDefaultControls": {
|
||||
"radius": true,
|
||||
"color": true,
|
||||
"width": true,
|
||||
"style": true
|
||||
}
|
||||
},
|
||||
"interactivity": true
|
||||
},
|
||||
"editorStyle": "wp-block-file-editor",
|
||||
|
@ -112,6 +112,16 @@
|
||||
"supports": {
|
||||
"anchor": true,
|
||||
"align": true,
|
||||
"__experimentalBorder": {
|
||||
"radius": true,
|
||||
"color": true,
|
||||
"width": true,
|
||||
"style": true,
|
||||
"__experimentalDefaultControls": {
|
||||
"color": true,
|
||||
"radius": true
|
||||
}
|
||||
},
|
||||
"html": false,
|
||||
"units": [ "px", "em", "rem", "vh", "vw" ],
|
||||
"spacing": {
|
||||
|
@ -45,6 +45,7 @@
|
||||
"text": true
|
||||
}
|
||||
},
|
||||
"shadow": true,
|
||||
"spacing": {
|
||||
"margin": [ "top", "bottom" ],
|
||||
"padding": true,
|
||||
|
@ -21,6 +21,9 @@
|
||||
"type": "number",
|
||||
"default": 2
|
||||
},
|
||||
"levelOptions": {
|
||||
"type": "array"
|
||||
},
|
||||
"placeholder": {
|
||||
"type": "string"
|
||||
}
|
||||
@ -30,6 +33,18 @@
|
||||
"anchor": true,
|
||||
"className": true,
|
||||
"splitting": true,
|
||||
"__experimentalBorder": {
|
||||
"color": true,
|
||||
"radius": true,
|
||||
"style": true,
|
||||
"width": true,
|
||||
"__experimentalDefaultControls": {
|
||||
"color": true,
|
||||
"radius": true,
|
||||
"style": true,
|
||||
"width": true
|
||||
}
|
||||
},
|
||||
"color": {
|
||||
"gradients": true,
|
||||
"link": true,
|
||||
|
@ -72,7 +72,7 @@ function render_block_core_image( $attributes, $content, $block ) {
|
||||
) {
|
||||
$suffix = wp_scripts_get_suffix();
|
||||
if ( defined( 'IS_GUTENBERG_PLUGIN' ) && IS_GUTENBERG_PLUGIN ) {
|
||||
$module_url = gutenberg_url( '/build/interactivity/image.min.js' );
|
||||
$module_url = gutenberg_url( '/build-module/block-library/image/view.min.js' );
|
||||
}
|
||||
|
||||
wp_register_script_module(
|
||||
@ -185,22 +185,37 @@ function block_core_image_render_lightbox( $block_content, $block ) {
|
||||
$p->seek( 'figure' );
|
||||
$figure_class_names = $p->get_attribute( 'class' );
|
||||
$figure_styles = $p->get_attribute( 'style' );
|
||||
|
||||
// Create unique id and set the image metadata in the state.
|
||||
$unique_image_id = uniqid();
|
||||
|
||||
wp_interactivity_state(
|
||||
'core/image',
|
||||
array(
|
||||
'metadata' => array(
|
||||
$unique_image_id => array(
|
||||
'uploadedSrc' => $img_uploaded_src,
|
||||
'figureClassNames' => $figure_class_names,
|
||||
'figureStyles' => $figure_styles,
|
||||
'imgClassNames' => $img_class_names,
|
||||
'imgStyles' => $img_styles,
|
||||
'targetWidth' => $img_width,
|
||||
'targetHeight' => $img_height,
|
||||
'scaleAttr' => $block['attrs']['scale'] ?? false,
|
||||
'ariaLabel' => $aria_label,
|
||||
'alt' => $alt,
|
||||
),
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
$p->add_class( 'wp-lightbox-container' );
|
||||
$p->set_attribute( 'data-wp-interactive', 'core/image' );
|
||||
$p->set_attribute(
|
||||
'data-wp-context',
|
||||
wp_json_encode(
|
||||
array(
|
||||
'uploadedSrc' => $img_uploaded_src,
|
||||
'figureClassNames' => $figure_class_names,
|
||||
'figureStyles' => $figure_styles,
|
||||
'imgClassNames' => $img_class_names,
|
||||
'imgStyles' => $img_styles,
|
||||
'targetWidth' => $img_width,
|
||||
'targetHeight' => $img_height,
|
||||
'scaleAttr' => $block['attrs']['scale'] ?? false,
|
||||
'ariaLabel' => $aria_label,
|
||||
'alt' => $alt,
|
||||
'imageId' => $unique_image_id,
|
||||
),
|
||||
JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP
|
||||
)
|
||||
@ -215,6 +230,8 @@ function block_core_image_render_lightbox( $block_content, $block ) {
|
||||
// contain a caption, and we don't want to trigger the lightbox when the
|
||||
// caption is clicked.
|
||||
$p->set_attribute( 'data-wp-on-async--click', 'actions.showLightbox' );
|
||||
$p->set_attribute( 'data-wp-class--hide', 'state.isContentHidden' );
|
||||
$p->set_attribute( 'data-wp-class--show', 'state.isContentVisible' );
|
||||
|
||||
$body_content = $p->get_updated_html();
|
||||
|
||||
@ -231,8 +248,8 @@ function block_core_image_render_lightbox( $block_content, $block ) {
|
||||
aria-label="' . esc_attr( $aria_label ) . '"
|
||||
data-wp-init="callbacks.initTriggerButton"
|
||||
data-wp-on-async--click="actions.showLightbox"
|
||||
data-wp-style--right="context.imageButtonRight"
|
||||
data-wp-style--top="context.imageButtonTop"
|
||||
data-wp-style--right="state.imageButtonRight"
|
||||
data-wp-style--top="state.imageButtonTop"
|
||||
>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="none" viewBox="0 0 12 12">
|
||||
<path fill="#fff" d="M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z" />
|
||||
@ -288,15 +305,15 @@ function block_core_image_print_lightbox_overlay() {
|
||||
tabindex="-1"
|
||||
>
|
||||
<button type="button" aria-label="$close_button_label" style="fill: $close_button_color" class="close-button">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="20" height="20" aria-hidden="true" focusable="false"><path d="M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"></path></svg>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="20" height="20" aria-hidden="true" focusable="false"><path d="m13.06 12 6.47-6.47-1.06-1.06L12 10.94 5.53 4.47 4.47 5.53 10.94 12l-6.47 6.47 1.06 1.06L12 13.06l6.47 6.47 1.06-1.06L13.06 12Z"></path></svg>
|
||||
</button>
|
||||
<div class="lightbox-image-container">
|
||||
<figure data-wp-bind--class="state.currentImage.figureClassNames" data-wp-bind--style="state.currentImage.figureStyles">
|
||||
<figure data-wp-bind--class="state.currentImage.figureClassNames" data-wp-bind--style="state.figureStyles">
|
||||
<img data-wp-bind--alt="state.currentImage.alt" data-wp-bind--class="state.currentImage.imgClassNames" data-wp-bind--style="state.imgStyles" data-wp-bind--src="state.currentImage.currentSrc">
|
||||
</figure>
|
||||
</div>
|
||||
<div class="lightbox-image-container">
|
||||
<figure data-wp-bind--class="state.currentImage.figureClassNames" data-wp-bind--style="state.currentImage.figureStyles">
|
||||
<figure data-wp-bind--class="state.currentImage.figureClassNames" data-wp-bind--style="state.figureStyles">
|
||||
<img data-wp-bind--alt="state.currentImage.alt" data-wp-bind--class="state.currentImage.imgClassNames" data-wp-bind--style="state.imgStyles" data-wp-bind--src="state.enlargedSrc">
|
||||
</figure>
|
||||
</div>
|
||||
|
@ -9,6 +9,10 @@
|
||||
"keywords": [ "img", "photo", "picture" ],
|
||||
"textdomain": "default",
|
||||
"attributes": {
|
||||
"blob": {
|
||||
"type": "string",
|
||||
"__experimentalRole": "local"
|
||||
},
|
||||
"url": {
|
||||
"type": "string",
|
||||
"source": "attribute",
|
||||
@ -102,6 +106,9 @@
|
||||
"filter": {
|
||||
"duotone": true
|
||||
},
|
||||
"spacing": {
|
||||
"margin": true
|
||||
},
|
||||
"__experimentalBorder": {
|
||||
"color": true,
|
||||
"radius": true,
|
||||
|
@ -29,6 +29,15 @@
|
||||
},
|
||||
"supports": {
|
||||
"align": true,
|
||||
"color": {
|
||||
"gradients": true,
|
||||
"link": true,
|
||||
"__experimentalDefaultControls": {
|
||||
"background": true,
|
||||
"text": true,
|
||||
"link": true
|
||||
}
|
||||
},
|
||||
"html": false,
|
||||
"spacing": {
|
||||
"margin": true,
|
||||
|
@ -6,7 +6,7 @@
|
||||
"category": "text",
|
||||
"parent": [ "core/list" ],
|
||||
"allowedBlocks": [ "core/list" ],
|
||||
"description": "Create a list item.",
|
||||
"description": "An individual item within a list.",
|
||||
"textdomain": "default",
|
||||
"attributes": {
|
||||
"placeholder": {
|
||||
@ -20,9 +20,23 @@
|
||||
}
|
||||
},
|
||||
"supports": {
|
||||
"anchor": true,
|
||||
"className": false,
|
||||
"__experimentalSelector": ".wp-block-list > li",
|
||||
"splitting": true,
|
||||
"__experimentalBorder": {
|
||||
"color": true,
|
||||
"radius": true,
|
||||
"style": true,
|
||||
"width": true
|
||||
},
|
||||
"color": {
|
||||
"gradients": true,
|
||||
"link": true,
|
||||
"background": true,
|
||||
"__experimentalDefaultControls": {
|
||||
"text": true
|
||||
}
|
||||
},
|
||||
"spacing": {
|
||||
"margin": true,
|
||||
"padding": true,
|
||||
@ -47,5 +61,9 @@
|
||||
"interactivity": {
|
||||
"clientNavigation": true
|
||||
}
|
||||
},
|
||||
"selectors": {
|
||||
"root": ".wp-block-list > li",
|
||||
"border": ".wp-block-list:not(.wp-block-list .wp-block-list) > li"
|
||||
}
|
||||
}
|
||||
|
@ -5,7 +5,7 @@
|
||||
"title": "List",
|
||||
"category": "text",
|
||||
"allowedBlocks": [ "core/list-item" ],
|
||||
"description": "Create a bulleted or numbered list.",
|
||||
"description": "An organized collection of items displayed in a specific order.",
|
||||
"keywords": [ "bullet list", "ordered list", "numbered list" ],
|
||||
"textdomain": "default",
|
||||
"attributes": {
|
||||
@ -39,6 +39,12 @@
|
||||
"supports": {
|
||||
"anchor": true,
|
||||
"html": false,
|
||||
"__experimentalBorder": {
|
||||
"color": true,
|
||||
"radius": true,
|
||||
"style": true,
|
||||
"width": true
|
||||
},
|
||||
"typography": {
|
||||
"fontSize": true,
|
||||
"lineHeight": true,
|
||||
@ -75,6 +81,9 @@
|
||||
"clientNavigation": true
|
||||
}
|
||||
},
|
||||
"selectors": {
|
||||
"border": ".wp-block-list:not(.wp-block-list .wp-block-list)"
|
||||
},
|
||||
"editorStyle": "wp-block-list-editor",
|
||||
"style": "wp-block-list"
|
||||
}
|
||||
|
@ -17,8 +17,17 @@
|
||||
"default": true
|
||||
}
|
||||
},
|
||||
"example": {
|
||||
"viewportWidth": 350
|
||||
},
|
||||
"supports": {
|
||||
"className": true,
|
||||
"color": {
|
||||
"background": true,
|
||||
"text": false,
|
||||
"gradients": true,
|
||||
"link": true
|
||||
},
|
||||
"spacing": {
|
||||
"margin": true,
|
||||
"padding": true,
|
||||
@ -40,8 +49,15 @@
|
||||
"fontSize": true
|
||||
}
|
||||
},
|
||||
"__experimentalBorder": {
|
||||
"radius": true,
|
||||
"color": true,
|
||||
"width": true,
|
||||
"style": true
|
||||
},
|
||||
"interactivity": {
|
||||
"clientNavigation": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"style": "wp-block-loginout"
|
||||
}
|
||||
|
@ -29,15 +29,32 @@ function render_block_core_media_text( $attributes, $content ) {
|
||||
return $content;
|
||||
}
|
||||
|
||||
$has_media_on_right = isset( $attributes['mediaPosition'] ) && 'right' === $attributes['mediaPosition'];
|
||||
$image_fill = isset( $attributes['imageFill'] ) && $attributes['imageFill'];
|
||||
$focal_point = isset( $attributes['focalPoint'] ) ? round( $attributes['focalPoint']['x'] * 100 ) . '% ' . round( $attributes['focalPoint']['y'] * 100 ) . '%' : '50% 50%';
|
||||
$unique_id = 'wp-block-media-text__media-' . wp_unique_id();
|
||||
|
||||
$block_tag_processor = new WP_HTML_Tag_Processor( $content );
|
||||
$block_query = array(
|
||||
'tag_name' => 'div',
|
||||
'class_name' => 'wp-block-media-text',
|
||||
);
|
||||
|
||||
while ( $block_tag_processor->next_tag( $block_query ) ) {
|
||||
if ( $image_fill ) {
|
||||
// The markup below does not work with the deprecated `is-image-fill` class.
|
||||
$block_tag_processor->remove_class( 'is-image-fill' );
|
||||
$block_tag_processor->add_class( 'is-image-fill-element' );
|
||||
}
|
||||
}
|
||||
|
||||
$content = $block_tag_processor->get_updated_html();
|
||||
|
||||
$media_tag_processor = new WP_HTML_Tag_Processor( $content );
|
||||
$wrapping_figure_query = array(
|
||||
'tag_name' => 'figure',
|
||||
'class_name' => 'wp-block-media-text__media',
|
||||
);
|
||||
$has_media_on_right = isset( $attributes['mediaPosition'] ) && 'right' === $attributes['mediaPosition'];
|
||||
$image_fill = isset( $attributes['imageFill'] ) && $attributes['imageFill'];
|
||||
$focal_point = isset( $attributes['focalPoint'] ) ? round( $attributes['focalPoint']['x'] * 100 ) . '% ' . round( $attributes['focalPoint']['y'] * 100 ) . '%' : '50% 50%';
|
||||
$unique_id = 'wp-block-media-text__media-' . wp_unique_id();
|
||||
|
||||
if ( $has_media_on_right ) {
|
||||
// Loop through all the figure tags and set a bookmark on the last figure tag.
|
||||
@ -46,59 +63,52 @@ function render_block_core_media_text( $attributes, $content ) {
|
||||
}
|
||||
if ( $media_tag_processor->has_bookmark( 'last_figure' ) ) {
|
||||
$media_tag_processor->seek( 'last_figure' );
|
||||
if ( $image_fill ) {
|
||||
$media_tag_processor->set_attribute( 'style', 'background-image:url(' . esc_url( $current_featured_image ) . ');background-position:' . $focal_point . ';' );
|
||||
} else {
|
||||
// Insert a unique ID to identify the figure tag.
|
||||
$media_tag_processor->set_attribute( 'id', $unique_id );
|
||||
}
|
||||
// Insert a unique ID to identify the figure tag.
|
||||
$media_tag_processor->set_attribute( 'id', $unique_id );
|
||||
}
|
||||
} else {
|
||||
if ( $media_tag_processor->next_tag( $wrapping_figure_query ) ) {
|
||||
if ( $image_fill ) {
|
||||
$media_tag_processor->set_attribute( 'style', 'background-image:url(' . esc_url( $current_featured_image ) . ');background-position:' . $focal_point . ';' );
|
||||
} else {
|
||||
// Insert a unique ID to identify the figure tag.
|
||||
$media_tag_processor->set_attribute( 'id', $unique_id );
|
||||
}
|
||||
// Insert a unique ID to identify the figure tag.
|
||||
$media_tag_processor->set_attribute( 'id', $unique_id );
|
||||
}
|
||||
}
|
||||
|
||||
$content = $media_tag_processor->get_updated_html();
|
||||
|
||||
// If the image is not set to fill, add the image tag inside the figure tag,
|
||||
// and update the image attributes in order to display the featured image.
|
||||
if ( ! $image_fill ) {
|
||||
$media_size_slug = isset( $attributes['mediaSizeSlug'] ) ? $attributes['mediaSizeSlug'] : 'full';
|
||||
$image_tag = '<img class="wp-block-media-text__featured_image">';
|
||||
$content = preg_replace(
|
||||
'/(<figure\s+id="' . preg_quote( $unique_id, '/' ) . '"\s+class="wp-block-media-text__media"\s*>)/',
|
||||
'$1' . $image_tag,
|
||||
$content
|
||||
);
|
||||
// Add the image tag inside the figure tag, and update the image attributes
|
||||
// in order to display the featured image.
|
||||
$media_size_slug = isset( $attributes['mediaSizeSlug'] ) ? $attributes['mediaSizeSlug'] : 'full';
|
||||
$image_tag = '<img class="wp-block-media-text__featured_image">';
|
||||
$content = preg_replace(
|
||||
'/(<figure\s+id="' . preg_quote( $unique_id, '/' ) . '"\s+class="wp-block-media-text__media"\s*>)/',
|
||||
'$1' . $image_tag,
|
||||
$content
|
||||
);
|
||||
|
||||
$image_tag_processor = new WP_HTML_Tag_Processor( $content );
|
||||
$image_tag_processor = new WP_HTML_Tag_Processor( $content );
|
||||
if ( $image_tag_processor->next_tag(
|
||||
array(
|
||||
'tag_name' => 'figure',
|
||||
'id' => $unique_id,
|
||||
)
|
||||
) ) {
|
||||
// The ID is only used to ensure that the correct figure tag is selected,
|
||||
// and can now be removed.
|
||||
$image_tag_processor->remove_attribute( 'id' );
|
||||
if ( $image_tag_processor->next_tag(
|
||||
array(
|
||||
'tag_name' => 'figure',
|
||||
'id' => $unique_id,
|
||||
'tag_name' => 'img',
|
||||
'class_name' => 'wp-block-media-text__featured_image',
|
||||
)
|
||||
) ) {
|
||||
// The ID is only used to ensure that the correct figure tag is selected,
|
||||
// and can now be removed.
|
||||
$image_tag_processor->remove_attribute( 'id' );
|
||||
if ( $image_tag_processor->next_tag(
|
||||
array(
|
||||
'tag_name' => 'img',
|
||||
'class_name' => 'wp-block-media-text__featured_image',
|
||||
)
|
||||
) ) {
|
||||
$image_tag_processor->set_attribute( 'src', esc_url( $current_featured_image ) );
|
||||
$image_tag_processor->set_attribute( 'class', 'wp-image-' . get_post_thumbnail_id() . ' size-' . $media_size_slug );
|
||||
$image_tag_processor->set_attribute( 'alt', trim( strip_tags( get_post_meta( get_post_thumbnail_id(), '_wp_attachment_image_alt', true ) ) ) );
|
||||
|
||||
$content = $image_tag_processor->get_updated_html();
|
||||
$image_tag_processor->set_attribute( 'src', esc_url( $current_featured_image ) );
|
||||
$image_tag_processor->set_attribute( 'class', 'wp-image-' . get_post_thumbnail_id() . ' size-' . $media_size_slug );
|
||||
$image_tag_processor->set_attribute( 'alt', trim( strip_tags( get_post_meta( get_post_thumbnail_id(), '_wp_attachment_image_alt', true ) ) ) );
|
||||
if ( $image_fill ) {
|
||||
$image_tag_processor->set_attribute( 'style', 'object-position:' . $focal_point . ';' );
|
||||
}
|
||||
|
||||
$content = $image_tag_processor->get_updated_html();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -103,6 +103,18 @@
|
||||
"anchor": true,
|
||||
"align": [ "wide", "full" ],
|
||||
"html": false,
|
||||
"__experimentalBorder": {
|
||||
"color": true,
|
||||
"radius": true,
|
||||
"style": true,
|
||||
"width": true,
|
||||
"__experimentalDefaultControls": {
|
||||
"color": true,
|
||||
"radius": true,
|
||||
"style": true,
|
||||
"width": true
|
||||
}
|
||||
},
|
||||
"color": {
|
||||
"gradients": true,
|
||||
"heading": true,
|
||||
|
@ -59,6 +59,19 @@
|
||||
"supports": {
|
||||
"reusable": false,
|
||||
"html": false,
|
||||
"typography": {
|
||||
"fontSize": true,
|
||||
"lineHeight": true,
|
||||
"__experimentalFontFamily": true,
|
||||
"__experimentalFontWeight": true,
|
||||
"__experimentalFontStyle": true,
|
||||
"__experimentalTextTransform": true,
|
||||
"__experimentalTextDecoration": true,
|
||||
"__experimentalLetterSpacing": true,
|
||||
"__experimentalDefaultControls": {
|
||||
"fontSize": true
|
||||
}
|
||||
},
|
||||
"interactivity": {
|
||||
"clientNavigation": true
|
||||
}
|
||||
|
@ -241,13 +241,11 @@ class WP_Navigation_Block_Renderer {
|
||||
// it encounters whitespace. This code strips it.
|
||||
$blocks = block_core_navigation_filter_out_empty_blocks( $parsed_blocks );
|
||||
|
||||
if ( function_exists( 'set_ignored_hooked_blocks_metadata' ) ) {
|
||||
// Run Block Hooks algorithm to inject hooked blocks.
|
||||
$markup = block_core_navigation_insert_hooked_blocks( $blocks, $navigation_post );
|
||||
$root_nav_block = parse_blocks( $markup )[0];
|
||||
// Run Block Hooks algorithm to inject hooked blocks.
|
||||
$markup = block_core_navigation_insert_hooked_blocks( $blocks, $navigation_post );
|
||||
$root_nav_block = parse_blocks( $markup )[0];
|
||||
|
||||
$blocks = isset( $root_nav_block['innerBlocks'] ) ? $root_nav_block['innerBlocks'] : $blocks;
|
||||
}
|
||||
$blocks = isset( $root_nav_block['innerBlocks'] ) ? $root_nav_block['innerBlocks'] : $blocks;
|
||||
|
||||
// TODO - this uses the full navigation block attributes for the
|
||||
// context which could be refined.
|
||||
@ -483,7 +481,7 @@ class WP_Navigation_Block_Renderer {
|
||||
}
|
||||
}
|
||||
$toggle_button_content = $should_display_icon_label ? $toggle_button_icon : __( 'Menu' );
|
||||
$toggle_close_button_icon = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" aria-hidden="true" focusable="false"><path d="M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"></path></svg>';
|
||||
$toggle_close_button_icon = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" aria-hidden="true" focusable="false"><path d="m13.06 12 6.47-6.47-1.06-1.06L12 10.94 5.53 4.47 4.47 5.53 10.94 12l-6.47 6.47 1.06 1.06L12 13.06l6.47 6.47 1.06-1.06L13.06 12Z"></path></svg>';
|
||||
$toggle_close_button_content = $should_display_icon_label ? $toggle_close_button_icon : __( 'Close' );
|
||||
$toggle_aria_label_open = $should_display_icon_label ? 'aria-label="' . __( 'Open menu' ) . '"' : ''; // Open button label.
|
||||
$toggle_aria_label_close = $should_display_icon_label ? 'aria-label="' . __( 'Close menu' ) . '"' : ''; // Close button label.
|
||||
@ -626,7 +624,7 @@ class WP_Navigation_Block_Renderer {
|
||||
if ( static::is_interactive( $attributes, $inner_blocks ) ) {
|
||||
$suffix = wp_scripts_get_suffix();
|
||||
if ( defined( 'IS_GUTENBERG_PLUGIN' ) && IS_GUTENBERG_PLUGIN ) {
|
||||
$module_url = gutenberg_url( '/build/interactivity/navigation.min.js' );
|
||||
$module_url = gutenberg_url( '/build-module/block-library/navigation/view.min.js' );
|
||||
}
|
||||
|
||||
wp_register_script_module(
|
||||
@ -1083,15 +1081,13 @@ function block_core_navigation_get_fallback_blocks() {
|
||||
// In this case default to the (Page List) fallback.
|
||||
$fallback_blocks = ! empty( $maybe_fallback ) ? $maybe_fallback : $fallback_blocks;
|
||||
|
||||
if ( function_exists( 'set_ignored_hooked_blocks_metadata' ) ) {
|
||||
// Run Block Hooks algorithm to inject hooked blocks.
|
||||
// We have to run it here because we need the post ID of the Navigation block to track ignored hooked blocks.
|
||||
$markup = block_core_navigation_insert_hooked_blocks( $fallback_blocks, $navigation_post );
|
||||
$blocks = parse_blocks( $markup );
|
||||
// Run Block Hooks algorithm to inject hooked blocks.
|
||||
// We have to run it here because we need the post ID of the Navigation block to track ignored hooked blocks.
|
||||
$markup = block_core_navigation_insert_hooked_blocks( $fallback_blocks, $navigation_post );
|
||||
$blocks = parse_blocks( $markup );
|
||||
|
||||
if ( isset( $blocks[0]['innerBlocks'] ) ) {
|
||||
$fallback_blocks = $blocks[0]['innerBlocks'];
|
||||
}
|
||||
if ( isset( $blocks[0]['innerBlocks'] ) ) {
|
||||
$fallback_blocks = $blocks[0]['innerBlocks'];
|
||||
}
|
||||
}
|
||||
|
||||
@ -1621,26 +1617,15 @@ $rest_insert_wp_navigation_core_callback = 'block_core_navigation_' . 'update_ig
|
||||
/*
|
||||
* Do not add the `block_core_navigation_update_ignore_hooked_blocks_meta` filter in the following cases:
|
||||
* - If Core has added the `update_ignored_hooked_blocks_postmeta` filter already (WP >= 6.6);
|
||||
* - or if the `set_ignored_hooked_blocks_metadata` function is unavailable (which is required for the filter to work. It was introduced by WP 6.5 but is not present in Gutenberg's WP 6.5 compatibility layer);
|
||||
* - or if the `$rest_insert_wp_navigation_core_callback` filter has already been added.
|
||||
*/
|
||||
if (
|
||||
! has_filter( 'rest_pre_insert_wp_navigation', 'update_ignored_hooked_blocks_postmeta' ) &&
|
||||
function_exists( 'set_ignored_hooked_blocks_metadata' ) &&
|
||||
! has_filter( 'rest_pre_insert_wp_navigation', $rest_insert_wp_navigation_core_callback )
|
||||
) {
|
||||
add_filter( 'rest_pre_insert_wp_navigation', 'block_core_navigation_update_ignore_hooked_blocks_meta' );
|
||||
}
|
||||
|
||||
/*
|
||||
* Previous versions of Gutenberg were attaching the block_core_navigation_update_ignore_hooked_blocks_meta
|
||||
* function to the `rest_insert_wp_navigation` _action_ (rather than the `rest_pre_insert_wp_navigation` _filter_).
|
||||
* To avoid collisions, we need to remove the filter from that action if it's present.
|
||||
*/
|
||||
if ( has_filter( 'rest_insert_wp_navigation', $rest_insert_wp_navigation_core_callback ) ) {
|
||||
remove_filter( 'rest_insert_wp_navigation', $rest_insert_wp_navigation_core_callback );
|
||||
}
|
||||
|
||||
/**
|
||||
* Hooks into the REST API response for the core/navigation block and adds the first and last inner blocks.
|
||||
*
|
||||
@ -1678,12 +1663,10 @@ $rest_prepare_wp_navigation_core_callback = 'block_core_navigation_' . 'insert_h
|
||||
/*
|
||||
* Do not add the `block_core_navigation_insert_hooked_blocks_into_rest_response` filter in the following cases:
|
||||
* - If Core has added the `insert_hooked_blocks_into_rest_response` filter already (WP >= 6.6);
|
||||
* - or if the `set_ignored_hooked_blocks_metadata` function is unavailable (which is required for the filter to work. It was introduced by WP 6.5 but is not present in Gutenberg's WP 6.5 compatibility layer);
|
||||
* - or if the `$rest_prepare_wp_navigation_core_callback` filter has already been added.
|
||||
*/
|
||||
if (
|
||||
! has_filter( 'rest_prepare_wp_navigation', 'insert_hooked_blocks_into_rest_response' ) &&
|
||||
function_exists( 'set_ignored_hooked_blocks_metadata' ) &&
|
||||
! has_filter( 'rest_prepare_wp_navigation', $rest_prepare_wp_navigation_core_callback )
|
||||
) {
|
||||
add_filter( 'rest_prepare_wp_navigation', 'block_core_navigation_insert_hooked_blocks_into_rest_response', 10, 3 );
|
||||
|
@ -192,7 +192,9 @@ function block_core_page_list_render_nested_page_list( $open_submenus_on_click,
|
||||
$css_class .= ' menu-item-home';
|
||||
}
|
||||
|
||||
$title = wp_kses_post( $page['title'] );
|
||||
$title = wp_kses_post( $page['title'] );
|
||||
$title = $title ? $title : __( '(no title)' );
|
||||
|
||||
$aria_label = sprintf(
|
||||
/* translators: Accessibility text. %s: Parent page title. */
|
||||
__( '%s submenu' ),
|
||||
|
@ -33,6 +33,12 @@
|
||||
"splitting": true,
|
||||
"anchor": true,
|
||||
"className": false,
|
||||
"__experimentalBorder": {
|
||||
"color": true,
|
||||
"radius": true,
|
||||
"style": true,
|
||||
"width": true
|
||||
},
|
||||
"color": {
|
||||
"gradients": true,
|
||||
"link": true,
|
||||
|
@ -12,6 +12,9 @@
|
||||
}
|
||||
},
|
||||
"usesContext": [ "postType", "postId" ],
|
||||
"example": {
|
||||
"viewportWidth": 350
|
||||
},
|
||||
"supports": {
|
||||
"spacing": {
|
||||
"margin": true,
|
||||
@ -40,6 +43,19 @@
|
||||
},
|
||||
"interactivity": {
|
||||
"clientNavigation": true
|
||||
},
|
||||
"__experimentalBorder": {
|
||||
"radius": true,
|
||||
"color": true,
|
||||
"width": true,
|
||||
"style": true,
|
||||
"__experimentalDefaultControls": {
|
||||
"radius": true,
|
||||
"color": true,
|
||||
"width": true,
|
||||
"style": true
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"style": "wp-block-post-author-biography"
|
||||
}
|
||||
|
@ -20,6 +20,9 @@
|
||||
}
|
||||
},
|
||||
"usesContext": [ "postType", "postId" ],
|
||||
"example": {
|
||||
"viewportWidth": 350
|
||||
},
|
||||
"supports": {
|
||||
"html": false,
|
||||
"spacing": {
|
||||
@ -50,6 +53,19 @@
|
||||
},
|
||||
"interactivity": {
|
||||
"clientNavigation": true
|
||||
},
|
||||
"__experimentalBorder": {
|
||||
"radius": true,
|
||||
"color": true,
|
||||
"width": true,
|
||||
"style": true,
|
||||
"__experimentalDefaultControls": {
|
||||
"radius": true,
|
||||
"color": true,
|
||||
"width": true,
|
||||
"style": true
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"style": "wp-block-post-author-name"
|
||||
}
|
||||
|
@ -64,7 +64,20 @@
|
||||
},
|
||||
"interactivity": {
|
||||
"clientNavigation": true
|
||||
},
|
||||
"__experimentalBorder": {
|
||||
"radius": true,
|
||||
"color": true,
|
||||
"width": true,
|
||||
"style": true,
|
||||
"__experimentalDefaultControls": {
|
||||
"radius": true,
|
||||
"color": true,
|
||||
"width": true,
|
||||
"style": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"editorStyle": "wp-block-post-author-editor",
|
||||
"style": "wp-block-post-author"
|
||||
}
|
||||
|
@ -37,6 +37,18 @@
|
||||
"__experimentalDefaultControls": {
|
||||
"fontSize": true
|
||||
}
|
||||
},
|
||||
"__experimentalBorder": {
|
||||
"radius": true,
|
||||
"color": true,
|
||||
"width": true,
|
||||
"style": true,
|
||||
"__experimentalDefaultControls": {
|
||||
"radius": true,
|
||||
"color": true,
|
||||
"width": true,
|
||||
"style": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"editorStyle": "wp-block-post-comments-form-editor",
|
||||
|
@ -7,15 +7,30 @@
|
||||
"description": "Displays the contents of a post or page.",
|
||||
"textdomain": "default",
|
||||
"usesContext": [ "postId", "postType", "queryId" ],
|
||||
"example": {
|
||||
"viewportWidth": 350
|
||||
},
|
||||
"supports": {
|
||||
"align": [ "wide", "full" ],
|
||||
"html": false,
|
||||
"layout": true,
|
||||
"background": {
|
||||
"backgroundImage": true,
|
||||
"backgroundSize": true,
|
||||
"__experimentalDefaultControls": {
|
||||
"backgroundImage": true
|
||||
}
|
||||
},
|
||||
"dimensions": {
|
||||
"minHeight": true
|
||||
},
|
||||
"spacing": {
|
||||
"blockGap": true
|
||||
"blockGap": true,
|
||||
"padding": true,
|
||||
"__experimentalDefaultControls": {
|
||||
"margin": false,
|
||||
"padding": false
|
||||
}
|
||||
},
|
||||
"color": {
|
||||
"gradients": true,
|
||||
@ -39,5 +54,6 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"style": "wp-block-post-content",
|
||||
"editorStyle": "wp-block-post-content-editor"
|
||||
}
|
||||
|
@ -20,8 +20,20 @@ function render_block_core_post_date( $attributes, $content, $block ) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$post_ID = $block->context['postId'];
|
||||
$formatted_date = get_the_date( empty( $attributes['format'] ) ? '' : $attributes['format'], $post_ID );
|
||||
$post_ID = $block->context['postId'];
|
||||
|
||||
if ( isset( $attributes['format'] ) && 'human-diff' === $attributes['format'] ) {
|
||||
$post_timestamp = get_post_timestamp( $post_ID );
|
||||
if ( $post_timestamp > time() ) {
|
||||
// translators: %s: human-readable time difference.
|
||||
$formatted_date = sprintf( __( '%s from now' ), human_time_diff( $post_timestamp ) );
|
||||
} else {
|
||||
// translators: %s: human-readable time difference.
|
||||
$formatted_date = sprintf( __( '%s ago' ), human_time_diff( $post_timestamp ) );
|
||||
}
|
||||
} else {
|
||||
$formatted_date = get_the_date( empty( $attributes['format'] ) ? '' : $attributes['format'], $post_ID );
|
||||
}
|
||||
$unformatted_date = esc_attr( get_the_date( 'c', $post_ID ) );
|
||||
$classes = array();
|
||||
|
||||
@ -38,7 +50,12 @@ function render_block_core_post_date( $attributes, $content, $block ) {
|
||||
*/
|
||||
if ( isset( $attributes['displayType'] ) && 'modified' === $attributes['displayType'] ) {
|
||||
if ( get_the_modified_date( 'Ymdhi', $post_ID ) > get_the_date( 'Ymdhi', $post_ID ) ) {
|
||||
$formatted_date = get_the_modified_date( empty( $attributes['format'] ) ? '' : $attributes['format'], $post_ID );
|
||||
if ( isset( $attributes['format'] ) && 'human-diff' === $attributes['format'] ) {
|
||||
// translators: %s: human-readable time difference.
|
||||
$formatted_date = sprintf( __( '%s ago' ), human_time_diff( get_post_timestamp( $post_ID, 'modified' ) ) );
|
||||
} else {
|
||||
$formatted_date = get_the_modified_date( empty( $attributes['format'] ) ? '' : $attributes['format'], $post_ID );
|
||||
}
|
||||
$unformatted_date = esc_attr( get_the_modified_date( 'c', $post_ID ) );
|
||||
$classes[] = 'wp-block-post-date__modified-date';
|
||||
} else {
|
||||
|
@ -23,6 +23,9 @@
|
||||
}
|
||||
},
|
||||
"usesContext": [ "postId", "postType", "queryId" ],
|
||||
"example": {
|
||||
"viewportWidth": 350
|
||||
},
|
||||
"supports": {
|
||||
"html": false,
|
||||
"color": {
|
||||
@ -53,6 +56,18 @@
|
||||
},
|
||||
"interactivity": {
|
||||
"clientNavigation": true
|
||||
},
|
||||
"__experimentalBorder": {
|
||||
"radius": true,
|
||||
"color": true,
|
||||
"width": true,
|
||||
"style": true,
|
||||
"__experimentalDefaultControls": {
|
||||
"radius": true,
|
||||
"color": true,
|
||||
"width": true,
|
||||
"style": true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -23,6 +23,9 @@
|
||||
}
|
||||
},
|
||||
"usesContext": [ "postId", "postType", "queryId" ],
|
||||
"example": {
|
||||
"viewportWidth": 350
|
||||
},
|
||||
"supports": {
|
||||
"html": false,
|
||||
"color": {
|
||||
@ -53,6 +56,18 @@
|
||||
},
|
||||
"interactivity": {
|
||||
"clientNavigation": true
|
||||
},
|
||||
"__experimentalBorder": {
|
||||
"radius": true,
|
||||
"color": true,
|
||||
"width": true,
|
||||
"style": true,
|
||||
"__experimentalDefaultControls": {
|
||||
"radius": true,
|
||||
"color": true,
|
||||
"width": true,
|
||||
"style": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"editorStyle": "wp-block-post-excerpt-editor",
|
||||
|
@ -58,6 +58,9 @@
|
||||
}
|
||||
},
|
||||
"usesContext": [ "postId", "postType", "queryId" ],
|
||||
"example": {
|
||||
"viewportWidth": 350
|
||||
},
|
||||
"supports": {
|
||||
"align": [ "left", "right", "center", "wide", "full" ],
|
||||
"color": {
|
||||
|
@ -64,6 +64,11 @@ function render_block_core_post_template( $attributes, $content, $block ) {
|
||||
if ( in_the_loop() ) {
|
||||
$query = clone $wp_query;
|
||||
$query->rewind_posts();
|
||||
|
||||
// If in a single post of any post type, default to the 'post' post type.
|
||||
if ( is_singular() ) {
|
||||
query_posts( array( 'post_type' => 'post' ) );
|
||||
}
|
||||
} else {
|
||||
$query = $wp_query;
|
||||
}
|
||||
|
@ -27,6 +27,9 @@
|
||||
}
|
||||
},
|
||||
"usesContext": [ "postId", "postType" ],
|
||||
"example": {
|
||||
"viewportWidth": 350
|
||||
},
|
||||
"supports": {
|
||||
"html": false,
|
||||
"color": {
|
||||
@ -57,6 +60,18 @@
|
||||
},
|
||||
"interactivity": {
|
||||
"clientNavigation": true
|
||||
},
|
||||
"__experimentalBorder": {
|
||||
"radius": true,
|
||||
"color": true,
|
||||
"width": true,
|
||||
"style": true,
|
||||
"__experimentalDefaultControls": {
|
||||
"radius": true,
|
||||
"color": true,
|
||||
"width": true,
|
||||
"style": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"style": "wp-block-post-terms"
|
||||
|
@ -15,6 +15,9 @@
|
||||
"type": "number",
|
||||
"default": 2
|
||||
},
|
||||
"levelOptions": {
|
||||
"type": "array"
|
||||
},
|
||||
"isLink": {
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
@ -29,6 +32,9 @@
|
||||
"default": "_self"
|
||||
}
|
||||
},
|
||||
"example": {
|
||||
"viewportWidth": 350
|
||||
},
|
||||
"supports": {
|
||||
"align": [ "wide", "full" ],
|
||||
"html": false,
|
||||
@ -60,6 +66,18 @@
|
||||
},
|
||||
"interactivity": {
|
||||
"clientNavigation": true
|
||||
},
|
||||
"__experimentalBorder": {
|
||||
"radius": true,
|
||||
"color": true,
|
||||
"width": true,
|
||||
"style": true,
|
||||
"__experimentalDefaultControls": {
|
||||
"radius": true,
|
||||
"color": true,
|
||||
"width": true,
|
||||
"style": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"style": "wp-block-post-title"
|
||||
|
@ -43,6 +43,18 @@
|
||||
},
|
||||
"interactivity": {
|
||||
"clientNavigation": true
|
||||
},
|
||||
"__experimentalBorder": {
|
||||
"radius": true,
|
||||
"color": true,
|
||||
"width": true,
|
||||
"style": true,
|
||||
"__experimentalDefaultControls": {
|
||||
"radius": true,
|
||||
"color": true,
|
||||
"width": true,
|
||||
"style": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"style": "wp-block-preformatted"
|
||||
|
@ -26,6 +26,13 @@
|
||||
"supports": {
|
||||
"anchor": true,
|
||||
"align": [ "left", "right", "wide", "full" ],
|
||||
"background": {
|
||||
"backgroundImage": true,
|
||||
"backgroundSize": true,
|
||||
"__experimentalDefaultControls": {
|
||||
"backgroundImage": true
|
||||
}
|
||||
},
|
||||
"color": {
|
||||
"gradients": true,
|
||||
"background": true,
|
||||
@ -35,6 +42,12 @@
|
||||
"text": true
|
||||
}
|
||||
},
|
||||
"dimensions": {
|
||||
"minHeight": true,
|
||||
"__experimentalDefaultControls": {
|
||||
"minHeight": false
|
||||
}
|
||||
},
|
||||
"spacing": {
|
||||
"margin": true,
|
||||
"padding": true
|
||||
|
@ -17,6 +17,9 @@
|
||||
"type": "number",
|
||||
"default": 1
|
||||
},
|
||||
"levelOptions": {
|
||||
"type": "array"
|
||||
},
|
||||
"showPrefix": {
|
||||
"type": "boolean",
|
||||
"default": true
|
||||
@ -55,6 +58,18 @@
|
||||
},
|
||||
"interactivity": {
|
||||
"clientNavigation": true
|
||||
},
|
||||
"__experimentalBorder": {
|
||||
"radius": true,
|
||||
"color": true,
|
||||
"width": true,
|
||||
"style": true,
|
||||
"__experimentalDefaultControls": {
|
||||
"radius": true,
|
||||
"color": true,
|
||||
"width": true,
|
||||
"style": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"style": "wp-block-query-title"
|
||||
|
@ -26,7 +26,7 @@ function render_block_core_query( $attributes, $content, $block ) {
|
||||
if ( $is_interactive ) {
|
||||
$suffix = wp_scripts_get_suffix();
|
||||
if ( defined( 'IS_GUTENBERG_PLUGIN' ) && IS_GUTENBERG_PLUGIN ) {
|
||||
$module_url = gutenberg_url( '/build/interactivity/query.min.js' );
|
||||
$module_url = gutenberg_url( '/build-module/block-library/query/view.min.js' );
|
||||
}
|
||||
|
||||
wp_register_script_module(
|
||||
|
@ -25,7 +25,8 @@
|
||||
"sticky": "",
|
||||
"inherit": true,
|
||||
"taxQuery": null,
|
||||
"parents": []
|
||||
"parents": [],
|
||||
"format": []
|
||||
}
|
||||
},
|
||||
"tagName": {
|
||||
@ -40,6 +41,7 @@
|
||||
"default": false
|
||||
}
|
||||
},
|
||||
"usesContext": [ "postType" ],
|
||||
"providesContext": {
|
||||
"queryId": "queryId",
|
||||
"query": "query",
|
||||
|
@ -28,7 +28,33 @@
|
||||
},
|
||||
"supports": {
|
||||
"anchor": true,
|
||||
"align": [ "left", "right", "wide", "full" ],
|
||||
"html": false,
|
||||
"background": {
|
||||
"backgroundImage": true,
|
||||
"backgroundSize": true,
|
||||
"__experimentalDefaultControls": {
|
||||
"backgroundImage": true
|
||||
}
|
||||
},
|
||||
"__experimentalBorder": {
|
||||
"color": true,
|
||||
"radius": true,
|
||||
"style": true,
|
||||
"width": true,
|
||||
"__experimentalDefaultControls": {
|
||||
"color": true,
|
||||
"radius": true,
|
||||
"style": true,
|
||||
"width": true
|
||||
}
|
||||
},
|
||||
"dimensions": {
|
||||
"minHeight": true,
|
||||
"__experimentalDefaultControls": {
|
||||
"minHeight": false
|
||||
}
|
||||
},
|
||||
"__experimentalOnEnter": true,
|
||||
"__experimentalOnMerge": true,
|
||||
"typography": {
|
||||
@ -57,7 +83,9 @@
|
||||
"allowEditing": false
|
||||
},
|
||||
"spacing": {
|
||||
"blockGap": true
|
||||
"blockGap": true,
|
||||
"padding": true,
|
||||
"margin": true
|
||||
},
|
||||
"interactivity": {
|
||||
"clientNavigation": true
|
||||
|
@ -82,7 +82,7 @@ function render_block_core_search( $attributes ) {
|
||||
if ( $is_expandable_searchfield ) {
|
||||
$suffix = wp_scripts_get_suffix();
|
||||
if ( defined( 'IS_GUTENBERG_PLUGIN' ) && IS_GUTENBERG_PLUGIN ) {
|
||||
$module_url = gutenberg_url( '/build/interactivity/search.min.js' );
|
||||
$module_url = gutenberg_url( '/build-module/block-library/search/view.min.js' );
|
||||
}
|
||||
|
||||
wp_register_script_module(
|
||||
|
@ -85,6 +85,9 @@
|
||||
"width": true
|
||||
}
|
||||
},
|
||||
"spacing": {
|
||||
"margin": true
|
||||
},
|
||||
"html": false
|
||||
},
|
||||
"editorStyle": "wp-block-search-editor",
|
||||
|
@ -159,6 +159,8 @@ add_filter( 'pre_set_theme_mod_custom_logo', '_sync_custom_logo_to_site_logo' );
|
||||
*
|
||||
* @since 5.8.0
|
||||
*
|
||||
* @global array $_ignore_site_logo_changes
|
||||
*
|
||||
* @param array $old_value Previous theme mod settings.
|
||||
* @param array $value Updated theme mod settings.
|
||||
*/
|
||||
@ -179,6 +181,8 @@ function _delete_site_logo_on_remove_custom_logo( $old_value, $value ) {
|
||||
* Deletes the site logo when all theme mods are being removed.
|
||||
*
|
||||
* @since 5.8.0
|
||||
*
|
||||
* @global array $_ignore_site_logo_changes
|
||||
*/
|
||||
function _delete_site_logo_on_remove_theme_mods() {
|
||||
global $_ignore_site_logo_changes;
|
||||
@ -211,6 +215,8 @@ add_action( 'setup_theme', '_delete_site_logo_on_remove_custom_logo_on_setup_the
|
||||
* Removes the custom_logo theme-mod when the site_logo option gets deleted.
|
||||
*
|
||||
* @since 5.9.0
|
||||
*
|
||||
* @global array $_ignore_site_logo_changes
|
||||
*/
|
||||
function _delete_custom_logo_on_remove_site_logo() {
|
||||
global $_ignore_site_logo_changes;
|
||||
|
@ -14,9 +14,18 @@
|
||||
"level": {
|
||||
"type": "number",
|
||||
"default": 0
|
||||
},
|
||||
"levelOptions": {
|
||||
"type": "array",
|
||||
"default": [ 0, 1, 2, 3, 4, 5, 6 ]
|
||||
}
|
||||
},
|
||||
"example": {
|
||||
"viewportWidth": 350,
|
||||
"attributes": {
|
||||
"textAlign": "center"
|
||||
}
|
||||
},
|
||||
"example": {},
|
||||
"supports": {
|
||||
"align": [ "wide", "full" ],
|
||||
"html": false,
|
||||
@ -44,13 +53,21 @@
|
||||
"__experimentalFontStyle": true,
|
||||
"__experimentalFontWeight": true,
|
||||
"__experimentalLetterSpacing": true,
|
||||
"__experimentalWritingMode": true,
|
||||
"__experimentalDefaultControls": {
|
||||
"fontSize": true
|
||||
}
|
||||
},
|
||||
"interactivity": {
|
||||
"clientNavigation": true
|
||||
},
|
||||
"__experimentalBorder": {
|
||||
"radius": true,
|
||||
"color": true,
|
||||
"width": true,
|
||||
"style": true
|
||||
}
|
||||
},
|
||||
"editorStyle": "wp-block-site-tagline-editor"
|
||||
"editorStyle": "wp-block-site-tagline-editor",
|
||||
"style": "wp-block-site-tagline"
|
||||
}
|
||||
|
@ -11,6 +11,10 @@
|
||||
"type": "number",
|
||||
"default": 1
|
||||
},
|
||||
"levelOptions": {
|
||||
"type": "array",
|
||||
"default": [ 0, 1, 2, 3, 4, 5, 6 ]
|
||||
},
|
||||
"textAlign": {
|
||||
"type": "string"
|
||||
},
|
||||
@ -55,12 +59,19 @@
|
||||
"__experimentalFontStyle": true,
|
||||
"__experimentalFontWeight": true,
|
||||
"__experimentalLetterSpacing": true,
|
||||
"__experimentalWritingMode": true,
|
||||
"__experimentalDefaultControls": {
|
||||
"fontSize": true
|
||||
}
|
||||
},
|
||||
"interactivity": {
|
||||
"clientNavigation": true
|
||||
},
|
||||
"__experimentalBorder": {
|
||||
"radius": true,
|
||||
"color": true,
|
||||
"width": true,
|
||||
"style": true
|
||||
}
|
||||
},
|
||||
"editorStyle": "wp-block-site-title-editor",
|
||||
|
@ -81,6 +81,18 @@
|
||||
},
|
||||
"interactivity": {
|
||||
"clientNavigation": true
|
||||
},
|
||||
"__experimentalBorder": {
|
||||
"radius": true,
|
||||
"color": true,
|
||||
"width": true,
|
||||
"style": true,
|
||||
"__experimentalDefaultControls": {
|
||||
"radius": true,
|
||||
"color": true,
|
||||
"width": true,
|
||||
"style": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"styles": [
|
||||
|
@ -29,8 +29,13 @@ function render_block_core_tag_cloud( $attributes ) {
|
||||
);
|
||||
$tag_cloud = wp_tag_cloud( $args );
|
||||
|
||||
if ( ! $tag_cloud ) {
|
||||
$tag_cloud = __( 'There’s no content to show here yet.' );
|
||||
if ( empty( $tag_cloud ) ) {
|
||||
// Display placeholder content when there are no tags only in editor.
|
||||
if ( wp_is_serving_rest_request() ) {
|
||||
$tag_cloud = __( 'There’s no content to show here yet.' );
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
$wrapper_attributes = get_block_wrapper_attributes();
|
||||
|
@ -4,7 +4,7 @@
|
||||
"name": "core/tag-cloud",
|
||||
"title": "Tag Cloud",
|
||||
"category": "widgets",
|
||||
"description": "A cloud of your most used tags.",
|
||||
"description": "A cloud of popular keywords, each sized by how often it appears.",
|
||||
"textdomain": "default",
|
||||
"attributes": {
|
||||
"numberOfTags": {
|
||||
@ -51,6 +51,18 @@
|
||||
},
|
||||
"interactivity": {
|
||||
"clientNavigation": true
|
||||
},
|
||||
"__experimentalBorder": {
|
||||
"radius": true,
|
||||
"color": true,
|
||||
"width": true,
|
||||
"style": true,
|
||||
"__experimentalDefaultControls": {
|
||||
"radius": true,
|
||||
"color": true,
|
||||
"width": true,
|
||||
"style": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"editorStyle": "wp-block-tag-cloud-editor"
|
||||
|
@ -40,6 +40,18 @@
|
||||
},
|
||||
"interactivity": {
|
||||
"clientNavigation": true
|
||||
},
|
||||
"__experimentalBorder": {
|
||||
"radius": true,
|
||||
"color": true,
|
||||
"width": true,
|
||||
"style": true,
|
||||
"__experimentalDefaultControls": {
|
||||
"radius": true,
|
||||
"color": true,
|
||||
"width": true,
|
||||
"style": true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -21,6 +21,13 @@
|
||||
},
|
||||
"supports": {
|
||||
"anchor": true,
|
||||
"background": {
|
||||
"backgroundImage": true,
|
||||
"backgroundSize": true,
|
||||
"__experimentalDefaultControls": {
|
||||
"backgroundImage": true
|
||||
}
|
||||
},
|
||||
"color": {
|
||||
"gradients": true,
|
||||
"link": true,
|
||||
@ -29,6 +36,12 @@
|
||||
"text": true
|
||||
}
|
||||
},
|
||||
"dimensions": {
|
||||
"minHeight": true,
|
||||
"__experimentalDefaultControls": {
|
||||
"minHeight": false
|
||||
}
|
||||
},
|
||||
"typography": {
|
||||
"fontSize": true,
|
||||
"__experimentalFontFamily": true,
|
||||
@ -38,6 +51,7 @@
|
||||
"__experimentalLetterSpacing": true,
|
||||
"__experimentalTextTransform": true,
|
||||
"__experimentalTextDecoration": true,
|
||||
"__experimentalWritingMode": true,
|
||||
"__experimentalDefaultControls": {
|
||||
"fontSize": true
|
||||
}
|
||||
|
@ -56,6 +56,10 @@
|
||||
"attribute": "preload",
|
||||
"default": "metadata"
|
||||
},
|
||||
"blob": {
|
||||
"type": "string",
|
||||
"__experimentalRole": "local"
|
||||
},
|
||||
"src": {
|
||||
"type": "string",
|
||||
"source": "attribute",
|
||||
|
@ -65,8 +65,9 @@ class WP_Block_Parser_Frame {
|
||||
* @param WP_Block_Parser_Block $block Full or partial block.
|
||||
* @param int $token_start Byte offset into document for start of parse token.
|
||||
* @param int $token_length Byte length of entire parse token string.
|
||||
* @param int $prev_offset Byte offset into document for after parse token ends.
|
||||
* @param int $leading_html_start Byte offset into document where leading HTML before token starts.
|
||||
* @param int|null $prev_offset Optional. Byte offset into document for after parse token ends. Default null.
|
||||
* @param int|null $leading_html_start Optional. Byte offset into document where leading HTML before token starts.
|
||||
* Default null.
|
||||
*/
|
||||
public function __construct( $block, $token_start, $token_length, $prev_offset = null, $leading_html_start = null ) {
|
||||
$this->block = $block;
|
||||
|
Loading…
x
Reference in New Issue
Block a user