From b1f0971ee32790ae2fdd26b186c1cac847c44144 Mon Sep 17 00:00:00 2001 From: Peter Wilson Date: Tue, 6 Jul 2021 23:55:44 +0000 Subject: [PATCH] Block Editor: Update packages with latest fixes for 5.8 RC2 Includes the following fixes: - Query Block: Type validation of `WP_Query` parameters. Props ntsekouras, stevehenty, peterwilsoncc, desrosj. Fixes #53397. git-svn-id: https://develop.svn.wordpress.org/trunk@51362 602fd350-edb4-49c9-b593-d223f7449a82 --- package-lock.json | 38 ++++++------ package.json | 10 ++-- .../assets/script-loader-packages.php | 2 +- src/wp-includes/blocks.php | 58 ++++++++++++++----- src/wp-includes/blocks/post-terms.php | 4 ++ 5 files changed, 72 insertions(+), 40 deletions(-) diff --git a/package-lock.json b/package-lock.json index 162b8d3622ec8..af003fcddeb53 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3259,9 +3259,9 @@ } }, "@wordpress/block-directory": { - "version": "2.1.15", - "resolved": "https://registry.npmjs.org/@wordpress/block-directory/-/block-directory-2.1.15.tgz", - "integrity": "sha512-qIYuPyxJZIN9xk9+CL27bDUHKZXtuB5EWZjwom8ACBg/xKfb2ffun38Oz+B1tIO9rrk3QRP5QNWZmZu5z5YzNA==", + "version": "2.1.16", + "resolved": "https://registry.npmjs.org/@wordpress/block-directory/-/block-directory-2.1.16.tgz", + "integrity": "sha512-Rbtzf6RM+c/G5z8uujKdPxvd8SKggJSQROR1cb1bUqIKuHN1CwZ8sUO+bba0sQts7eJGwIXcQqgM4DqopShVVw==", "requires": { "@babel/runtime": "^7.13.10", "@wordpress/a11y": "^3.1.1", @@ -3273,7 +3273,7 @@ "@wordpress/core-data": "^3.1.9", "@wordpress/data": "^5.1.3", "@wordpress/data-controls": "^2.1.3", - "@wordpress/edit-post": "^4.1.15", + "@wordpress/edit-post": "^4.1.16", "@wordpress/editor": "^10.1.12", "@wordpress/element": "^3.1.1", "@wordpress/hooks": "^3.1.1", @@ -3332,9 +3332,9 @@ } }, "@wordpress/block-library": { - "version": "3.2.13", - "resolved": "https://registry.npmjs.org/@wordpress/block-library/-/block-library-3.2.13.tgz", - "integrity": "sha512-yNIocJc/hvqSKn1Xq9Pge28OZ0rOm99crsQQiv/BdDdBW/h8GKNhqd4g/4LrbX2XUrw+X5Z7QsRPQaivhqcdWw==", + "version": "3.2.14", + "resolved": "https://registry.npmjs.org/@wordpress/block-library/-/block-library-3.2.14.tgz", + "integrity": "sha512-MBQJm07U5fxQgnEw09HV1zXbtM1qQ9yc4l3Tsxbl65v4rWyx3p/5BhuWhkO45bWx9+6ynLeQu1Hjxsqbax6zww==", "requires": { "@babel/runtime": "^7.13.10", "@wordpress/a11y": "^3.1.1", @@ -3512,14 +3512,14 @@ } }, "@wordpress/customize-widgets": { - "version": "1.0.14", - "resolved": "https://registry.npmjs.org/@wordpress/customize-widgets/-/customize-widgets-1.0.14.tgz", - "integrity": "sha512-ESKa6VE3lYi7UhpQgjXw/Ty4gA5vKW6+Ojn5wVlQUWwiSh4vcVnz6nSbAADkILWW/F7VyqYzN4znZag0D3ooAA==", + "version": "1.0.15", + "resolved": "https://registry.npmjs.org/@wordpress/customize-widgets/-/customize-widgets-1.0.15.tgz", + "integrity": "sha512-8cn7cShujx2sJc/eWfB7LcMrG50KyFEyH/M5DlW2v23Rxh/hmcYyhqREFC0EaFPapUT5bYS9MYUnAFxQOmNlJA==", "requires": { "@babel/runtime": "^7.11.2", "@wordpress/a11y": "^3.1.1", "@wordpress/block-editor": "^6.1.9", - "@wordpress/block-library": "^3.2.13", + "@wordpress/block-library": "^3.2.14", "@wordpress/blocks": "^9.1.5", "@wordpress/components": "^14.1.6", "@wordpress/compose": "^4.1.3", @@ -3649,15 +3649,15 @@ } }, "@wordpress/edit-post": { - "version": "4.1.15", - "resolved": "https://registry.npmjs.org/@wordpress/edit-post/-/edit-post-4.1.15.tgz", - "integrity": "sha512-AIy9z9uI8gdu3mupgip41ccuYiBXhj0Ssu2uWAvjvwcNQZR1aDc3cTK0YRDO8qwinF/ykiduSMPdmHtH8QwFsA==", + "version": "4.1.16", + "resolved": "https://registry.npmjs.org/@wordpress/edit-post/-/edit-post-4.1.16.tgz", + "integrity": "sha512-M2dhp6UVXdPS0axuqDLid9irT2y2cKoik7rRxRErD5mhqs+yBFAka0e2oJXeU/mWa2YUxh6WcuRP5ufxhzBbzw==", "requires": { "@babel/runtime": "^7.13.10", "@wordpress/a11y": "^3.1.1", "@wordpress/api-fetch": "^5.1.1", "@wordpress/block-editor": "^6.1.9", - "@wordpress/block-library": "^3.2.13", + "@wordpress/block-library": "^3.2.14", "@wordpress/blocks": "^9.1.5", "@wordpress/components": "^14.1.6", "@wordpress/compose": "^4.1.3", @@ -3695,15 +3695,15 @@ } }, "@wordpress/edit-widgets": { - "version": "2.1.15", - "resolved": "https://registry.npmjs.org/@wordpress/edit-widgets/-/edit-widgets-2.1.15.tgz", - "integrity": "sha512-5tmg4HJBhmtathIyro1xbHAU4F4numbjQ2pEksRFJTFZoEPvesgyRVIogt7/rVajI4QokCgV/R/7b6laE1VwMw==", + "version": "2.1.16", + "resolved": "https://registry.npmjs.org/@wordpress/edit-widgets/-/edit-widgets-2.1.16.tgz", + "integrity": "sha512-F+1hKhKFjMO5ZKLSU4bmnrC0bpgwX/qtlQsRshHSveyV6ZL2eMJZPE+BXN+x9JaM4VN2l2aGrlmo0wyhj6I37A==", "requires": { "@babel/runtime": "^7.13.10", "@wordpress/a11y": "^3.1.1", "@wordpress/api-fetch": "^5.1.1", "@wordpress/block-editor": "^6.1.9", - "@wordpress/block-library": "^3.2.13", + "@wordpress/block-library": "^3.2.14", "@wordpress/blocks": "^9.1.5", "@wordpress/components": "^14.1.6", "@wordpress/compose": "^4.1.3", diff --git a/package.json b/package.json index 63956158794e9..32d29f6b70325 100644 --- a/package.json +++ b/package.json @@ -82,23 +82,23 @@ "@wordpress/api-fetch": "5.1.1", "@wordpress/autop": "3.1.1", "@wordpress/blob": "3.1.1", - "@wordpress/block-directory": "2.1.15", + "@wordpress/block-directory": "2.1.16", "@wordpress/block-editor": "6.1.9", - "@wordpress/block-library": "3.2.13", + "@wordpress/block-library": "3.2.14", "@wordpress/block-serialization-default-parser": "4.1.1", "@wordpress/blocks": "9.1.5", "@wordpress/components": "14.1.6", "@wordpress/compose": "4.1.3", "@wordpress/core-data": "3.1.9", - "@wordpress/customize-widgets": "1.0.14", + "@wordpress/customize-widgets": "1.0.15", "@wordpress/data": "5.1.3", "@wordpress/data-controls": "2.1.3", "@wordpress/date": "4.1.1", "@wordpress/deprecated": "3.1.1", "@wordpress/dom": "3.1.2", "@wordpress/dom-ready": "3.1.1", - "@wordpress/edit-post": "4.1.15", - "@wordpress/edit-widgets": "2.1.15", + "@wordpress/edit-post": "4.1.16", + "@wordpress/edit-widgets": "2.1.16", "@wordpress/editor": "10.1.12", "@wordpress/element": "3.1.1", "@wordpress/escape-html": "2.1.1", diff --git a/src/wp-includes/assets/script-loader-packages.php b/src/wp-includes/assets/script-loader-packages.php index f95b8d1c951b6..5eb72e98e0b41 100644 --- a/src/wp-includes/assets/script-loader-packages.php +++ b/src/wp-includes/assets/script-loader-packages.php @@ -1 +1 @@ - array('dependencies' => array('wp-dom-ready', 'wp-i18n', 'wp-polyfill'), 'version' => '3243bf46da298d46850bacd71bcc111e'), 'annotations.js' => array('dependencies' => array('lodash', 'wp-data', 'wp-hooks', 'wp-i18n', 'wp-polyfill', 'wp-rich-text'), 'version' => '4556c7bbdf2d9d6a81c1ca770cf73893'), 'api-fetch.js' => array('dependencies' => array('wp-i18n', 'wp-polyfill', 'wp-url'), 'version' => '293ce6ecd6439249249485d369385617'), 'autop.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'bed28c77ea305cd8e02b0529011189f9'), 'blob.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'b8855b04f6a52a7bca89f8d945d46866'), 'block-directory.js' => array('dependencies' => array('lodash', 'wp-a11y', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-data-controls', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives'), 'version' => 'de3c45fbc5977806e2091ee4f6f59b13'), 'block-editor.js' => array('dependencies' => array('lodash', 'react', 'wp-a11y', 'wp-blob', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-shortcode', 'wp-token-list', 'wp-url', 'wp-wordcount'), 'version' => '16e30baf2cb4cb4731ff443a2549cd2c'), 'block-library.js' => array('dependencies' => array('lodash', 'moment', 'react', 'wp-api-fetch', 'wp-autop', 'wp-blob', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-keycodes', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-reusable-blocks', 'wp-rich-text', 'wp-server-side-render', 'wp-url', 'wp-viewport'), 'version' => 'ac47d06d67f271e0e34eec600528ddac'), 'block-serialization-default-parser.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'cc8e5d0e23cf68bb9944bf2a7a016e52'), 'blocks.js' => array('dependencies' => array('lodash', 'wp-autop', 'wp-blob', 'wp-block-serialization-default-parser', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives', 'wp-shortcode'), 'version' => '751c2504a888adf0398a0c604da94753'), 'components.js' => array('dependencies' => array('lodash', 'moment', 'react', 'react-dom', 'wp-a11y', 'wp-compose', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-warning'), 'version' => 'add36eafa8b9a3db86a15c803ed74334'), 'compose.js' => array('dependencies' => array('lodash', 'react', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-priority-queue'), 'version' => '0f215b3868e125c7f29468d3cbb4a759'), 'core-data.js' => array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-blocks', 'wp-data', 'wp-data-controls', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-url'), 'version' => '2b920f4b2b10716d0b8d2bbfe4799a48'), 'customize-widgets.js' => array('dependencies' => array('lodash', 'wp-a11y', 'wp-block-editor', 'wp-block-library', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-polyfill', 'wp-primitives', 'wp-widgets'), 'version' => '2f98f96e829eb1ea04ebeacfef1295a6'), 'data.js' => array('dependencies' => array('lodash', 'react', 'wp-compose', 'wp-deprecated', 'wp-element', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-priority-queue', 'wp-redux-routine'), 'version' => '98309fcd2b4633f5d768069fc08ac82a'), 'data-controls.js' => array('dependencies' => array('wp-api-fetch', 'wp-data', 'wp-deprecated', 'wp-polyfill'), 'version' => 'ceef9ce8c9c058d69ebf44db39353687'), 'date.js' => array('dependencies' => array('moment', 'wp-polyfill'), 'version' => '2abad43cdd2da929e01f7d7648e392ab'), 'deprecated.js' => array('dependencies' => array('wp-hooks', 'wp-polyfill'), 'version' => '13724e4923d40e224e7c99fdc350a6a1'), 'dom.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => '8f5a97cccc5f7dfe769183373d70a0b2'), 'dom-ready.js' => array('dependencies' => array('wp-polyfill'), 'version' => '1e1b9c1535c1c32d3236d41aa27c7bf9'), 'edit-post.js' => array('dependencies' => array('lodash', 'react', 'wp-a11y', 'wp-block-editor', 'wp-block-library', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-data-controls', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-url', 'wp-viewport', 'wp-warning'), 'version' => '155da20744fa278dc73aed005c7815ca'), 'edit-widgets.js' => array('dependencies' => array('lodash', 'wp-a11y', 'wp-api-fetch', 'wp-block-editor', 'wp-block-library', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-reusable-blocks', 'wp-url', 'wp-viewport', 'wp-widgets'), 'version' => '2c2e9a13463310bd201fe9984abedbff'), 'editor.js' => array('dependencies' => array('lodash', 'react', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-data-controls', 'wp-date', 'wp-deprecated', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-reusable-blocks', 'wp-rich-text', 'wp-server-side-render', 'wp-url', 'wp-wordcount'), 'version' => 'e9eb373dc2b2b1f49a3c385b813b3deb'), 'element.js' => array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-escape-html', 'wp-polyfill'), 'version' => '669f5c11ca4fe7c44d64157347343913'), 'escape-html.js' => array('dependencies' => array('wp-polyfill'), 'version' => '4f03d9c45a01df8191f6833373fe1cfa'), 'format-library.js' => array('dependencies' => array('lodash', 'wp-a11y', 'wp-block-editor', 'wp-components', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-url'), 'version' => '23c734677604301357e154aef27733a3'), 'hooks.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'f7ecf196f38940ae0673c46c6c30cd86'), 'html-entities.js' => array('dependencies' => array('wp-polyfill'), 'version' => '140ecb91be91e7eec34220584d085033'), 'i18n.js' => array('dependencies' => array('wp-hooks', 'wp-polyfill'), 'version' => 'd897c43bea0c2753dd7368eb2d990898'), 'is-shallow-equal.js' => array('dependencies' => array('wp-polyfill'), 'version' => '798b660598677b39413fdb5f68624aa8'), 'keyboard-shortcuts.js' => array('dependencies' => array('lodash', 'wp-compose', 'wp-data', 'wp-keycodes', 'wp-polyfill'), 'version' => '8a860f4afab68874dffb1e7eec6c1bc1'), 'keycodes.js' => array('dependencies' => array('lodash', 'wp-i18n', 'wp-polyfill'), 'version' => 'cf38e80b47baf72f4822ddb8847f4f24'), 'list-reusable-blocks.js' => array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-components', 'wp-compose', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => '80af68069161321e8e131bad6a00d5dc'), 'media-utils.js' => array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-blob', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => 'df373dcd13d7abc3f8b042f369b88557'), 'notices.js' => array('dependencies' => array('lodash', 'wp-data', 'wp-polyfill'), 'version' => 'b08e53c1e070954fa0884cad9a164683'), 'nux.js' => array('dependencies' => array('lodash', 'wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-primitives'), 'version' => 'c0c1a368ca9ade95dbf55485e8d59b68'), 'plugins.js' => array('dependencies' => array('lodash', 'wp-compose', 'wp-element', 'wp-hooks', 'wp-polyfill', 'wp-primitives'), 'version' => 'a843ba54a81c99735da976cf43fac526'), 'primitives.js' => array('dependencies' => array('wp-element', 'wp-polyfill'), 'version' => 'dc0962ac2885a26f8c2abdbe0cf0e333'), 'priority-queue.js' => array('dependencies' => array('wp-polyfill'), 'version' => '18c93919f04bb681234310b314675b17'), 'redux-routine.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => '3c50c6bd1563bc7fb88433198400a74c'), 'reusable-blocks.js' => array('dependencies' => array('lodash', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => 'bec2012396758ad7603274e338191a42'), 'rich-text.js' => array('dependencies' => array('lodash', 'wp-compose', 'wp-data', 'wp-element', 'wp-escape-html', 'wp-keycodes', 'wp-polyfill'), 'version' => '17198c4dd83a20f1f820c6cf500bd5f1'), 'server-side-render.js' => array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-url'), 'version' => '7c732c1add9f9667bdf8dd66fbf74759'), 'shortcode.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => '15757929bc8d52a3b184c3fcaeb38c64'), 'token-list.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => '7bcd3684420783ef1f6ebb7680fe958e'), 'url.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => 'e9868cffba8a348b31011f87dd53b3c4'), 'viewport.js' => array('dependencies' => array('lodash', 'wp-compose', 'wp-data', 'wp-element', 'wp-polyfill'), 'version' => '0a54bbdc44c5f135018c568a887b8279'), 'warning.js' => array('dependencies' => array('wp-polyfill'), 'version' => '202ac16e99afe7c33c257b248625a947'), 'widgets.js' => array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => '0f11251901b3f83a3373551071d06740'), 'wordcount.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => '02339c8ad03da1e7a03f9212da004007')); \ No newline at end of file + array('dependencies' => array('wp-dom-ready', 'wp-i18n', 'wp-polyfill'), 'version' => '3243bf46da298d46850bacd71bcc111e'), 'annotations.js' => array('dependencies' => array('lodash', 'wp-data', 'wp-hooks', 'wp-i18n', 'wp-polyfill', 'wp-rich-text'), 'version' => '4556c7bbdf2d9d6a81c1ca770cf73893'), 'api-fetch.js' => array('dependencies' => array('wp-i18n', 'wp-polyfill', 'wp-url'), 'version' => '293ce6ecd6439249249485d369385617'), 'autop.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'bed28c77ea305cd8e02b0529011189f9'), 'blob.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'b8855b04f6a52a7bca89f8d945d46866'), 'block-directory.js' => array('dependencies' => array('lodash', 'wp-a11y', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-data-controls', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives'), 'version' => 'de3c45fbc5977806e2091ee4f6f59b13'), 'block-editor.js' => array('dependencies' => array('lodash', 'react', 'wp-a11y', 'wp-blob', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-shortcode', 'wp-token-list', 'wp-url', 'wp-wordcount'), 'version' => '16e30baf2cb4cb4731ff443a2549cd2c'), 'block-library.js' => array('dependencies' => array('lodash', 'moment', 'react', 'wp-api-fetch', 'wp-autop', 'wp-blob', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-keycodes', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-reusable-blocks', 'wp-rich-text', 'wp-server-side-render', 'wp-url', 'wp-viewport'), 'version' => '98057fc8e66eefa6d76c93220d79e488'), 'block-serialization-default-parser.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'cc8e5d0e23cf68bb9944bf2a7a016e52'), 'blocks.js' => array('dependencies' => array('lodash', 'wp-autop', 'wp-blob', 'wp-block-serialization-default-parser', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives', 'wp-shortcode'), 'version' => '751c2504a888adf0398a0c604da94753'), 'components.js' => array('dependencies' => array('lodash', 'moment', 'react', 'react-dom', 'wp-a11y', 'wp-compose', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-warning'), 'version' => 'add36eafa8b9a3db86a15c803ed74334'), 'compose.js' => array('dependencies' => array('lodash', 'react', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-priority-queue'), 'version' => '0f215b3868e125c7f29468d3cbb4a759'), 'core-data.js' => array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-blocks', 'wp-data', 'wp-data-controls', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-url'), 'version' => '2b920f4b2b10716d0b8d2bbfe4799a48'), 'customize-widgets.js' => array('dependencies' => array('lodash', 'wp-a11y', 'wp-block-editor', 'wp-block-library', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-polyfill', 'wp-primitives', 'wp-widgets'), 'version' => '2f98f96e829eb1ea04ebeacfef1295a6'), 'data.js' => array('dependencies' => array('lodash', 'react', 'wp-compose', 'wp-deprecated', 'wp-element', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-priority-queue', 'wp-redux-routine'), 'version' => '98309fcd2b4633f5d768069fc08ac82a'), 'data-controls.js' => array('dependencies' => array('wp-api-fetch', 'wp-data', 'wp-deprecated', 'wp-polyfill'), 'version' => 'ceef9ce8c9c058d69ebf44db39353687'), 'date.js' => array('dependencies' => array('moment', 'wp-polyfill'), 'version' => '2abad43cdd2da929e01f7d7648e392ab'), 'deprecated.js' => array('dependencies' => array('wp-hooks', 'wp-polyfill'), 'version' => '13724e4923d40e224e7c99fdc350a6a1'), 'dom.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => '8f5a97cccc5f7dfe769183373d70a0b2'), 'dom-ready.js' => array('dependencies' => array('wp-polyfill'), 'version' => '1e1b9c1535c1c32d3236d41aa27c7bf9'), 'edit-post.js' => array('dependencies' => array('lodash', 'react', 'wp-a11y', 'wp-block-editor', 'wp-block-library', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-data-controls', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-url', 'wp-viewport', 'wp-warning'), 'version' => '155da20744fa278dc73aed005c7815ca'), 'edit-widgets.js' => array('dependencies' => array('lodash', 'wp-a11y', 'wp-api-fetch', 'wp-block-editor', 'wp-block-library', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-reusable-blocks', 'wp-url', 'wp-viewport', 'wp-widgets'), 'version' => '2c2e9a13463310bd201fe9984abedbff'), 'editor.js' => array('dependencies' => array('lodash', 'react', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-data-controls', 'wp-date', 'wp-deprecated', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-reusable-blocks', 'wp-rich-text', 'wp-server-side-render', 'wp-url', 'wp-wordcount'), 'version' => 'e9eb373dc2b2b1f49a3c385b813b3deb'), 'element.js' => array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-escape-html', 'wp-polyfill'), 'version' => '669f5c11ca4fe7c44d64157347343913'), 'escape-html.js' => array('dependencies' => array('wp-polyfill'), 'version' => '4f03d9c45a01df8191f6833373fe1cfa'), 'format-library.js' => array('dependencies' => array('lodash', 'wp-a11y', 'wp-block-editor', 'wp-components', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-url'), 'version' => '23c734677604301357e154aef27733a3'), 'hooks.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'f7ecf196f38940ae0673c46c6c30cd86'), 'html-entities.js' => array('dependencies' => array('wp-polyfill'), 'version' => '140ecb91be91e7eec34220584d085033'), 'i18n.js' => array('dependencies' => array('wp-hooks', 'wp-polyfill'), 'version' => 'd897c43bea0c2753dd7368eb2d990898'), 'is-shallow-equal.js' => array('dependencies' => array('wp-polyfill'), 'version' => '798b660598677b39413fdb5f68624aa8'), 'keyboard-shortcuts.js' => array('dependencies' => array('lodash', 'wp-compose', 'wp-data', 'wp-keycodes', 'wp-polyfill'), 'version' => '8a860f4afab68874dffb1e7eec6c1bc1'), 'keycodes.js' => array('dependencies' => array('lodash', 'wp-i18n', 'wp-polyfill'), 'version' => 'cf38e80b47baf72f4822ddb8847f4f24'), 'list-reusable-blocks.js' => array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-components', 'wp-compose', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => '80af68069161321e8e131bad6a00d5dc'), 'media-utils.js' => array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-blob', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => 'df373dcd13d7abc3f8b042f369b88557'), 'notices.js' => array('dependencies' => array('lodash', 'wp-data', 'wp-polyfill'), 'version' => 'b08e53c1e070954fa0884cad9a164683'), 'nux.js' => array('dependencies' => array('lodash', 'wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-primitives'), 'version' => 'c0c1a368ca9ade95dbf55485e8d59b68'), 'plugins.js' => array('dependencies' => array('lodash', 'wp-compose', 'wp-element', 'wp-hooks', 'wp-polyfill', 'wp-primitives'), 'version' => 'a843ba54a81c99735da976cf43fac526'), 'primitives.js' => array('dependencies' => array('wp-element', 'wp-polyfill'), 'version' => 'dc0962ac2885a26f8c2abdbe0cf0e333'), 'priority-queue.js' => array('dependencies' => array('wp-polyfill'), 'version' => '18c93919f04bb681234310b314675b17'), 'redux-routine.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => '3c50c6bd1563bc7fb88433198400a74c'), 'reusable-blocks.js' => array('dependencies' => array('lodash', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => 'bec2012396758ad7603274e338191a42'), 'rich-text.js' => array('dependencies' => array('lodash', 'wp-compose', 'wp-data', 'wp-element', 'wp-escape-html', 'wp-keycodes', 'wp-polyfill'), 'version' => '17198c4dd83a20f1f820c6cf500bd5f1'), 'server-side-render.js' => array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-url'), 'version' => '7c732c1add9f9667bdf8dd66fbf74759'), 'shortcode.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => '15757929bc8d52a3b184c3fcaeb38c64'), 'token-list.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => '7bcd3684420783ef1f6ebb7680fe958e'), 'url.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => 'e9868cffba8a348b31011f87dd53b3c4'), 'viewport.js' => array('dependencies' => array('lodash', 'wp-compose', 'wp-data', 'wp-element', 'wp-polyfill'), 'version' => '0a54bbdc44c5f135018c568a887b8279'), 'warning.js' => array('dependencies' => array('wp-polyfill'), 'version' => '202ac16e99afe7c33c257b248625a947'), 'widgets.js' => array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => '0f11251901b3f83a3373551071d06740'), 'wordcount.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => '02339c8ad03da1e7a03f9212da004007')); \ No newline at end of file diff --git a/src/wp-includes/blocks.php b/src/wp-includes/blocks.php index 547bbe8147df5..824c041d58d7a 100644 --- a/src/wp-includes/blocks.php +++ b/src/wp-includes/blocks.php @@ -1057,8 +1057,11 @@ function build_query_vars_from_query_block( $block, $page ) { ); if ( isset( $block->context['query'] ) ) { - if ( isset( $block->context['query']['postType'] ) ) { - $query['post_type'] = $block->context['query']['postType']; + if ( ! empty( $block->context['query']['postType'] ) ) { + $post_type_param = $block->context['query']['postType']; + if ( is_post_type_viewable( $post_type_param ) ) { + $query['post_type'] = $post_type_param; + } } if ( isset( $block->context['query']['sticky'] ) && ! empty( $block->context['query']['sticky'] ) ) { $sticky = get_option( 'sticky_posts' ); @@ -1068,29 +1071,54 @@ function build_query_vars_from_query_block( $block, $page ) { $query['post__not_in'] = array_merge( $query['post__not_in'], $sticky ); } } - if ( isset( $block->context['query']['exclude'] ) ) { - $query['post__not_in'] = array_merge( $query['post__not_in'], $block->context['query']['exclude'] ); + if ( ! empty( $block->context['query']['exclude'] ) ) { + $excluded_post_ids = array_map( 'intval', $block->context['query']['exclude'] ); + $excluded_post_ids = array_filter( $excluded_post_ids ); + $query['post__not_in'] = array_merge( $query['post__not_in'], $excluded_post_ids ); } - if ( isset( $block->context['query']['perPage'] ) ) { - $query['offset'] = ( $block->context['query']['perPage'] * ( $page - 1 ) ) + $block->context['query']['offset']; - $query['posts_per_page'] = $block->context['query']['perPage']; + if ( + isset( $block->context['query']['perPage'] ) && + is_numeric( $block->context['query']['perPage'] ) + ) { + $per_page = absint( $block->context['query']['perPage'] ); + $offset = 0; + + if ( + isset( $block->context['query']['offset'] ) && + is_numeric( $block->context['query']['offset'] ) + ) { + $offset = absint( $block->context['query']['offset'] ); + } + + $query['offset'] = ( $per_page * ( $page - 1 ) ) + $offset; + $query['posts_per_page'] = $per_page; } - if ( isset( $block->context['query']['categoryIds'] ) ) { - $query['category__in'] = $block->context['query']['categoryIds']; + if ( ! empty( $block->context['query']['categoryIds'] ) ) { + $term_ids = array_map( 'intval', $block->context['query']['categoryIds'] ); + $term_ids = array_filter( $term_ids ); + $query['category__in'] = $term_ids; } - if ( isset( $block->context['query']['tagIds'] ) ) { - $query['tag__in'] = $block->context['query']['tagIds']; + if ( ! empty( $block->context['query']['tagIds'] ) ) { + $term_ids = array_map( 'intval', $block->context['query']['tagIds'] ); + $term_ids = array_filter( $term_ids ); + $query['tag__in'] = $term_ids; } - if ( isset( $block->context['query']['order'] ) ) { + if ( + isset( $block->context['query']['order'] ) && + in_array( strtoupper( $block->context['query']['order'] ), array( 'ASC', 'DESC' ), true ) + ) { $query['order'] = strtoupper( $block->context['query']['order'] ); } if ( isset( $block->context['query']['orderBy'] ) ) { $query['orderby'] = $block->context['query']['orderBy']; } - if ( isset( $block->context['query']['author'] ) ) { - $query['author'] = $block->context['query']['author']; + if ( + isset( $block->context['query']['author'] ) && + (int) $block->context['query']['author'] > 0 + ) { + $query['author'] = (int) $block->context['query']['author']; } - if ( isset( $block->context['query']['search'] ) ) { + if ( ! empty( $block->context['query']['search'] ) ) { $query['s'] = $block->context['query']['search']; } } diff --git a/src/wp-includes/blocks/post-terms.php b/src/wp-includes/blocks/post-terms.php index f5c4e5781e2a7..d82395b549d1f 100644 --- a/src/wp-includes/blocks/post-terms.php +++ b/src/wp-includes/blocks/post-terms.php @@ -18,6 +18,10 @@ function render_block_core_post_terms( $attributes, $content, $block ) { return ''; } + if ( ! is_taxonomy_viewable( $attributes['term'] ) ) { + return ''; + } + $post_terms = get_the_terms( $block->context['postId'], $attributes['term'] ); if ( is_wp_error( $post_terms ) ) { return '';