diff --git a/.github/workflows/callable-test-core-build-process.yml b/.github/workflows/callable-test-core-build-process.yml index a9523ec34300a..bf566e7782241 100644 --- a/.github/workflows/callable-test-core-build-process.yml +++ b/.github/workflows/callable-test-core-build-process.yml @@ -58,7 +58,6 @@ jobs: node --version curl --version git --version - svn --version - name: Install npm Dependencies run: npm ci diff --git a/.github/workflows/callable-test-gutenberg-build-process.yml b/.github/workflows/callable-test-gutenberg-build-process.yml index ef41cff56ed75..ed45a4f2ac032 100644 --- a/.github/workflows/callable-test-gutenberg-build-process.yml +++ b/.github/workflows/callable-test-gutenberg-build-process.yml @@ -20,6 +20,7 @@ on: env: GUTENBERG_DIRECTORY: ${{ inputs.directory == 'build' && 'build' || 'src' }}/wp-content/plugins/gutenberg PUPPETEER_SKIP_DOWNLOAD: ${{ true }} + NODE_OPTIONS: '--max-old-space-size=8192' jobs: # Verifies that installing npm dependencies and building the Gutenberg plugin works as expected. @@ -69,7 +70,6 @@ jobs: node --version curl --version git --version - svn --version - name: Install Core Dependencies run: npm ci diff --git a/.github/workflows/coding-standards.yml b/.github/workflows/coding-standards.yml index c09703167f1cd..393c7d1d7b013 100644 --- a/.github/workflows/coding-standards.yml +++ b/.github/workflows/coding-standards.yml @@ -162,7 +162,6 @@ jobs: npm --version node --version git --version - svn --version - name: Install npm Dependencies run: npm ci diff --git a/.github/workflows/end-to-end-tests.yml b/.github/workflows/end-to-end-tests.yml index 25f37b5d4b046..344201d2572d5 100644 --- a/.github/workflows/end-to-end-tests.yml +++ b/.github/workflows/end-to-end-tests.yml @@ -87,7 +87,6 @@ jobs: node --version curl --version git --version - svn --version locale -a - name: Install npm Dependencies diff --git a/.github/workflows/javascript-tests.yml b/.github/workflows/javascript-tests.yml index ce3536b84f796..1826b03041b9d 100644 --- a/.github/workflows/javascript-tests.yml +++ b/.github/workflows/javascript-tests.yml @@ -77,7 +77,6 @@ jobs: npm --version node --version git --version - svn --version - name: Install npm Dependencies run: npm ci diff --git a/.github/workflows/performance.yml b/.github/workflows/performance.yml index 356d5f77244e5..900b77417b400 100644 --- a/.github/workflows/performance.yml +++ b/.github/workflows/performance.yml @@ -121,7 +121,6 @@ jobs: node --version curl --version git --version - svn --version locale -a - name: Install npm dependencies diff --git a/.github/workflows/phpunit-tests-run.yml b/.github/workflows/phpunit-tests-run.yml index d47db28696382..bebd1e3a29d23 100644 --- a/.github/workflows/phpunit-tests-run.yml +++ b/.github/workflows/phpunit-tests-run.yml @@ -124,7 +124,6 @@ jobs: node --version curl --version git --version - svn --version composer --version locale -a diff --git a/.github/workflows/test-coverage.yml b/.github/workflows/test-coverage.yml index 82449a8f0e374..5d1e6b2f2af85 100644 --- a/.github/workflows/test-coverage.yml +++ b/.github/workflows/test-coverage.yml @@ -117,7 +117,6 @@ jobs: node --version curl --version git --version - svn --version composer --version locale -a diff --git a/package-lock.json b/package-lock.json index 44201c006d4b5..620787e67eea9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,55 +16,55 @@ "@wordpress/api-fetch": "6.39.13", "@wordpress/autop": "3.42.13", "@wordpress/blob": "3.42.13", - "@wordpress/block-directory": "4.19.13", - "@wordpress/block-editor": "12.10.13", - "@wordpress/block-library": "8.19.13", + "@wordpress/block-directory": "4.19.16", + "@wordpress/block-editor": "12.10.14", + "@wordpress/block-library": "8.19.16", "@wordpress/block-serialization-default-parser": "4.42.13", "@wordpress/blocks": "12.19.13", - "@wordpress/commands": "0.13.13", - "@wordpress/components": "25.8.13", + "@wordpress/commands": "0.13.14", + "@wordpress/components": "25.8.14", "@wordpress/compose": "6.19.13", - "@wordpress/core-commands": "0.11.13", - "@wordpress/core-data": "6.19.13", - "@wordpress/customize-widgets": "4.19.13", + "@wordpress/core-commands": "0.11.14", + "@wordpress/core-data": "6.19.14", + "@wordpress/customize-widgets": "4.19.16", "@wordpress/data": "9.12.13", "@wordpress/data-controls": "3.11.13", "@wordpress/date": "4.42.13", "@wordpress/deprecated": "3.42.13", "@wordpress/dom": "3.42.13", "@wordpress/dom-ready": "3.42.13", - "@wordpress/edit-post": "7.19.13", - "@wordpress/edit-site": "5.19.13", - "@wordpress/edit-widgets": "5.19.13", - "@wordpress/editor": "13.19.13", + "@wordpress/edit-post": "7.19.16", + "@wordpress/edit-site": "5.19.16", + "@wordpress/edit-widgets": "5.19.16", + "@wordpress/editor": "13.19.14", "@wordpress/element": "5.19.13", "@wordpress/escape-html": "2.42.13", - "@wordpress/format-library": "4.19.13", + "@wordpress/format-library": "4.19.14", "@wordpress/hooks": "3.42.13", "@wordpress/html-entities": "3.42.13", "@wordpress/i18n": "4.42.13", "@wordpress/icons": "9.33.13", "@wordpress/interactivity": "2.3.13", - "@wordpress/interface": "5.19.13", + "@wordpress/interface": "5.19.14", "@wordpress/is-shallow-equal": "4.42.13", "@wordpress/keyboard-shortcuts": "4.19.13", "@wordpress/keycodes": "3.42.13", - "@wordpress/list-reusable-blocks": "4.19.13", + "@wordpress/list-reusable-blocks": "4.19.14", "@wordpress/media-utils": "4.33.13", "@wordpress/notices": "4.10.13", - "@wordpress/nux": "8.4.13", - "@wordpress/patterns": "1.3.13", - "@wordpress/plugins": "6.10.13", - "@wordpress/preferences": "3.19.13", + "@wordpress/nux": "8.4.14", + "@wordpress/patterns": "1.3.14", + "@wordpress/plugins": "6.10.14", + "@wordpress/preferences": "3.19.14", "@wordpress/preferences-persistence": "1.34.13", "@wordpress/primitives": "3.40.13", "@wordpress/priority-queue": "2.42.13", "@wordpress/private-apis": "0.24.13", "@wordpress/redux-routine": "4.42.13", - "@wordpress/reusable-blocks": "4.19.13", + "@wordpress/reusable-blocks": "4.19.14", "@wordpress/rich-text": "6.19.13", "@wordpress/router": "0.11.13", - "@wordpress/server-side-render": "4.19.13", + "@wordpress/server-side-render": "4.19.14", "@wordpress/shortcode": "3.42.13", "@wordpress/style-engine": "1.25.13", "@wordpress/sync": "0.4.13", @@ -73,7 +73,7 @@ "@wordpress/url": "3.43.13", "@wordpress/viewport": "5.19.13", "@wordpress/warning": "2.42.13", - "@wordpress/widgets": "3.19.13", + "@wordpress/widgets": "3.19.14", "@wordpress/wordcount": "3.42.13", "backbone": "1.5.0", "clipboard": "2.0.11", @@ -6460,28 +6460,28 @@ } }, "node_modules/@wordpress/block-directory": { - "version": "4.19.13", - "resolved": "https://registry.npmjs.org/@wordpress/block-directory/-/block-directory-4.19.13.tgz", - "integrity": "sha512-NM+bec+5CmPOcqLgYqtOZoTdagDHgVhgQk0/3vHqLQZcCyP0PUDNupbvcg2q/KMP78CjL+oWt6aiw4q1eQ7yLw==", + "version": "4.19.16", + "resolved": "https://registry.npmjs.org/@wordpress/block-directory/-/block-directory-4.19.16.tgz", + "integrity": "sha512-7YOqeZt8ExyMidbblzht7x5jnfpZVD6N69VuDrvdlB/8eB7gl62tKZdNXHwWoZccSWJb+xUTZL01k2HpJulcPQ==", "dependencies": { "@babel/runtime": "^7.16.0", "@wordpress/a11y": "^3.42.13", "@wordpress/api-fetch": "^6.39.13", - "@wordpress/block-editor": "^12.10.13", + "@wordpress/block-editor": "^12.10.14", "@wordpress/blocks": "^12.19.13", - "@wordpress/components": "^25.8.13", + "@wordpress/components": "^25.8.14", "@wordpress/compose": "^6.19.13", - "@wordpress/core-data": "^6.19.13", + "@wordpress/core-data": "^6.19.14", "@wordpress/data": "^9.12.13", - "@wordpress/edit-post": "^7.19.13", - "@wordpress/editor": "^13.19.13", + "@wordpress/edit-post": "^7.19.16", + "@wordpress/editor": "^13.19.14", "@wordpress/element": "^5.19.13", "@wordpress/hooks": "^3.42.13", "@wordpress/html-entities": "^3.42.13", "@wordpress/i18n": "^4.42.13", "@wordpress/icons": "^9.33.13", "@wordpress/notices": "^4.10.13", - "@wordpress/plugins": "^6.10.13", + "@wordpress/plugins": "^6.10.14", "@wordpress/url": "^3.43.13", "change-case": "^4.1.2" }, @@ -6494,9 +6494,9 @@ } }, "node_modules/@wordpress/block-editor": { - "version": "12.10.13", - "resolved": "https://registry.npmjs.org/@wordpress/block-editor/-/block-editor-12.10.13.tgz", - "integrity": "sha512-QT5NSgU9WYAmEK3QcDM2W0ChoukeiKRivg3upbbfJh/Njo3VvBROyoziL1Nvor/4nABXl+PRTBBxdsVtMWLtiA==", + "version": "12.10.14", + "resolved": "https://registry.npmjs.org/@wordpress/block-editor/-/block-editor-12.10.14.tgz", + "integrity": "sha512-x56FPZZfJPk/Vd1aKIdpBIllrUuAVgwom+mYH0OohCmUzCBp1Eg8Urg5nshZpiLXpHt2dXycQCLu2Mpb+YpOJw==", "dependencies": { "@babel/runtime": "^7.16.0", "@emotion/react": "^11.7.1", @@ -6506,8 +6506,8 @@ "@wordpress/api-fetch": "^6.39.13", "@wordpress/blob": "^3.42.13", "@wordpress/blocks": "^12.19.13", - "@wordpress/commands": "^0.13.13", - "@wordpress/components": "^25.8.13", + "@wordpress/commands": "^0.13.14", + "@wordpress/components": "^25.8.14", "@wordpress/compose": "^6.19.13", "@wordpress/data": "^9.12.13", "@wordpress/date": "^4.42.13", @@ -6523,7 +6523,7 @@ "@wordpress/keyboard-shortcuts": "^4.19.13", "@wordpress/keycodes": "^3.42.13", "@wordpress/notices": "^4.10.13", - "@wordpress/preferences": "^3.19.13", + "@wordpress/preferences": "^3.19.14", "@wordpress/private-apis": "^0.24.13", "@wordpress/rich-text": "^6.19.13", "@wordpress/shortcode": "^3.42.13", @@ -6555,20 +6555,20 @@ } }, "node_modules/@wordpress/block-library": { - "version": "8.19.13", - "resolved": "https://registry.npmjs.org/@wordpress/block-library/-/block-library-8.19.13.tgz", - "integrity": "sha512-JasXSCmRfQsmLjGNWWH6z4+m8a/sv4dn3uuw4i+BgMo5JTg6CIQy85rHz2YWzkMqd+P20978GjJKtkwE4gc/JQ==", + "version": "8.19.16", + "resolved": "https://registry.npmjs.org/@wordpress/block-library/-/block-library-8.19.16.tgz", + "integrity": "sha512-6NqTHjEYk3X+jzw6JS3pOgVYl2HPlr0iAI3Ch9sdOxozAm1+VrE5DKeM//rf9QpR7wWJ6je4F/eNjZ2WJIYTfw==", "dependencies": { "@babel/runtime": "^7.16.0", "@wordpress/a11y": "^3.42.13", "@wordpress/api-fetch": "^6.39.13", "@wordpress/autop": "^3.42.13", "@wordpress/blob": "^3.42.13", - "@wordpress/block-editor": "^12.10.13", + "@wordpress/block-editor": "^12.10.14", "@wordpress/blocks": "^12.19.13", - "@wordpress/components": "^25.8.13", + "@wordpress/components": "^25.8.14", "@wordpress/compose": "^6.19.13", - "@wordpress/core-data": "^6.19.13", + "@wordpress/core-data": "^6.19.14", "@wordpress/data": "^9.12.13", "@wordpress/date": "^4.42.13", "@wordpress/deprecated": "^3.42.13", @@ -6584,9 +6584,9 @@ "@wordpress/notices": "^4.10.13", "@wordpress/primitives": "^3.40.13", "@wordpress/private-apis": "^0.24.13", - "@wordpress/reusable-blocks": "^4.19.13", + "@wordpress/reusable-blocks": "^4.19.14", "@wordpress/rich-text": "^6.19.13", - "@wordpress/server-side-render": "^4.19.13", + "@wordpress/server-side-render": "^4.19.14", "@wordpress/url": "^3.43.13", "@wordpress/viewport": "^5.19.13", "@wordpress/wordcount": "^3.42.13", @@ -6669,12 +6669,12 @@ } }, "node_modules/@wordpress/commands": { - "version": "0.13.13", - "resolved": "https://registry.npmjs.org/@wordpress/commands/-/commands-0.13.13.tgz", - "integrity": "sha512-Z+g7X7csCHD5qJCkJhdc/q3Dg5BLTH5M9fp/80Z5xfHhDjsZz+uVqS2xWavAk6QyIqJlLMnk/9vLxqO1PJJqnw==", + "version": "0.13.14", + "resolved": "https://registry.npmjs.org/@wordpress/commands/-/commands-0.13.14.tgz", + "integrity": "sha512-aSOuRbsr+YYFvRbkXaubHdlAtf/xpG1mUWXEw9VMWCag77hiK6vk04Xb3N8ad8eo8am0N/iRgn8V8IS4LyBTyA==", "dependencies": { "@babel/runtime": "^7.16.0", - "@wordpress/components": "^25.8.13", + "@wordpress/components": "^25.8.14", "@wordpress/data": "^9.12.13", "@wordpress/element": "^5.19.13", "@wordpress/i18n": "^4.42.13", @@ -6694,9 +6694,9 @@ } }, "node_modules/@wordpress/components": { - "version": "25.8.13", - "resolved": "https://registry.npmjs.org/@wordpress/components/-/components-25.8.13.tgz", - "integrity": "sha512-Q3A1mZDgkCounVWawCzbqEbc1nAbm6L74GBNYllO5pxsccNsjcDHAtAEmx9BJzKd4SHEU6bYrgponWvhvLouFA==", + "version": "25.8.14", + "resolved": "https://registry.npmjs.org/@wordpress/components/-/components-25.8.14.tgz", + "integrity": "sha512-wRQSRlLXsL4bEd1JhCQPSdIb0bO4WDAloQufeyIbXUIK9CDgN/jmkv+vrgKrpP3Nqu1sBAFzW1qd9WEXfSBgXw==", "dependencies": { "@ariakit/react": "^0.2.12", "@babel/runtime": "^7.16.0", @@ -6783,14 +6783,14 @@ } }, "node_modules/@wordpress/core-commands": { - "version": "0.11.13", - "resolved": "https://registry.npmjs.org/@wordpress/core-commands/-/core-commands-0.11.13.tgz", - "integrity": "sha512-gwiorFZSPeq+UItsPsWOrypfDddTF33+idK6cz18f1PIl6MoGLwNKuiq3A9f28tG4yFLrv5awHATF5PT4vjvKg==", + "version": "0.11.14", + "resolved": "https://registry.npmjs.org/@wordpress/core-commands/-/core-commands-0.11.14.tgz", + "integrity": "sha512-f2DA9lUji96OC5UD85Gbv2vz14R0TR+FSXzXAa68F/EBPFkiaxs2huhruhRvZKbasxugk/vjTBbQuwZ8rinROA==", "dependencies": { "@babel/runtime": "^7.16.0", - "@wordpress/block-editor": "^12.10.13", - "@wordpress/commands": "^0.13.13", - "@wordpress/core-data": "^6.19.13", + "@wordpress/block-editor": "^12.10.14", + "@wordpress/commands": "^0.13.14", + "@wordpress/core-data": "^6.19.14", "@wordpress/data": "^9.12.13", "@wordpress/element": "^5.19.13", "@wordpress/i18n": "^4.42.13", @@ -6808,13 +6808,13 @@ } }, "node_modules/@wordpress/core-data": { - "version": "6.19.13", - "resolved": "https://registry.npmjs.org/@wordpress/core-data/-/core-data-6.19.13.tgz", - "integrity": "sha512-rScMXJkasThvyFea8w+ajGUiOuaR+fEir1oh/obRaKxrYpSMqaf5gKuvpBGxAeMJMsg0yGn5/E4FXGF4TGuX9Q==", + "version": "6.19.14", + "resolved": "https://registry.npmjs.org/@wordpress/core-data/-/core-data-6.19.14.tgz", + "integrity": "sha512-wdstu/qMBKwXnFRX4wMeTkxvHsOgbXm7ZJ0Lgtj+jE86O086Ook7suxacOdMcCaAKNCfMqoGBHtjsNQk3SWE1Q==", "dependencies": { "@babel/runtime": "^7.16.0", "@wordpress/api-fetch": "^6.39.13", - "@wordpress/block-editor": "^12.10.13", + "@wordpress/block-editor": "^12.10.14", "@wordpress/blocks": "^12.19.13", "@wordpress/compose": "^6.19.13", "@wordpress/data": "^9.12.13", @@ -6843,31 +6843,31 @@ } }, "node_modules/@wordpress/customize-widgets": { - "version": "4.19.13", - "resolved": "https://registry.npmjs.org/@wordpress/customize-widgets/-/customize-widgets-4.19.13.tgz", - "integrity": "sha512-Wwur4j8tuwV6/KHaZwcSZtqdrOZdWLIn9jL4tK5nTEGv4u1OV+SzucYxqvVqCu6otsyU2lVrRX9kTyiYkJGyJw==", + "version": "4.19.16", + "resolved": "https://registry.npmjs.org/@wordpress/customize-widgets/-/customize-widgets-4.19.16.tgz", + "integrity": "sha512-UK4RrEBFwdn8WcY7qXXbRcncuWXLMpB9gjiBVhwPmM5m1//A0wsOQu2kAkZeACuhYoEJ/N6g4yZh2ZnldJVR3w==", "dependencies": { "@babel/runtime": "^7.16.0", - "@wordpress/block-editor": "^12.10.13", - "@wordpress/block-library": "^8.19.13", + "@wordpress/block-editor": "^12.10.14", + "@wordpress/block-library": "^8.19.16", "@wordpress/blocks": "^12.19.13", - "@wordpress/components": "^25.8.13", + "@wordpress/components": "^25.8.14", "@wordpress/compose": "^6.19.13", - "@wordpress/core-data": "^6.19.13", + "@wordpress/core-data": "^6.19.14", "@wordpress/data": "^9.12.13", "@wordpress/dom": "^3.42.13", "@wordpress/element": "^5.19.13", "@wordpress/hooks": "^3.42.13", "@wordpress/i18n": "^4.42.13", "@wordpress/icons": "^9.33.13", - "@wordpress/interface": "^5.19.13", + "@wordpress/interface": "^5.19.14", "@wordpress/is-shallow-equal": "^4.42.13", "@wordpress/keyboard-shortcuts": "^4.19.13", "@wordpress/keycodes": "^3.42.13", "@wordpress/media-utils": "^4.33.13", - "@wordpress/preferences": "^3.19.13", + "@wordpress/preferences": "^3.19.14", "@wordpress/private-apis": "^0.24.13", - "@wordpress/widgets": "^3.19.13", + "@wordpress/widgets": "^3.19.14", "classnames": "^2.3.1", "fast-deep-equal": "^3.1.3" }, @@ -7148,41 +7148,41 @@ } }, "node_modules/@wordpress/edit-post": { - "version": "7.19.13", - "resolved": "https://registry.npmjs.org/@wordpress/edit-post/-/edit-post-7.19.13.tgz", - "integrity": "sha512-iOSnEZdEY1O661vkwG22BC/Si0+QJ6Xo8dgrOSrJmoGeEcN7OrfBaw9JeT/if5Tn0U4dRCI7YtCyUwqtvCicwQ==", + "version": "7.19.16", + "resolved": "https://registry.npmjs.org/@wordpress/edit-post/-/edit-post-7.19.16.tgz", + "integrity": "sha512-PK0XVHLrn6Bg47O8sq7UIBykJOJGF2xsbkOjhRVniD+6EYdYifpGYHTC9nHogEfw691xcz+vAqS87D01x3SfEQ==", "dependencies": { "@babel/runtime": "^7.16.0", "@wordpress/a11y": "^3.42.13", "@wordpress/api-fetch": "^6.39.13", - "@wordpress/block-editor": "^12.10.13", - "@wordpress/block-library": "^8.19.13", + "@wordpress/block-editor": "^12.10.14", + "@wordpress/block-library": "^8.19.16", "@wordpress/blocks": "^12.19.13", - "@wordpress/commands": "^0.13.13", - "@wordpress/components": "^25.8.13", + "@wordpress/commands": "^0.13.14", + "@wordpress/components": "^25.8.14", "@wordpress/compose": "^6.19.13", - "@wordpress/core-commands": "^0.11.13", - "@wordpress/core-data": "^6.19.13", + "@wordpress/core-commands": "^0.11.14", + "@wordpress/core-data": "^6.19.14", "@wordpress/data": "^9.12.13", "@wordpress/deprecated": "^3.42.13", "@wordpress/dom": "^3.42.13", - "@wordpress/editor": "^13.19.13", + "@wordpress/editor": "^13.19.14", "@wordpress/element": "^5.19.13", "@wordpress/hooks": "^3.42.13", "@wordpress/i18n": "^4.42.13", "@wordpress/icons": "^9.33.13", - "@wordpress/interface": "^5.19.13", + "@wordpress/interface": "^5.19.14", "@wordpress/keyboard-shortcuts": "^4.19.13", "@wordpress/keycodes": "^3.42.13", "@wordpress/media-utils": "^4.33.13", "@wordpress/notices": "^4.10.13", - "@wordpress/plugins": "^6.10.13", - "@wordpress/preferences": "^3.19.13", + "@wordpress/plugins": "^6.10.14", + "@wordpress/preferences": "^3.19.14", "@wordpress/private-apis": "^0.24.13", "@wordpress/url": "^3.43.13", "@wordpress/viewport": "^5.19.13", "@wordpress/warning": "^2.42.13", - "@wordpress/widgets": "^3.19.13", + "@wordpress/widgets": "^3.19.14", "classnames": "^2.3.1", "memize": "^2.1.0", "rememo": "^4.0.2" @@ -7196,48 +7196,48 @@ } }, "node_modules/@wordpress/edit-site": { - "version": "5.19.13", - "resolved": "https://registry.npmjs.org/@wordpress/edit-site/-/edit-site-5.19.13.tgz", - "integrity": "sha512-0xKu7FQw3h6EBj6fwP2KkeZqa6IaCwTuDx0ZQ5Mur03OsxH6UvuVm/KhNW7ONcw3V0mYsL87pcmJNhw/+L1yvQ==", + "version": "5.19.16", + "resolved": "https://registry.npmjs.org/@wordpress/edit-site/-/edit-site-5.19.16.tgz", + "integrity": "sha512-shraoCd4LCNngtBn9E7U6Na/l+zrU0nTXztgZSuVsqSGktAgHBi7pXMUTsCGqO/vp9fnmW9LU3tQ9XgLEogjkg==", "dependencies": { "@babel/runtime": "^7.16.0", "@wordpress/a11y": "^3.42.13", "@wordpress/api-fetch": "^6.39.13", - "@wordpress/block-editor": "^12.10.13", - "@wordpress/block-library": "^8.19.13", + "@wordpress/block-editor": "^12.10.14", + "@wordpress/block-library": "^8.19.16", "@wordpress/blocks": "^12.19.13", - "@wordpress/commands": "^0.13.13", - "@wordpress/components": "^25.8.13", + "@wordpress/commands": "^0.13.14", + "@wordpress/components": "^25.8.14", "@wordpress/compose": "^6.19.13", - "@wordpress/core-commands": "^0.11.13", - "@wordpress/core-data": "^6.19.13", + "@wordpress/core-commands": "^0.11.14", + "@wordpress/core-data": "^6.19.14", "@wordpress/data": "^9.12.13", "@wordpress/date": "^4.42.13", "@wordpress/deprecated": "^3.42.13", "@wordpress/dom": "^3.42.13", - "@wordpress/editor": "^13.19.13", + "@wordpress/editor": "^13.19.14", "@wordpress/element": "^5.19.13", "@wordpress/escape-html": "^2.42.13", "@wordpress/hooks": "^3.42.13", "@wordpress/html-entities": "^3.42.13", "@wordpress/i18n": "^4.42.13", "@wordpress/icons": "^9.33.13", - "@wordpress/interface": "^5.19.13", + "@wordpress/interface": "^5.19.14", "@wordpress/keyboard-shortcuts": "^4.19.13", "@wordpress/keycodes": "^3.42.13", "@wordpress/media-utils": "^4.33.13", "@wordpress/notices": "^4.10.13", - "@wordpress/patterns": "^1.3.13", - "@wordpress/plugins": "^6.10.13", - "@wordpress/preferences": "^3.19.13", + "@wordpress/patterns": "^1.3.14", + "@wordpress/plugins": "^6.10.14", + "@wordpress/preferences": "^3.19.14", "@wordpress/primitives": "^3.40.13", "@wordpress/private-apis": "^0.24.13", - "@wordpress/reusable-blocks": "^4.19.13", + "@wordpress/reusable-blocks": "^4.19.14", "@wordpress/router": "^0.11.13", "@wordpress/style-engine": "^1.25.13", "@wordpress/url": "^3.43.13", "@wordpress/viewport": "^5.19.13", - "@wordpress/widgets": "^3.19.13", + "@wordpress/widgets": "^3.19.14", "@wordpress/wordcount": "^3.42.13", "change-case": "^4.1.2", "classnames": "^2.3.1", @@ -7260,18 +7260,18 @@ } }, "node_modules/@wordpress/edit-widgets": { - "version": "5.19.13", - "resolved": "https://registry.npmjs.org/@wordpress/edit-widgets/-/edit-widgets-5.19.13.tgz", - "integrity": "sha512-SFdDXp2o6I+jNDMF0ncnOE55vuKj3TSUae6D31yzjzsIYLjLWwiv7EFOmNnqBKR6704UvZPAOwin2KojecdMqw==", + "version": "5.19.16", + "resolved": "https://registry.npmjs.org/@wordpress/edit-widgets/-/edit-widgets-5.19.16.tgz", + "integrity": "sha512-1yTkLHQjf/LEmxlw2y0bqgkZcqO2Gs0H8QK1JHEJdHrAK+R5nBd55Jq4Wb2IU+QsUAaGvQzuF+FfHAA4YkLUwQ==", "dependencies": { "@babel/runtime": "^7.16.0", "@wordpress/api-fetch": "^6.39.13", - "@wordpress/block-editor": "^12.10.13", - "@wordpress/block-library": "^8.19.13", + "@wordpress/block-editor": "^12.10.14", + "@wordpress/block-library": "^8.19.16", "@wordpress/blocks": "^12.19.13", - "@wordpress/components": "^25.8.13", + "@wordpress/components": "^25.8.14", "@wordpress/compose": "^6.19.13", - "@wordpress/core-data": "^6.19.13", + "@wordpress/core-data": "^6.19.14", "@wordpress/data": "^9.12.13", "@wordpress/deprecated": "^3.42.13", "@wordpress/dom": "^3.42.13", @@ -7279,18 +7279,18 @@ "@wordpress/hooks": "^3.42.13", "@wordpress/i18n": "^4.42.13", "@wordpress/icons": "^9.33.13", - "@wordpress/interface": "^5.19.13", + "@wordpress/interface": "^5.19.14", "@wordpress/keyboard-shortcuts": "^4.19.13", "@wordpress/keycodes": "^3.42.13", "@wordpress/media-utils": "^4.33.13", "@wordpress/notices": "^4.10.13", - "@wordpress/patterns": "^1.3.13", - "@wordpress/plugins": "^6.10.13", - "@wordpress/preferences": "^3.19.13", + "@wordpress/patterns": "^1.3.14", + "@wordpress/plugins": "^6.10.14", + "@wordpress/preferences": "^3.19.14", "@wordpress/private-apis": "^0.24.13", - "@wordpress/reusable-blocks": "^4.19.13", + "@wordpress/reusable-blocks": "^4.19.14", "@wordpress/url": "^3.43.13", - "@wordpress/widgets": "^3.19.13", + "@wordpress/widgets": "^3.19.14", "classnames": "^2.3.1" }, "engines": { @@ -7302,19 +7302,19 @@ } }, "node_modules/@wordpress/editor": { - "version": "13.19.13", - "resolved": "https://registry.npmjs.org/@wordpress/editor/-/editor-13.19.13.tgz", - "integrity": "sha512-8df51NC4+pCE45AL1NFo8RXq7rND97yxHjb1rECLRvYUetq08pUX2m+kYWmxxSHaVHNytOmMtERpkYGNC7sAXQ==", + "version": "13.19.14", + "resolved": "https://registry.npmjs.org/@wordpress/editor/-/editor-13.19.14.tgz", + "integrity": "sha512-t1RFJl0Bf+qJpBHtiUl0qoxJjpNNGcpSZLejnhR97+i32l/4ewg8+z69zwFtW4ChNQjLnAFnpQZ5pT/CqkkKpQ==", "dependencies": { "@babel/runtime": "^7.16.0", "@wordpress/a11y": "^3.42.13", "@wordpress/api-fetch": "^6.39.13", "@wordpress/blob": "^3.42.13", - "@wordpress/block-editor": "^12.10.13", + "@wordpress/block-editor": "^12.10.14", "@wordpress/blocks": "^12.19.13", - "@wordpress/components": "^25.8.13", + "@wordpress/components": "^25.8.14", "@wordpress/compose": "^6.19.13", - "@wordpress/core-data": "^6.19.13", + "@wordpress/core-data": "^6.19.14", "@wordpress/data": "^9.12.13", "@wordpress/date": "^4.42.13", "@wordpress/deprecated": "^3.42.13", @@ -7328,12 +7328,12 @@ "@wordpress/keycodes": "^3.42.13", "@wordpress/media-utils": "^4.33.13", "@wordpress/notices": "^4.10.13", - "@wordpress/patterns": "^1.3.13", - "@wordpress/preferences": "^3.19.13", + "@wordpress/patterns": "^1.3.14", + "@wordpress/preferences": "^3.19.14", "@wordpress/private-apis": "^0.24.13", - "@wordpress/reusable-blocks": "^4.19.13", + "@wordpress/reusable-blocks": "^4.19.14", "@wordpress/rich-text": "^6.19.13", - "@wordpress/server-side-render": "^4.19.13", + "@wordpress/server-side-render": "^4.19.14", "@wordpress/url": "^3.43.13", "@wordpress/wordcount": "^3.42.13", "classnames": "^2.3.1", @@ -7439,14 +7439,14 @@ } }, "node_modules/@wordpress/format-library": { - "version": "4.19.13", - "resolved": "https://registry.npmjs.org/@wordpress/format-library/-/format-library-4.19.13.tgz", - "integrity": "sha512-EY8oCHXbfRogyKvRkF5z58O04o8MzQDY6Ms1mqZ95FGdAt9TJ6sfJgPXbj8a9bR7WAbx74h5eo6t2K1m3HZu6A==", + "version": "4.19.14", + "resolved": "https://registry.npmjs.org/@wordpress/format-library/-/format-library-4.19.14.tgz", + "integrity": "sha512-NyJ1nmb6PODE5hXM9oOEBlYA48k6c2DlGcUTXkSzDcdLPRVinTeWDfPL4kpze30JcQPv9m6Y5/EfWp48bDnByA==", "dependencies": { "@babel/runtime": "^7.16.0", "@wordpress/a11y": "^3.42.13", - "@wordpress/block-editor": "^12.10.13", - "@wordpress/components": "^25.8.13", + "@wordpress/block-editor": "^12.10.14", + "@wordpress/components": "^25.8.14", "@wordpress/compose": "^6.19.13", "@wordpress/data": "^9.12.13", "@wordpress/element": "^5.19.13", @@ -7532,21 +7532,21 @@ } }, "node_modules/@wordpress/interface": { - "version": "5.19.13", - "resolved": "https://registry.npmjs.org/@wordpress/interface/-/interface-5.19.13.tgz", - "integrity": "sha512-TdE6B3FlZoYqf9WBFPh8g34ciAABaQR4uBHgGv4uXxsgu8sCBx3zIKJZuMLTv6StsivKFYn4pBFZRD/SZGx49w==", + "version": "5.19.14", + "resolved": "https://registry.npmjs.org/@wordpress/interface/-/interface-5.19.14.tgz", + "integrity": "sha512-WsIsSKJuhAcXD3YbmUoncL1JZ6hKAJXs7Lb/bjrOJxCts/YOy5yMF3/I05r8f1Tfw/pS8wlHMRjIXH/gvnvWVA==", "dependencies": { "@babel/runtime": "^7.16.0", "@wordpress/a11y": "^3.42.13", - "@wordpress/components": "^25.8.13", + "@wordpress/components": "^25.8.14", "@wordpress/compose": "^6.19.13", "@wordpress/data": "^9.12.13", "@wordpress/deprecated": "^3.42.13", "@wordpress/element": "^5.19.13", "@wordpress/i18n": "^4.42.13", "@wordpress/icons": "^9.33.13", - "@wordpress/plugins": "^6.10.13", - "@wordpress/preferences": "^3.19.13", + "@wordpress/plugins": "^6.10.14", + "@wordpress/preferences": "^3.19.14", "@wordpress/viewport": "^5.19.13", "classnames": "^2.3.1" }, @@ -7634,13 +7634,13 @@ } }, "node_modules/@wordpress/list-reusable-blocks": { - "version": "4.19.13", - "resolved": "https://registry.npmjs.org/@wordpress/list-reusable-blocks/-/list-reusable-blocks-4.19.13.tgz", - "integrity": "sha512-OnLlQq2sQ4xj5/UhmbC5eTSSTGf8iAfHGOvPi3OZF1Ig9otGsonjSrATgJSskomZFkjetWUQfBOVBxA23Ni7cA==", + "version": "4.19.14", + "resolved": "https://registry.npmjs.org/@wordpress/list-reusable-blocks/-/list-reusable-blocks-4.19.14.tgz", + "integrity": "sha512-GuorU374D0Ft7RtIZWWc7ltIkV3ThjU/u+LwbNzh5y7iaVs4l64qvqopqoj/IoRVdahpnLEO3MNxj9InlUiNeg==", "dependencies": { "@babel/runtime": "^7.16.0", "@wordpress/api-fetch": "^6.39.13", - "@wordpress/components": "^25.8.13", + "@wordpress/components": "^25.8.14", "@wordpress/compose": "^6.19.13", "@wordpress/element": "^5.19.13", "@wordpress/i18n": "^4.42.13", @@ -7698,12 +7698,12 @@ } }, "node_modules/@wordpress/nux": { - "version": "8.4.13", - "resolved": "https://registry.npmjs.org/@wordpress/nux/-/nux-8.4.13.tgz", - "integrity": "sha512-xWG622MaEfIr1Z735GGnW5/CYbX9qnJPHzTOsATtbSUUTPEWiPXcUkPTVPvWry1Lj5Y8ib6jNgSEQJQJJaXzmw==", + "version": "8.4.14", + "resolved": "https://registry.npmjs.org/@wordpress/nux/-/nux-8.4.14.tgz", + "integrity": "sha512-JcxUtWOzl7lTuv39BWRwzwPDvVEhFECGzK819i3kExbTjmsVHCHtsdB7khPrdAYZOm2GXzR1le+/UFfkGuHS2Q==", "dependencies": { "@babel/runtime": "^7.16.0", - "@wordpress/components": "^25.8.13", + "@wordpress/components": "^25.8.14", "@wordpress/compose": "^6.19.13", "@wordpress/data": "^9.12.13", "@wordpress/deprecated": "^3.42.13", @@ -7721,17 +7721,17 @@ } }, "node_modules/@wordpress/patterns": { - "version": "1.3.13", - "resolved": "https://registry.npmjs.org/@wordpress/patterns/-/patterns-1.3.13.tgz", - "integrity": "sha512-ATonHUTQk6dXea+hdSr8BLGE9OryHsnRn2MXNQLzr2kebV4BSmqXATNnC8k+I5F6CwMIQGo+LSsx614ht5vkFg==", + "version": "1.3.14", + "resolved": "https://registry.npmjs.org/@wordpress/patterns/-/patterns-1.3.14.tgz", + "integrity": "sha512-eaZWZlaF/MlxqDY7KYzL8cApY4b4f89wuqHVSmjv52UfvaqxW0vd09ddX+jwkcXysDHFzwM63takIIVZwYn9Lg==", "dependencies": { "@babel/runtime": "^7.16.0", "@wordpress/a11y": "^3.42.13", - "@wordpress/block-editor": "^12.10.13", + "@wordpress/block-editor": "^12.10.14", "@wordpress/blocks": "^12.19.13", - "@wordpress/components": "^25.8.13", + "@wordpress/components": "^25.8.14", "@wordpress/compose": "^6.19.13", - "@wordpress/core-data": "^6.19.13", + "@wordpress/core-data": "^6.19.14", "@wordpress/data": "^9.12.13", "@wordpress/element": "^5.19.13", "@wordpress/html-entities": "^3.42.13", @@ -7750,12 +7750,12 @@ } }, "node_modules/@wordpress/plugins": { - "version": "6.10.13", - "resolved": "https://registry.npmjs.org/@wordpress/plugins/-/plugins-6.10.13.tgz", - "integrity": "sha512-1fb9iRwU7yDJ95j0ms8F43DMk/bxrtwoNXPU/qcvxMyjJg3WFFOgnrW7jvm3Y7T9KG2o4LJlQF0znCdGX1TOMQ==", + "version": "6.10.14", + "resolved": "https://registry.npmjs.org/@wordpress/plugins/-/plugins-6.10.14.tgz", + "integrity": "sha512-Duxh0OxpSuUFTMHa500iitrD21/JeTklc8/Hf3ApCpn4SdDzFR4IrwUdoJk0jGDY79cTwBVeWts5GhObbJByng==", "dependencies": { "@babel/runtime": "^7.16.0", - "@wordpress/components": "^25.8.13", + "@wordpress/components": "^25.8.14", "@wordpress/compose": "^6.19.13", "@wordpress/element": "^5.19.13", "@wordpress/hooks": "^3.42.13", @@ -7788,13 +7788,13 @@ } }, "node_modules/@wordpress/preferences": { - "version": "3.19.13", - "resolved": "https://registry.npmjs.org/@wordpress/preferences/-/preferences-3.19.13.tgz", - "integrity": "sha512-+Rd3zBy8IlpSNg9l5JetIhtZKagQz5xb/QC9spIIHKqjzApeS9jIuQXBnrHY1LDdXR8KgiRR4Iu+7Ls4myOckQ==", + "version": "3.19.14", + "resolved": "https://registry.npmjs.org/@wordpress/preferences/-/preferences-3.19.14.tgz", + "integrity": "sha512-xLu+G22Vlm4KajE/Eimq8qLzBoxMZ7BJLp8WobFC3yyzdU9R785dug9t9et4r45NxWJr8aVWkFzhEBzAadHjnA==", "dependencies": { "@babel/runtime": "^7.16.0", "@wordpress/a11y": "^3.42.13", - "@wordpress/components": "^25.8.13", + "@wordpress/components": "^25.8.14", "@wordpress/data": "^9.12.13", "@wordpress/element": "^5.19.13", "@wordpress/i18n": "^4.42.13", @@ -7887,15 +7887,15 @@ } }, "node_modules/@wordpress/reusable-blocks": { - "version": "4.19.13", - "resolved": "https://registry.npmjs.org/@wordpress/reusable-blocks/-/reusable-blocks-4.19.13.tgz", - "integrity": "sha512-LWfMG2sgH3oP8gKRyOWRm6sX2sZx41hvfHnf6wkfd+Jz0mI4y/hHx4pVW/Y6qIxVQZodALSdPI3P1djqt6pZ/A==", + "version": "4.19.14", + "resolved": "https://registry.npmjs.org/@wordpress/reusable-blocks/-/reusable-blocks-4.19.14.tgz", + "integrity": "sha512-WhQNDtq2ohGlGlodNyEbvMux631D+7jRABwodvoC42dVJyHR3lH1O8uhnQeKyPl91YWLxJ6+mHmrPInEo2fAcQ==", "dependencies": { "@babel/runtime": "^7.16.0", - "@wordpress/block-editor": "^12.10.13", + "@wordpress/block-editor": "^12.10.14", "@wordpress/blocks": "^12.19.13", - "@wordpress/components": "^25.8.13", - "@wordpress/core-data": "^6.19.13", + "@wordpress/components": "^25.8.14", + "@wordpress/core-data": "^6.19.14", "@wordpress/data": "^9.12.13", "@wordpress/element": "^5.19.13", "@wordpress/i18n": "^4.42.13", @@ -8371,14 +8371,14 @@ } }, "node_modules/@wordpress/server-side-render": { - "version": "4.19.13", - "resolved": "https://registry.npmjs.org/@wordpress/server-side-render/-/server-side-render-4.19.13.tgz", - "integrity": "sha512-gE8CgLtfiXAKsVU9lJttSwTRMLDdMuIY8bpvqaO73WrpeMVFHS97KgaYD+DK8Yi7UByn3oz5O+mGTNfz4t0GLw==", + "version": "4.19.14", + "resolved": "https://registry.npmjs.org/@wordpress/server-side-render/-/server-side-render-4.19.14.tgz", + "integrity": "sha512-As3Xc3TDM0R0siAFaldobRdZnPfQQMXvlQxalFJgs/kSoYOmcdc46mR5Wgmfn7r0Kc/Z5uOHLbvm4mWekE0a2A==", "dependencies": { "@babel/runtime": "^7.16.0", "@wordpress/api-fetch": "^6.39.13", "@wordpress/blocks": "^12.19.13", - "@wordpress/components": "^25.8.13", + "@wordpress/components": "^25.8.14", "@wordpress/compose": "^6.19.13", "@wordpress/data": "^9.12.13", "@wordpress/deprecated": "^3.42.13", @@ -8510,17 +8510,17 @@ } }, "node_modules/@wordpress/widgets": { - "version": "3.19.13", - "resolved": "https://registry.npmjs.org/@wordpress/widgets/-/widgets-3.19.13.tgz", - "integrity": "sha512-+IwGEDSy17PD7ghfP3d4+25q3EDw9NFUDnLsGR4nao3tAJT+Eyi8/BJkimR0CQXFcBHGt7PqI9SAEKTs1qqBHA==", + "version": "3.19.14", + "resolved": "https://registry.npmjs.org/@wordpress/widgets/-/widgets-3.19.14.tgz", + "integrity": "sha512-nFyXrCBVp24joFa96sAdNwkWnnf23t960ebnoW+Wk+lMT0PsGfGjiMIRmtks2cfqbQuQYFdO/8go+DSE54ekAg==", "dependencies": { "@babel/runtime": "^7.16.0", "@wordpress/api-fetch": "^6.39.13", - "@wordpress/block-editor": "^12.10.13", + "@wordpress/block-editor": "^12.10.14", "@wordpress/blocks": "^12.19.13", - "@wordpress/components": "^25.8.13", + "@wordpress/components": "^25.8.14", "@wordpress/compose": "^6.19.13", - "@wordpress/core-data": "^6.19.13", + "@wordpress/core-data": "^6.19.14", "@wordpress/data": "^9.12.13", "@wordpress/element": "^5.19.13", "@wordpress/i18n": "^4.42.13", @@ -38630,36 +38630,36 @@ } }, "@wordpress/block-directory": { - "version": "4.19.13", - "resolved": "https://registry.npmjs.org/@wordpress/block-directory/-/block-directory-4.19.13.tgz", - "integrity": "sha512-NM+bec+5CmPOcqLgYqtOZoTdagDHgVhgQk0/3vHqLQZcCyP0PUDNupbvcg2q/KMP78CjL+oWt6aiw4q1eQ7yLw==", + "version": "4.19.16", + "resolved": "https://registry.npmjs.org/@wordpress/block-directory/-/block-directory-4.19.16.tgz", + "integrity": "sha512-7YOqeZt8ExyMidbblzht7x5jnfpZVD6N69VuDrvdlB/8eB7gl62tKZdNXHwWoZccSWJb+xUTZL01k2HpJulcPQ==", "requires": { "@babel/runtime": "^7.16.0", "@wordpress/a11y": "^3.42.13", "@wordpress/api-fetch": "^6.39.13", - "@wordpress/block-editor": "^12.10.13", + "@wordpress/block-editor": "^12.10.14", "@wordpress/blocks": "^12.19.13", - "@wordpress/components": "^25.8.13", + "@wordpress/components": "^25.8.14", "@wordpress/compose": "^6.19.13", - "@wordpress/core-data": "^6.19.13", + "@wordpress/core-data": "^6.19.14", "@wordpress/data": "^9.12.13", - "@wordpress/edit-post": "^7.19.13", - "@wordpress/editor": "^13.19.13", + "@wordpress/edit-post": "^7.19.16", + "@wordpress/editor": "^13.19.14", "@wordpress/element": "^5.19.13", "@wordpress/hooks": "^3.42.13", "@wordpress/html-entities": "^3.42.13", "@wordpress/i18n": "^4.42.13", "@wordpress/icons": "^9.33.13", "@wordpress/notices": "^4.10.13", - "@wordpress/plugins": "^6.10.13", + "@wordpress/plugins": "^6.10.14", "@wordpress/url": "^3.43.13", "change-case": "^4.1.2" } }, "@wordpress/block-editor": { - "version": "12.10.13", - "resolved": "https://registry.npmjs.org/@wordpress/block-editor/-/block-editor-12.10.13.tgz", - "integrity": "sha512-QT5NSgU9WYAmEK3QcDM2W0ChoukeiKRivg3upbbfJh/Njo3VvBROyoziL1Nvor/4nABXl+PRTBBxdsVtMWLtiA==", + "version": "12.10.14", + "resolved": "https://registry.npmjs.org/@wordpress/block-editor/-/block-editor-12.10.14.tgz", + "integrity": "sha512-x56FPZZfJPk/Vd1aKIdpBIllrUuAVgwom+mYH0OohCmUzCBp1Eg8Urg5nshZpiLXpHt2dXycQCLu2Mpb+YpOJw==", "requires": { "@babel/runtime": "^7.16.0", "@emotion/react": "^11.7.1", @@ -38669,8 +38669,8 @@ "@wordpress/api-fetch": "^6.39.13", "@wordpress/blob": "^3.42.13", "@wordpress/blocks": "^12.19.13", - "@wordpress/commands": "^0.13.13", - "@wordpress/components": "^25.8.13", + "@wordpress/commands": "^0.13.14", + "@wordpress/components": "^25.8.14", "@wordpress/compose": "^6.19.13", "@wordpress/data": "^9.12.13", "@wordpress/date": "^4.42.13", @@ -38686,7 +38686,7 @@ "@wordpress/keyboard-shortcuts": "^4.19.13", "@wordpress/keycodes": "^3.42.13", "@wordpress/notices": "^4.10.13", - "@wordpress/preferences": "^3.19.13", + "@wordpress/preferences": "^3.19.14", "@wordpress/private-apis": "^0.24.13", "@wordpress/rich-text": "^6.19.13", "@wordpress/shortcode": "^3.42.13", @@ -38711,20 +38711,20 @@ } }, "@wordpress/block-library": { - "version": "8.19.13", - "resolved": "https://registry.npmjs.org/@wordpress/block-library/-/block-library-8.19.13.tgz", - "integrity": "sha512-JasXSCmRfQsmLjGNWWH6z4+m8a/sv4dn3uuw4i+BgMo5JTg6CIQy85rHz2YWzkMqd+P20978GjJKtkwE4gc/JQ==", + "version": "8.19.16", + "resolved": "https://registry.npmjs.org/@wordpress/block-library/-/block-library-8.19.16.tgz", + "integrity": "sha512-6NqTHjEYk3X+jzw6JS3pOgVYl2HPlr0iAI3Ch9sdOxozAm1+VrE5DKeM//rf9QpR7wWJ6je4F/eNjZ2WJIYTfw==", "requires": { "@babel/runtime": "^7.16.0", "@wordpress/a11y": "^3.42.13", "@wordpress/api-fetch": "^6.39.13", "@wordpress/autop": "^3.42.13", "@wordpress/blob": "^3.42.13", - "@wordpress/block-editor": "^12.10.13", + "@wordpress/block-editor": "^12.10.14", "@wordpress/blocks": "^12.19.13", - "@wordpress/components": "^25.8.13", + "@wordpress/components": "^25.8.14", "@wordpress/compose": "^6.19.13", - "@wordpress/core-data": "^6.19.13", + "@wordpress/core-data": "^6.19.14", "@wordpress/data": "^9.12.13", "@wordpress/date": "^4.42.13", "@wordpress/deprecated": "^3.42.13", @@ -38740,9 +38740,9 @@ "@wordpress/notices": "^4.10.13", "@wordpress/primitives": "^3.40.13", "@wordpress/private-apis": "^0.24.13", - "@wordpress/reusable-blocks": "^4.19.13", + "@wordpress/reusable-blocks": "^4.19.14", "@wordpress/rich-text": "^6.19.13", - "@wordpress/server-side-render": "^4.19.13", + "@wordpress/server-side-render": "^4.19.14", "@wordpress/url": "^3.43.13", "@wordpress/viewport": "^5.19.13", "@wordpress/wordcount": "^3.42.13", @@ -38806,12 +38806,12 @@ "dev": true }, "@wordpress/commands": { - "version": "0.13.13", - "resolved": "https://registry.npmjs.org/@wordpress/commands/-/commands-0.13.13.tgz", - "integrity": "sha512-Z+g7X7csCHD5qJCkJhdc/q3Dg5BLTH5M9fp/80Z5xfHhDjsZz+uVqS2xWavAk6QyIqJlLMnk/9vLxqO1PJJqnw==", + "version": "0.13.14", + "resolved": "https://registry.npmjs.org/@wordpress/commands/-/commands-0.13.14.tgz", + "integrity": "sha512-aSOuRbsr+YYFvRbkXaubHdlAtf/xpG1mUWXEw9VMWCag77hiK6vk04Xb3N8ad8eo8am0N/iRgn8V8IS4LyBTyA==", "requires": { "@babel/runtime": "^7.16.0", - "@wordpress/components": "^25.8.13", + "@wordpress/components": "^25.8.14", "@wordpress/data": "^9.12.13", "@wordpress/element": "^5.19.13", "@wordpress/i18n": "^4.42.13", @@ -38824,9 +38824,9 @@ } }, "@wordpress/components": { - "version": "25.8.13", - "resolved": "https://registry.npmjs.org/@wordpress/components/-/components-25.8.13.tgz", - "integrity": "sha512-Q3A1mZDgkCounVWawCzbqEbc1nAbm6L74GBNYllO5pxsccNsjcDHAtAEmx9BJzKd4SHEU6bYrgponWvhvLouFA==", + "version": "25.8.14", + "resolved": "https://registry.npmjs.org/@wordpress/components/-/components-25.8.14.tgz", + "integrity": "sha512-wRQSRlLXsL4bEd1JhCQPSdIb0bO4WDAloQufeyIbXUIK9CDgN/jmkv+vrgKrpP3Nqu1sBAFzW1qd9WEXfSBgXw==", "requires": { "@ariakit/react": "^0.2.12", "@babel/runtime": "^7.16.0", @@ -38900,14 +38900,14 @@ } }, "@wordpress/core-commands": { - "version": "0.11.13", - "resolved": "https://registry.npmjs.org/@wordpress/core-commands/-/core-commands-0.11.13.tgz", - "integrity": "sha512-gwiorFZSPeq+UItsPsWOrypfDddTF33+idK6cz18f1PIl6MoGLwNKuiq3A9f28tG4yFLrv5awHATF5PT4vjvKg==", + "version": "0.11.14", + "resolved": "https://registry.npmjs.org/@wordpress/core-commands/-/core-commands-0.11.14.tgz", + "integrity": "sha512-f2DA9lUji96OC5UD85Gbv2vz14R0TR+FSXzXAa68F/EBPFkiaxs2huhruhRvZKbasxugk/vjTBbQuwZ8rinROA==", "requires": { "@babel/runtime": "^7.16.0", - "@wordpress/block-editor": "^12.10.13", - "@wordpress/commands": "^0.13.13", - "@wordpress/core-data": "^6.19.13", + "@wordpress/block-editor": "^12.10.14", + "@wordpress/commands": "^0.13.14", + "@wordpress/core-data": "^6.19.14", "@wordpress/data": "^9.12.13", "@wordpress/element": "^5.19.13", "@wordpress/i18n": "^4.42.13", @@ -38918,13 +38918,13 @@ } }, "@wordpress/core-data": { - "version": "6.19.13", - "resolved": "https://registry.npmjs.org/@wordpress/core-data/-/core-data-6.19.13.tgz", - "integrity": "sha512-rScMXJkasThvyFea8w+ajGUiOuaR+fEir1oh/obRaKxrYpSMqaf5gKuvpBGxAeMJMsg0yGn5/E4FXGF4TGuX9Q==", + "version": "6.19.14", + "resolved": "https://registry.npmjs.org/@wordpress/core-data/-/core-data-6.19.14.tgz", + "integrity": "sha512-wdstu/qMBKwXnFRX4wMeTkxvHsOgbXm7ZJ0Lgtj+jE86O086Ook7suxacOdMcCaAKNCfMqoGBHtjsNQk3SWE1Q==", "requires": { "@babel/runtime": "^7.16.0", "@wordpress/api-fetch": "^6.39.13", - "@wordpress/block-editor": "^12.10.13", + "@wordpress/block-editor": "^12.10.14", "@wordpress/blocks": "^12.19.13", "@wordpress/compose": "^6.19.13", "@wordpress/data": "^9.12.13", @@ -38946,31 +38946,31 @@ } }, "@wordpress/customize-widgets": { - "version": "4.19.13", - "resolved": "https://registry.npmjs.org/@wordpress/customize-widgets/-/customize-widgets-4.19.13.tgz", - "integrity": "sha512-Wwur4j8tuwV6/KHaZwcSZtqdrOZdWLIn9jL4tK5nTEGv4u1OV+SzucYxqvVqCu6otsyU2lVrRX9kTyiYkJGyJw==", + "version": "4.19.16", + "resolved": "https://registry.npmjs.org/@wordpress/customize-widgets/-/customize-widgets-4.19.16.tgz", + "integrity": "sha512-UK4RrEBFwdn8WcY7qXXbRcncuWXLMpB9gjiBVhwPmM5m1//A0wsOQu2kAkZeACuhYoEJ/N6g4yZh2ZnldJVR3w==", "requires": { "@babel/runtime": "^7.16.0", - "@wordpress/block-editor": "^12.10.13", - "@wordpress/block-library": "^8.19.13", + "@wordpress/block-editor": "^12.10.14", + "@wordpress/block-library": "^8.19.16", "@wordpress/blocks": "^12.19.13", - "@wordpress/components": "^25.8.13", + "@wordpress/components": "^25.8.14", "@wordpress/compose": "^6.19.13", - "@wordpress/core-data": "^6.19.13", + "@wordpress/core-data": "^6.19.14", "@wordpress/data": "^9.12.13", "@wordpress/dom": "^3.42.13", "@wordpress/element": "^5.19.13", "@wordpress/hooks": "^3.42.13", "@wordpress/i18n": "^4.42.13", "@wordpress/icons": "^9.33.13", - "@wordpress/interface": "^5.19.13", + "@wordpress/interface": "^5.19.14", "@wordpress/is-shallow-equal": "^4.42.13", "@wordpress/keyboard-shortcuts": "^4.19.13", "@wordpress/keycodes": "^3.42.13", "@wordpress/media-utils": "^4.33.13", - "@wordpress/preferences": "^3.19.13", + "@wordpress/preferences": "^3.19.14", "@wordpress/private-apis": "^0.24.13", - "@wordpress/widgets": "^3.19.13", + "@wordpress/widgets": "^3.19.14", "classnames": "^2.3.1", "fast-deep-equal": "^3.1.3" } @@ -39175,89 +39175,89 @@ } }, "@wordpress/edit-post": { - "version": "7.19.13", - "resolved": "https://registry.npmjs.org/@wordpress/edit-post/-/edit-post-7.19.13.tgz", - "integrity": "sha512-iOSnEZdEY1O661vkwG22BC/Si0+QJ6Xo8dgrOSrJmoGeEcN7OrfBaw9JeT/if5Tn0U4dRCI7YtCyUwqtvCicwQ==", + "version": "7.19.16", + "resolved": "https://registry.npmjs.org/@wordpress/edit-post/-/edit-post-7.19.16.tgz", + "integrity": "sha512-PK0XVHLrn6Bg47O8sq7UIBykJOJGF2xsbkOjhRVniD+6EYdYifpGYHTC9nHogEfw691xcz+vAqS87D01x3SfEQ==", "requires": { "@babel/runtime": "^7.16.0", "@wordpress/a11y": "^3.42.13", "@wordpress/api-fetch": "^6.39.13", - "@wordpress/block-editor": "^12.10.13", - "@wordpress/block-library": "^8.19.13", + "@wordpress/block-editor": "^12.10.14", + "@wordpress/block-library": "^8.19.16", "@wordpress/blocks": "^12.19.13", - "@wordpress/commands": "^0.13.13", - "@wordpress/components": "^25.8.13", + "@wordpress/commands": "^0.13.14", + "@wordpress/components": "^25.8.14", "@wordpress/compose": "^6.19.13", - "@wordpress/core-commands": "^0.11.13", - "@wordpress/core-data": "^6.19.13", + "@wordpress/core-commands": "^0.11.14", + "@wordpress/core-data": "^6.19.14", "@wordpress/data": "^9.12.13", "@wordpress/deprecated": "^3.42.13", "@wordpress/dom": "^3.42.13", - "@wordpress/editor": "^13.19.13", + "@wordpress/editor": "^13.19.14", "@wordpress/element": "^5.19.13", "@wordpress/hooks": "^3.42.13", "@wordpress/i18n": "^4.42.13", "@wordpress/icons": "^9.33.13", - "@wordpress/interface": "^5.19.13", + "@wordpress/interface": "^5.19.14", "@wordpress/keyboard-shortcuts": "^4.19.13", "@wordpress/keycodes": "^3.42.13", "@wordpress/media-utils": "^4.33.13", "@wordpress/notices": "^4.10.13", - "@wordpress/plugins": "^6.10.13", - "@wordpress/preferences": "^3.19.13", + "@wordpress/plugins": "^6.10.14", + "@wordpress/preferences": "^3.19.14", "@wordpress/private-apis": "^0.24.13", "@wordpress/url": "^3.43.13", "@wordpress/viewport": "^5.19.13", "@wordpress/warning": "^2.42.13", - "@wordpress/widgets": "^3.19.13", + "@wordpress/widgets": "^3.19.14", "classnames": "^2.3.1", "memize": "^2.1.0", "rememo": "^4.0.2" } }, "@wordpress/edit-site": { - "version": "5.19.13", - "resolved": "https://registry.npmjs.org/@wordpress/edit-site/-/edit-site-5.19.13.tgz", - "integrity": "sha512-0xKu7FQw3h6EBj6fwP2KkeZqa6IaCwTuDx0ZQ5Mur03OsxH6UvuVm/KhNW7ONcw3V0mYsL87pcmJNhw/+L1yvQ==", + "version": "5.19.16", + "resolved": "https://registry.npmjs.org/@wordpress/edit-site/-/edit-site-5.19.16.tgz", + "integrity": "sha512-shraoCd4LCNngtBn9E7U6Na/l+zrU0nTXztgZSuVsqSGktAgHBi7pXMUTsCGqO/vp9fnmW9LU3tQ9XgLEogjkg==", "requires": { "@babel/runtime": "^7.16.0", "@wordpress/a11y": "^3.42.13", "@wordpress/api-fetch": "^6.39.13", - "@wordpress/block-editor": "^12.10.13", - "@wordpress/block-library": "^8.19.13", + "@wordpress/block-editor": "^12.10.14", + "@wordpress/block-library": "^8.19.16", "@wordpress/blocks": "^12.19.13", - "@wordpress/commands": "^0.13.13", - "@wordpress/components": "^25.8.13", + "@wordpress/commands": "^0.13.14", + "@wordpress/components": "^25.8.14", "@wordpress/compose": "^6.19.13", - "@wordpress/core-commands": "^0.11.13", - "@wordpress/core-data": "^6.19.13", + "@wordpress/core-commands": "^0.11.14", + "@wordpress/core-data": "^6.19.14", "@wordpress/data": "^9.12.13", "@wordpress/date": "^4.42.13", "@wordpress/deprecated": "^3.42.13", "@wordpress/dom": "^3.42.13", - "@wordpress/editor": "^13.19.13", + "@wordpress/editor": "^13.19.14", "@wordpress/element": "^5.19.13", "@wordpress/escape-html": "^2.42.13", "@wordpress/hooks": "^3.42.13", "@wordpress/html-entities": "^3.42.13", "@wordpress/i18n": "^4.42.13", "@wordpress/icons": "^9.33.13", - "@wordpress/interface": "^5.19.13", + "@wordpress/interface": "^5.19.14", "@wordpress/keyboard-shortcuts": "^4.19.13", "@wordpress/keycodes": "^3.42.13", "@wordpress/media-utils": "^4.33.13", "@wordpress/notices": "^4.10.13", - "@wordpress/patterns": "^1.3.13", - "@wordpress/plugins": "^6.10.13", - "@wordpress/preferences": "^3.19.13", + "@wordpress/patterns": "^1.3.14", + "@wordpress/plugins": "^6.10.14", + "@wordpress/preferences": "^3.19.14", "@wordpress/primitives": "^3.40.13", "@wordpress/private-apis": "^0.24.13", - "@wordpress/reusable-blocks": "^4.19.13", + "@wordpress/reusable-blocks": "^4.19.14", "@wordpress/router": "^0.11.13", "@wordpress/style-engine": "^1.25.13", "@wordpress/url": "^3.43.13", "@wordpress/viewport": "^5.19.13", - "@wordpress/widgets": "^3.19.13", + "@wordpress/widgets": "^3.19.14", "@wordpress/wordcount": "^3.42.13", "change-case": "^4.1.2", "classnames": "^2.3.1", @@ -39273,18 +39273,18 @@ } }, "@wordpress/edit-widgets": { - "version": "5.19.13", - "resolved": "https://registry.npmjs.org/@wordpress/edit-widgets/-/edit-widgets-5.19.13.tgz", - "integrity": "sha512-SFdDXp2o6I+jNDMF0ncnOE55vuKj3TSUae6D31yzjzsIYLjLWwiv7EFOmNnqBKR6704UvZPAOwin2KojecdMqw==", + "version": "5.19.16", + "resolved": "https://registry.npmjs.org/@wordpress/edit-widgets/-/edit-widgets-5.19.16.tgz", + "integrity": "sha512-1yTkLHQjf/LEmxlw2y0bqgkZcqO2Gs0H8QK1JHEJdHrAK+R5nBd55Jq4Wb2IU+QsUAaGvQzuF+FfHAA4YkLUwQ==", "requires": { "@babel/runtime": "^7.16.0", "@wordpress/api-fetch": "^6.39.13", - "@wordpress/block-editor": "^12.10.13", - "@wordpress/block-library": "^8.19.13", + "@wordpress/block-editor": "^12.10.14", + "@wordpress/block-library": "^8.19.16", "@wordpress/blocks": "^12.19.13", - "@wordpress/components": "^25.8.13", + "@wordpress/components": "^25.8.14", "@wordpress/compose": "^6.19.13", - "@wordpress/core-data": "^6.19.13", + "@wordpress/core-data": "^6.19.14", "@wordpress/data": "^9.12.13", "@wordpress/deprecated": "^3.42.13", "@wordpress/dom": "^3.42.13", @@ -39292,35 +39292,35 @@ "@wordpress/hooks": "^3.42.13", "@wordpress/i18n": "^4.42.13", "@wordpress/icons": "^9.33.13", - "@wordpress/interface": "^5.19.13", + "@wordpress/interface": "^5.19.14", "@wordpress/keyboard-shortcuts": "^4.19.13", "@wordpress/keycodes": "^3.42.13", "@wordpress/media-utils": "^4.33.13", "@wordpress/notices": "^4.10.13", - "@wordpress/patterns": "^1.3.13", - "@wordpress/plugins": "^6.10.13", - "@wordpress/preferences": "^3.19.13", + "@wordpress/patterns": "^1.3.14", + "@wordpress/plugins": "^6.10.14", + "@wordpress/preferences": "^3.19.14", "@wordpress/private-apis": "^0.24.13", - "@wordpress/reusable-blocks": "^4.19.13", + "@wordpress/reusable-blocks": "^4.19.14", "@wordpress/url": "^3.43.13", - "@wordpress/widgets": "^3.19.13", + "@wordpress/widgets": "^3.19.14", "classnames": "^2.3.1" } }, "@wordpress/editor": { - "version": "13.19.13", - "resolved": "https://registry.npmjs.org/@wordpress/editor/-/editor-13.19.13.tgz", - "integrity": "sha512-8df51NC4+pCE45AL1NFo8RXq7rND97yxHjb1rECLRvYUetq08pUX2m+kYWmxxSHaVHNytOmMtERpkYGNC7sAXQ==", + "version": "13.19.14", + "resolved": "https://registry.npmjs.org/@wordpress/editor/-/editor-13.19.14.tgz", + "integrity": "sha512-t1RFJl0Bf+qJpBHtiUl0qoxJjpNNGcpSZLejnhR97+i32l/4ewg8+z69zwFtW4ChNQjLnAFnpQZ5pT/CqkkKpQ==", "requires": { "@babel/runtime": "^7.16.0", "@wordpress/a11y": "^3.42.13", "@wordpress/api-fetch": "^6.39.13", "@wordpress/blob": "^3.42.13", - "@wordpress/block-editor": "^12.10.13", + "@wordpress/block-editor": "^12.10.14", "@wordpress/blocks": "^12.19.13", - "@wordpress/components": "^25.8.13", + "@wordpress/components": "^25.8.14", "@wordpress/compose": "^6.19.13", - "@wordpress/core-data": "^6.19.13", + "@wordpress/core-data": "^6.19.14", "@wordpress/data": "^9.12.13", "@wordpress/date": "^4.42.13", "@wordpress/deprecated": "^3.42.13", @@ -39334,12 +39334,12 @@ "@wordpress/keycodes": "^3.42.13", "@wordpress/media-utils": "^4.33.13", "@wordpress/notices": "^4.10.13", - "@wordpress/patterns": "^1.3.13", - "@wordpress/preferences": "^3.19.13", + "@wordpress/patterns": "^1.3.14", + "@wordpress/preferences": "^3.19.14", "@wordpress/private-apis": "^0.24.13", - "@wordpress/reusable-blocks": "^4.19.13", + "@wordpress/reusable-blocks": "^4.19.14", "@wordpress/rich-text": "^6.19.13", - "@wordpress/server-side-render": "^4.19.13", + "@wordpress/server-side-render": "^4.19.14", "@wordpress/url": "^3.43.13", "@wordpress/wordcount": "^3.42.13", "classnames": "^2.3.1", @@ -39410,14 +39410,14 @@ } }, "@wordpress/format-library": { - "version": "4.19.13", - "resolved": "https://registry.npmjs.org/@wordpress/format-library/-/format-library-4.19.13.tgz", - "integrity": "sha512-EY8oCHXbfRogyKvRkF5z58O04o8MzQDY6Ms1mqZ95FGdAt9TJ6sfJgPXbj8a9bR7WAbx74h5eo6t2K1m3HZu6A==", + "version": "4.19.14", + "resolved": "https://registry.npmjs.org/@wordpress/format-library/-/format-library-4.19.14.tgz", + "integrity": "sha512-NyJ1nmb6PODE5hXM9oOEBlYA48k6c2DlGcUTXkSzDcdLPRVinTeWDfPL4kpze30JcQPv9m6Y5/EfWp48bDnByA==", "requires": { "@babel/runtime": "^7.16.0", "@wordpress/a11y": "^3.42.13", - "@wordpress/block-editor": "^12.10.13", - "@wordpress/components": "^25.8.13", + "@wordpress/block-editor": "^12.10.14", + "@wordpress/components": "^25.8.14", "@wordpress/compose": "^6.19.13", "@wordpress/data": "^9.12.13", "@wordpress/element": "^5.19.13", @@ -39478,21 +39478,21 @@ } }, "@wordpress/interface": { - "version": "5.19.13", - "resolved": "https://registry.npmjs.org/@wordpress/interface/-/interface-5.19.13.tgz", - "integrity": "sha512-TdE6B3FlZoYqf9WBFPh8g34ciAABaQR4uBHgGv4uXxsgu8sCBx3zIKJZuMLTv6StsivKFYn4pBFZRD/SZGx49w==", + "version": "5.19.14", + "resolved": "https://registry.npmjs.org/@wordpress/interface/-/interface-5.19.14.tgz", + "integrity": "sha512-WsIsSKJuhAcXD3YbmUoncL1JZ6hKAJXs7Lb/bjrOJxCts/YOy5yMF3/I05r8f1Tfw/pS8wlHMRjIXH/gvnvWVA==", "requires": { "@babel/runtime": "^7.16.0", "@wordpress/a11y": "^3.42.13", - "@wordpress/components": "^25.8.13", + "@wordpress/components": "^25.8.14", "@wordpress/compose": "^6.19.13", "@wordpress/data": "^9.12.13", "@wordpress/deprecated": "^3.42.13", "@wordpress/element": "^5.19.13", "@wordpress/i18n": "^4.42.13", "@wordpress/icons": "^9.33.13", - "@wordpress/plugins": "^6.10.13", - "@wordpress/preferences": "^3.19.13", + "@wordpress/plugins": "^6.10.14", + "@wordpress/preferences": "^3.19.14", "@wordpress/viewport": "^5.19.13", "classnames": "^2.3.1" } @@ -39548,13 +39548,13 @@ } }, "@wordpress/list-reusable-blocks": { - "version": "4.19.13", - "resolved": "https://registry.npmjs.org/@wordpress/list-reusable-blocks/-/list-reusable-blocks-4.19.13.tgz", - "integrity": "sha512-OnLlQq2sQ4xj5/UhmbC5eTSSTGf8iAfHGOvPi3OZF1Ig9otGsonjSrATgJSskomZFkjetWUQfBOVBxA23Ni7cA==", + "version": "4.19.14", + "resolved": "https://registry.npmjs.org/@wordpress/list-reusable-blocks/-/list-reusable-blocks-4.19.14.tgz", + "integrity": "sha512-GuorU374D0Ft7RtIZWWc7ltIkV3ThjU/u+LwbNzh5y7iaVs4l64qvqopqoj/IoRVdahpnLEO3MNxj9InlUiNeg==", "requires": { "@babel/runtime": "^7.16.0", "@wordpress/api-fetch": "^6.39.13", - "@wordpress/components": "^25.8.13", + "@wordpress/components": "^25.8.14", "@wordpress/compose": "^6.19.13", "@wordpress/element": "^5.19.13", "@wordpress/i18n": "^4.42.13", @@ -39590,12 +39590,12 @@ "dev": true }, "@wordpress/nux": { - "version": "8.4.13", - "resolved": "https://registry.npmjs.org/@wordpress/nux/-/nux-8.4.13.tgz", - "integrity": "sha512-xWG622MaEfIr1Z735GGnW5/CYbX9qnJPHzTOsATtbSUUTPEWiPXcUkPTVPvWry1Lj5Y8ib6jNgSEQJQJJaXzmw==", + "version": "8.4.14", + "resolved": "https://registry.npmjs.org/@wordpress/nux/-/nux-8.4.14.tgz", + "integrity": "sha512-JcxUtWOzl7lTuv39BWRwzwPDvVEhFECGzK819i3kExbTjmsVHCHtsdB7khPrdAYZOm2GXzR1le+/UFfkGuHS2Q==", "requires": { "@babel/runtime": "^7.16.0", - "@wordpress/components": "^25.8.13", + "@wordpress/components": "^25.8.14", "@wordpress/compose": "^6.19.13", "@wordpress/data": "^9.12.13", "@wordpress/deprecated": "^3.42.13", @@ -39606,17 +39606,17 @@ } }, "@wordpress/patterns": { - "version": "1.3.13", - "resolved": "https://registry.npmjs.org/@wordpress/patterns/-/patterns-1.3.13.tgz", - "integrity": "sha512-ATonHUTQk6dXea+hdSr8BLGE9OryHsnRn2MXNQLzr2kebV4BSmqXATNnC8k+I5F6CwMIQGo+LSsx614ht5vkFg==", + "version": "1.3.14", + "resolved": "https://registry.npmjs.org/@wordpress/patterns/-/patterns-1.3.14.tgz", + "integrity": "sha512-eaZWZlaF/MlxqDY7KYzL8cApY4b4f89wuqHVSmjv52UfvaqxW0vd09ddX+jwkcXysDHFzwM63takIIVZwYn9Lg==", "requires": { "@babel/runtime": "^7.16.0", "@wordpress/a11y": "^3.42.13", - "@wordpress/block-editor": "^12.10.13", + "@wordpress/block-editor": "^12.10.14", "@wordpress/blocks": "^12.19.13", - "@wordpress/components": "^25.8.13", + "@wordpress/components": "^25.8.14", "@wordpress/compose": "^6.19.13", - "@wordpress/core-data": "^6.19.13", + "@wordpress/core-data": "^6.19.14", "@wordpress/data": "^9.12.13", "@wordpress/element": "^5.19.13", "@wordpress/html-entities": "^3.42.13", @@ -39628,12 +39628,12 @@ } }, "@wordpress/plugins": { - "version": "6.10.13", - "resolved": "https://registry.npmjs.org/@wordpress/plugins/-/plugins-6.10.13.tgz", - "integrity": "sha512-1fb9iRwU7yDJ95j0ms8F43DMk/bxrtwoNXPU/qcvxMyjJg3WFFOgnrW7jvm3Y7T9KG2o4LJlQF0znCdGX1TOMQ==", + "version": "6.10.14", + "resolved": "https://registry.npmjs.org/@wordpress/plugins/-/plugins-6.10.14.tgz", + "integrity": "sha512-Duxh0OxpSuUFTMHa500iitrD21/JeTklc8/Hf3ApCpn4SdDzFR4IrwUdoJk0jGDY79cTwBVeWts5GhObbJByng==", "requires": { "@babel/runtime": "^7.16.0", - "@wordpress/components": "^25.8.13", + "@wordpress/components": "^25.8.14", "@wordpress/compose": "^6.19.13", "@wordpress/element": "^5.19.13", "@wordpress/hooks": "^3.42.13", @@ -39653,13 +39653,13 @@ } }, "@wordpress/preferences": { - "version": "3.19.13", - "resolved": "https://registry.npmjs.org/@wordpress/preferences/-/preferences-3.19.13.tgz", - "integrity": "sha512-+Rd3zBy8IlpSNg9l5JetIhtZKagQz5xb/QC9spIIHKqjzApeS9jIuQXBnrHY1LDdXR8KgiRR4Iu+7Ls4myOckQ==", + "version": "3.19.14", + "resolved": "https://registry.npmjs.org/@wordpress/preferences/-/preferences-3.19.14.tgz", + "integrity": "sha512-xLu+G22Vlm4KajE/Eimq8qLzBoxMZ7BJLp8WobFC3yyzdU9R785dug9t9et4r45NxWJr8aVWkFzhEBzAadHjnA==", "requires": { "@babel/runtime": "^7.16.0", "@wordpress/a11y": "^3.42.13", - "@wordpress/components": "^25.8.13", + "@wordpress/components": "^25.8.14", "@wordpress/data": "^9.12.13", "@wordpress/element": "^5.19.13", "@wordpress/i18n": "^4.42.13", @@ -39721,15 +39721,15 @@ } }, "@wordpress/reusable-blocks": { - "version": "4.19.13", - "resolved": "https://registry.npmjs.org/@wordpress/reusable-blocks/-/reusable-blocks-4.19.13.tgz", - "integrity": "sha512-LWfMG2sgH3oP8gKRyOWRm6sX2sZx41hvfHnf6wkfd+Jz0mI4y/hHx4pVW/Y6qIxVQZodALSdPI3P1djqt6pZ/A==", + "version": "4.19.14", + "resolved": "https://registry.npmjs.org/@wordpress/reusable-blocks/-/reusable-blocks-4.19.14.tgz", + "integrity": "sha512-WhQNDtq2ohGlGlodNyEbvMux631D+7jRABwodvoC42dVJyHR3lH1O8uhnQeKyPl91YWLxJ6+mHmrPInEo2fAcQ==", "requires": { "@babel/runtime": "^7.16.0", - "@wordpress/block-editor": "^12.10.13", + "@wordpress/block-editor": "^12.10.14", "@wordpress/blocks": "^12.19.13", - "@wordpress/components": "^25.8.13", - "@wordpress/core-data": "^6.19.13", + "@wordpress/components": "^25.8.14", + "@wordpress/core-data": "^6.19.14", "@wordpress/data": "^9.12.13", "@wordpress/element": "^5.19.13", "@wordpress/i18n": "^4.42.13", @@ -40060,14 +40060,14 @@ } }, "@wordpress/server-side-render": { - "version": "4.19.13", - "resolved": "https://registry.npmjs.org/@wordpress/server-side-render/-/server-side-render-4.19.13.tgz", - "integrity": "sha512-gE8CgLtfiXAKsVU9lJttSwTRMLDdMuIY8bpvqaO73WrpeMVFHS97KgaYD+DK8Yi7UByn3oz5O+mGTNfz4t0GLw==", + "version": "4.19.14", + "resolved": "https://registry.npmjs.org/@wordpress/server-side-render/-/server-side-render-4.19.14.tgz", + "integrity": "sha512-As3Xc3TDM0R0siAFaldobRdZnPfQQMXvlQxalFJgs/kSoYOmcdc46mR5Wgmfn7r0Kc/Z5uOHLbvm4mWekE0a2A==", "requires": { "@babel/runtime": "^7.16.0", "@wordpress/api-fetch": "^6.39.13", "@wordpress/blocks": "^12.19.13", - "@wordpress/components": "^25.8.13", + "@wordpress/components": "^25.8.14", "@wordpress/compose": "^6.19.13", "@wordpress/data": "^9.12.13", "@wordpress/deprecated": "^3.42.13", @@ -40159,17 +40159,17 @@ "integrity": "sha512-SYi37xiR7Wq4Vde4JBkCYJIyfUQzyuABrwh7aon1XwcUhWP072tv4/LKP6F+zWYC5M8pPdRqjznxgwZ2mNzcyw==" }, "@wordpress/widgets": { - "version": "3.19.13", - "resolved": "https://registry.npmjs.org/@wordpress/widgets/-/widgets-3.19.13.tgz", - "integrity": "sha512-+IwGEDSy17PD7ghfP3d4+25q3EDw9NFUDnLsGR4nao3tAJT+Eyi8/BJkimR0CQXFcBHGt7PqI9SAEKTs1qqBHA==", + "version": "3.19.14", + "resolved": "https://registry.npmjs.org/@wordpress/widgets/-/widgets-3.19.14.tgz", + "integrity": "sha512-nFyXrCBVp24joFa96sAdNwkWnnf23t960ebnoW+Wk+lMT0PsGfGjiMIRmtks2cfqbQuQYFdO/8go+DSE54ekAg==", "requires": { "@babel/runtime": "^7.16.0", "@wordpress/api-fetch": "^6.39.13", - "@wordpress/block-editor": "^12.10.13", + "@wordpress/block-editor": "^12.10.14", "@wordpress/blocks": "^12.19.13", - "@wordpress/components": "^25.8.13", + "@wordpress/components": "^25.8.14", "@wordpress/compose": "^6.19.13", - "@wordpress/core-data": "^6.19.13", + "@wordpress/core-data": "^6.19.14", "@wordpress/data": "^9.12.13", "@wordpress/element": "^5.19.13", "@wordpress/i18n": "^4.42.13", diff --git a/package.json b/package.json index a25758279c0cd..6a9db6624057d 100644 --- a/package.json +++ b/package.json @@ -84,55 +84,55 @@ "@wordpress/api-fetch": "6.39.13", "@wordpress/autop": "3.42.13", "@wordpress/blob": "3.42.13", - "@wordpress/block-directory": "4.19.13", - "@wordpress/block-editor": "12.10.13", - "@wordpress/block-library": "8.19.13", + "@wordpress/block-directory": "4.19.16", + "@wordpress/block-editor": "12.10.14", + "@wordpress/block-library": "8.19.16", "@wordpress/block-serialization-default-parser": "4.42.13", "@wordpress/blocks": "12.19.13", - "@wordpress/commands": "0.13.13", - "@wordpress/components": "25.8.13", + "@wordpress/commands": "0.13.14", + "@wordpress/components": "25.8.14", "@wordpress/compose": "6.19.13", - "@wordpress/core-commands": "0.11.13", - "@wordpress/core-data": "6.19.13", - "@wordpress/customize-widgets": "4.19.13", + "@wordpress/core-commands": "0.11.14", + "@wordpress/core-data": "6.19.14", + "@wordpress/customize-widgets": "4.19.16", "@wordpress/data": "9.12.13", "@wordpress/data-controls": "3.11.13", "@wordpress/date": "4.42.13", "@wordpress/deprecated": "3.42.13", "@wordpress/dom": "3.42.13", "@wordpress/dom-ready": "3.42.13", - "@wordpress/edit-post": "7.19.13", - "@wordpress/edit-site": "5.19.13", - "@wordpress/edit-widgets": "5.19.13", - "@wordpress/editor": "13.19.13", + "@wordpress/edit-post": "7.19.16", + "@wordpress/edit-site": "5.19.16", + "@wordpress/edit-widgets": "5.19.16", + "@wordpress/editor": "13.19.14", "@wordpress/element": "5.19.13", "@wordpress/escape-html": "2.42.13", - "@wordpress/format-library": "4.19.13", + "@wordpress/format-library": "4.19.14", "@wordpress/hooks": "3.42.13", "@wordpress/html-entities": "3.42.13", "@wordpress/i18n": "4.42.13", "@wordpress/icons": "9.33.13", "@wordpress/interactivity": "2.3.13", - "@wordpress/interface": "5.19.13", + "@wordpress/interface": "5.19.14", "@wordpress/is-shallow-equal": "4.42.13", "@wordpress/keyboard-shortcuts": "4.19.13", "@wordpress/keycodes": "3.42.13", - "@wordpress/list-reusable-blocks": "4.19.13", + "@wordpress/list-reusable-blocks": "4.19.14", "@wordpress/media-utils": "4.33.13", "@wordpress/notices": "4.10.13", - "@wordpress/nux": "8.4.13", - "@wordpress/patterns": "1.3.13", - "@wordpress/plugins": "6.10.13", - "@wordpress/preferences": "3.19.13", + "@wordpress/nux": "8.4.14", + "@wordpress/patterns": "1.3.14", + "@wordpress/plugins": "6.10.14", + "@wordpress/preferences": "3.19.14", "@wordpress/preferences-persistence": "1.34.13", "@wordpress/primitives": "3.40.13", "@wordpress/priority-queue": "2.42.13", "@wordpress/private-apis": "0.24.13", "@wordpress/redux-routine": "4.42.13", - "@wordpress/reusable-blocks": "4.19.13", + "@wordpress/reusable-blocks": "4.19.14", "@wordpress/rich-text": "6.19.13", "@wordpress/router": "0.11.13", - "@wordpress/server-side-render": "4.19.13", + "@wordpress/server-side-render": "4.19.14", "@wordpress/shortcode": "3.42.13", "@wordpress/style-engine": "1.25.13", "@wordpress/sync": "0.4.13", @@ -141,7 +141,7 @@ "@wordpress/url": "3.43.13", "@wordpress/viewport": "5.19.13", "@wordpress/warning": "2.42.13", - "@wordpress/widgets": "3.19.13", + "@wordpress/widgets": "3.19.14", "@wordpress/wordcount": "3.42.13", "backbone": "1.5.0", "clipboard": "2.0.11", diff --git a/phpcs.xml.dist b/phpcs.xml.dist index 3defbc290a6b2..ccb04303218ae 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -250,6 +250,15 @@ /wp-tests-config-sample\.php + + + /wp-includes/html-api/class-wp-html-processor\.php + + diff --git a/src/js/_enqueues/admin/post.js b/src/js/_enqueues/admin/post.js index eb577013d5ad3..bba9c17358df6 100644 --- a/src/js/_enqueues/admin/post.js +++ b/src/js/_enqueues/admin/post.js @@ -1173,7 +1173,7 @@ jQuery( function($) { } /** - * When the dragging stopped make sure we return focus and do a sanity check on the height. + * When the dragging stopped make sure we return focus and do a confidence check on the height. */ function endDrag() { var height, toolbarHeight; @@ -1198,7 +1198,7 @@ jQuery( function($) { $document.off( '.wp-editor-resize' ); - // Sanity check: normalize height to stay within acceptable ranges. + // Confidence check: normalize height to stay within acceptable ranges. if ( height && height > 50 && height < 5000 ) { setUserSetting( 'ed_size', height ); } diff --git a/src/js/_enqueues/vendor/tinymce/utils/form_utils.js b/src/js/_enqueues/vendor/tinymce/utils/form_utils.js index 358ad60a9a364..8f8a234c953b1 100644 --- a/src/js/_enqueues/vendor/tinymce/utils/form_utils.js +++ b/src/js/_enqueues/vendor/tinymce/utils/form_utils.js @@ -199,7 +199,7 @@ function getCSSSize(size) { if (/^[0-9]+$/.test(size)) { size += 'px'; } - // Sanity check, IE doesn't like broken values + // Confidence check, IE doesn't like broken values else if (!(/^[0-9\.]+(px|%|in|cm|mm|em|ex|pt|pc)$/i.test(size))) { return ""; } diff --git a/src/js/_enqueues/wp/customize/controls.js b/src/js/_enqueues/wp/customize/controls.js index b6786b4d38d0e..650ac8a161052 100644 --- a/src/js/_enqueues/wp/customize/controls.js +++ b/src/js/_enqueues/wp/customize/controls.js @@ -3866,7 +3866,7 @@ var control = this, container, notifications, hasError = false; if ( 'undefined' !== typeof console && console.warn ) { - console.warn( '[DEPRECATED] wp.customize.Control.prototype.renderNotifications() is deprecated in favor of instantating a wp.customize.Notifications and calling its render() method.' ); + console.warn( '[DEPRECATED] wp.customize.Control.prototype.renderNotifications() is deprecated in favor of instantiating a wp.customize.Notifications and calling its render() method.' ); } container = control.getNotificationsContainerElement(); diff --git a/src/js/_enqueues/wp/theme.js b/src/js/_enqueues/wp/theme.js index 5daf04f7d7b55..13ed5aab4e8d2 100644 --- a/src/js/_enqueues/wp/theme.js +++ b/src/js/_enqueues/wp/theme.js @@ -1300,7 +1300,7 @@ themes.view.Themes = wp.Backbone.View.extend({ // Find the next model within the collection. nextModel = self.collection.at( self.collection.indexOf( model ) + 1 ); - // Sanity check which also serves as a boundary test. + // Confidence check which also serves as a boundary test. if ( nextModel !== undefined ) { // We have a new theme... diff --git a/src/wp-admin/includes/class-pclzip.php b/src/wp-admin/includes/class-pclzip.php index 3fdade5dd11f2..963f31178c1b6 100644 --- a/src/wp-admin/includes/class-pclzip.php +++ b/src/wp-admin/includes/class-pclzip.php @@ -1854,7 +1854,7 @@ function privOptionDefaultThreshold(&$p_options) $p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD] = floor($v_memory_limit_int*PCLZIP_TEMPORARY_FILE_RATIO); - // ----- Sanity check : No threshold if value lower than 1M + // ----- Confidence check : No threshold if value lower than 1M if ($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD] < 1048576) { unset($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD]); } diff --git a/src/wp-admin/includes/class-plugin-upgrader.php b/src/wp-admin/includes/class-plugin-upgrader.php index 02743f64561e9..091cfebc188ff 100644 --- a/src/wp-admin/includes/class-plugin-upgrader.php +++ b/src/wp-admin/includes/class-plugin-upgrader.php @@ -472,7 +472,7 @@ public function check_package( $source ) { } $working_directory = str_replace( $wp_filesystem->wp_content_dir(), trailingslashit( WP_CONTENT_DIR ), $source ); - if ( ! is_dir( $working_directory ) ) { // Sanity check, if the above fails, let's not prevent installation. + if ( ! is_dir( $working_directory ) ) { // Confidence check, if the above fails, let's not prevent installation. return $source; } diff --git a/src/wp-admin/includes/class-theme-upgrader.php b/src/wp-admin/includes/class-theme-upgrader.php index 12bd4772919cc..869bf64220fdf 100644 --- a/src/wp-admin/includes/class-theme-upgrader.php +++ b/src/wp-admin/includes/class-theme-upgrader.php @@ -371,6 +371,8 @@ public function upgrade( $theme, $args = array() ) { * @since 3.0.0 * @since 3.7.0 The `$args` parameter was added, making clearing the update cache optional. * + * @global string $wp_version The WordPress version string. + * * @param string[] $themes Array of the theme slugs. * @param array $args { * Optional. Other arguments for upgrading several themes at once. Default empty array. @@ -381,6 +383,8 @@ public function upgrade( $theme, $args = array() ) { * @return array[]|false An array of results, or false if unable to connect to the filesystem. */ public function bulk_upgrade( $themes, $args = array() ) { + global $wp_version; + $defaults = array( 'clear_update_cache' => true, ); @@ -442,23 +446,55 @@ public function bulk_upgrade( $themes, $args = array() ) { // Get the URL to the zip file. $r = $current->response[ $theme ]; - $result = $this->run( - array( - 'package' => $r['package'], - 'destination' => get_theme_root( $theme ), - 'clear_destination' => true, - 'clear_working' => true, - 'is_multi' => true, - 'hook_extra' => array( - 'theme' => $theme, - 'temp_backup' => array( - 'slug' => $theme, - 'src' => get_theme_root( $theme ), - 'dir' => 'themes', + if ( isset( $r['requires'] ) && ! is_wp_version_compatible( $r['requires'] ) ) { + $result = new WP_Error( + 'incompatible_wp_required_version', + sprintf( + /* translators: 1: Current WordPress version, 2: WordPress version required by the new theme version. */ + __( 'Your WordPress version is %1$s, however the new theme version requires %2$s.' ), + $wp_version, + $r['requires'] + ) + ); + + $this->skin->before( $result ); + $this->skin->error( $result ); + $this->skin->after(); + } elseif ( isset( $r['requires_php'] ) && ! is_php_version_compatible( $r['requires_php'] ) ) { + $result = new WP_Error( + 'incompatible_php_required_version', + sprintf( + /* translators: 1: Current PHP version, 2: PHP version required by the new theme version. */ + __( 'The PHP version on your server is %1$s, however the new theme version requires %2$s.' ), + PHP_VERSION, + $r['requires_php'] + ) + ); + + $this->skin->before( $result ); + $this->skin->error( $result ); + $this->skin->after(); + } else { + add_filter( 'upgrader_source_selection', array( $this, 'check_package' ) ); + $result = $this->run( + array( + 'package' => $r['package'], + 'destination' => get_theme_root( $theme ), + 'clear_destination' => true, + 'clear_working' => true, + 'is_multi' => true, + 'hook_extra' => array( + 'theme' => $theme, + 'temp_backup' => array( + 'slug' => $theme, + 'src' => get_theme_root( $theme ), + 'dir' => 'themes', + ), ), - ), - ) - ); + ) + ); + remove_filter( 'upgrader_source_selection', array( $this, 'check_package' ) ); + } $results[ $theme ] = $result; @@ -538,7 +574,7 @@ public function check_package( $source ) { // Check that the folder contains a valid theme. $working_directory = str_replace( $wp_filesystem->wp_content_dir(), trailingslashit( WP_CONTENT_DIR ), $source ); - if ( ! is_dir( $working_directory ) ) { // Sanity check, if the above fails, let's not prevent installation. + if ( ! is_dir( $working_directory ) ) { // Confidence check, if the above fails, let's not prevent installation. return $source; } diff --git a/src/wp-admin/includes/class-wp-debug-data.php b/src/wp-admin/includes/class-wp-debug-data.php index d83c8737685eb..ed6a9e75a47b3 100644 --- a/src/wp-admin/includes/class-wp-debug-data.php +++ b/src/wp-admin/includes/class-wp-debug-data.php @@ -381,6 +381,14 @@ public static function debug_data() { // Conditionally add debug information for multisite setups. if ( is_multisite() ) { + $site_id = get_current_blog_id(); + + $info['wp-core']['fields']['site_id'] = array( + 'label' => __( 'Site ID' ), + 'value' => $site_id, + 'debug' => $site_id, + ); + $network_query = new WP_Network_Query(); $network_ids = $network_query->query( array( diff --git a/src/wp-admin/includes/class-wp-filesystem-ssh2.php b/src/wp-admin/includes/class-wp-filesystem-ssh2.php index 6979a92c2f2f1..b8daad1ab1c3f 100644 --- a/src/wp-admin/includes/class-wp-filesystem-ssh2.php +++ b/src/wp-admin/includes/class-wp-filesystem-ssh2.php @@ -6,7 +6,7 @@ * * {@link http://kevin.vanzonneveld.net/techblog/article/make_ssh_connections_with_php/ - Installation Notes} * - * Compile libssh2 (Note: Only 0.14 is officaly working with PHP 5.2.6+ right now, But many users have found the latest versions work) + * Compile libssh2 (Note: Only 0.14 is officially working with PHP 5.2.6+ right now, But many users have found the latest versions work) * * cd /usr/src * wget https://www.libssh2.org/download/libssh2-0.14.tar.gz diff --git a/src/wp-admin/includes/class-wp-users-list-table.php b/src/wp-admin/includes/class-wp-users-list-table.php index ecb8eb4b6d292..8dfe3ce1a3e14 100644 --- a/src/wp-admin/includes/class-wp-users-list-table.php +++ b/src/wp-admin/includes/class-wp-users-list-table.php @@ -163,7 +163,7 @@ public function no_items() { * with this table. * * Provides a list of roles and user count for that role for easy - * Filtersing of the user table. + * filtering of the user table. * * @since 3.1.0 * diff --git a/src/wp-admin/includes/deprecated.php b/src/wp-admin/includes/deprecated.php index d588ad4f54fc2..f7805b4cc7034 100644 --- a/src/wp-admin/includes/deprecated.php +++ b/src/wp-admin/includes/deprecated.php @@ -1152,7 +1152,7 @@ function wp_nav_menu_locations_meta_box() { /** * This was once used to kick-off the Core Updater. * - * Deprecated in favor of instantating a Core_Upgrader instance directly, + * Deprecated in favor of instantiating a Core_Upgrader instance directly, * and calling the 'upgrade' method. * * @since 2.7.0 @@ -1174,7 +1174,7 @@ function wp_update_core($current, $feedback = '') { /** * This was once used to kick-off the Plugin Updater. * - * Deprecated in favor of instantating a Plugin_Upgrader instance directly, + * Deprecated in favor of instantiating a Plugin_Upgrader instance directly, * and calling the 'upgrade' method. * Unused since 2.8.0. * diff --git a/src/wp-admin/includes/image.php b/src/wp-admin/includes/image.php index 2bdcc505e4563..d60ec8508baf5 100644 --- a/src/wp-admin/includes/image.php +++ b/src/wp-admin/includes/image.php @@ -863,22 +863,51 @@ function wp_read_image_metadata( $file ) { $exif = array(); } + $exif_description = ''; + $exif_usercomment = ''; if ( ! empty( $exif['ImageDescription'] ) ) { + $exif_description = trim( $exif['ImageDescription'] ); + } + + if ( ! empty( $exif['COMPUTED']['UserComment'] ) ) { + $exif_usercomment = trim( $exif['COMPUTED']['UserComment'] ); + } + + if ( $exif_description ) { mbstring_binary_safe_encoding(); - $description_length = strlen( $exif['ImageDescription'] ); + $description_length = strlen( $exif_description ); reset_mbstring_encoding(); - if ( empty( $meta['title'] ) && $description_length < 80 ) { // Assume the title is stored in ImageDescription. - $meta['title'] = trim( $exif['ImageDescription'] ); + $meta['title'] = $exif_description; } - if ( empty( $meta['caption'] ) && ! empty( $exif['COMPUTED']['UserComment'] ) ) { - $meta['caption'] = trim( $exif['COMPUTED']['UserComment'] ); + // If both user comments and description are present. + if ( empty( $meta['caption'] ) && $exif_description && $exif_usercomment ) { + if ( ! empty( $meta['title'] ) && $exif_description === $meta['title'] ) { + $caption = $exif_usercomment; + } else { + if ( $exif_description === $exif_usercomment ) { + $caption = $exif_description; + } else { + $caption = trim( $exif_description . ' ' . $exif_usercomment ); + } + } + $meta['caption'] = $caption; + } + + if ( empty( $meta['caption'] ) && $exif_usercomment ) { + $meta['caption'] = $exif_usercomment; } if ( empty( $meta['caption'] ) ) { - $meta['caption'] = trim( $exif['ImageDescription'] ); + $meta['caption'] = $exif_description; + } + } elseif ( empty( $meta['caption'] ) && $exif_usercomment ) { + $meta['caption'] = $exif_usercomment; + $description_length = strlen( $exif_usercomment ); + if ( empty( $meta['title'] ) && $description_length < 80 ) { + $meta['title'] = trim( $exif_usercomment ); } } elseif ( empty( $meta['caption'] ) && ! empty( $exif['Comments'] ) ) { $meta['caption'] = trim( $exif['Comments'] ); diff --git a/src/wp-admin/includes/post.php b/src/wp-admin/includes/post.php index b9986d1bdec7a..c93ac71bec525 100644 --- a/src/wp-admin/includes/post.php +++ b/src/wp-admin/includes/post.php @@ -452,7 +452,7 @@ function edit_post( $post_data = null ) { $success = wp_update_post( $translated ); - // If the save failed, see if we can sanity check the main fields and try again. + // If the save failed, see if we can confidence check the main fields and try again. if ( ! $success && is_callable( array( $wpdb, 'strip_invalid_text_for_column' ) ) ) { $fields = array( 'post_title', 'post_content', 'post_excerpt' ); diff --git a/src/wp-admin/includes/update-core.php b/src/wp-admin/includes/update-core.php index ee710d3df36dc..0c66ad3ee9db0 100644 --- a/src/wp-admin/includes/update-core.php +++ b/src/wp-admin/includes/update-core.php @@ -1093,7 +1093,7 @@ function update_core( $from, $to ) { */ apply_filters( 'update_feedback', __( 'Verifying the unpacked files…' ) ); - // Sanity check the unzipped distribution. + // Confidence check the unzipped distribution. $distro = ''; $roots = array( '/wordpress/', '/wordpress-mu/' ); diff --git a/src/wp-admin/install.php b/src/wp-admin/install.php index 971392d07647c..bf102893ff9df 100644 --- a/src/wp-admin/install.php +++ b/src/wp-admin/install.php @@ -6,7 +6,7 @@ * @subpackage Administration */ -// Sanity check. +// Confidence check. if ( false ) { ?> diff --git a/src/wp-content/themes/twentyten/functions.php b/src/wp-content/themes/twentyten/functions.php index eb4fe64ef3a19..c2baec76eff4d 100644 --- a/src/wp-content/themes/twentyten/functions.php +++ b/src/wp-content/themes/twentyten/functions.php @@ -172,7 +172,7 @@ function twentyten_setup() { */ 'width' => apply_filters( 'twentyten_header_image_width', 940 ), /** - * Filters the Twenty Ten defaul header image height. + * Filters the Twenty Ten default header image height. * * @since Twenty Ten 1.0 * diff --git a/src/wp-content/themes/twentytwenty/assets/js/customize-controls.js b/src/wp-content/themes/twentytwenty/assets/js/customize-controls.js index 4397cf29c75de..ba2d5ad63f812 100644 --- a/src/wp-content/themes/twentytwenty/assets/js/customize-controls.js +++ b/src/wp-content/themes/twentytwenty/assets/js/customize-controls.js @@ -69,7 +69,7 @@ // Get accessible colors for the defined background-color and hue. colors = twentyTwentyColor( backgroundColor, accentHue ); - // Sanity check. + // Confidence check. if ( colors.getAccentColor() && 'function' === typeof colors.getAccentColor().toCSS ) { // Update the value for this context. value[ context ] = { diff --git a/src/wp-content/themes/twentytwentyone/inc/template-functions.php b/src/wp-content/themes/twentytwentyone/inc/template-functions.php index 5c1ca0f1e116d..4924773dc1c38 100644 --- a/src/wp-content/themes/twentytwentyone/inc/template-functions.php +++ b/src/wp-content/themes/twentytwentyone/inc/template-functions.php @@ -367,7 +367,7 @@ function twenty_twenty_one_print_first_instance_of_block( $block_name, $content // Loop blocks. foreach ( $blocks as $block ) { - // Sanity check. + // Confidence check. if ( ! isset( $block['blockName'] ) ) { continue; } diff --git a/src/wp-includes/assets/script-loader-packages.min.php b/src/wp-includes/assets/script-loader-packages.min.php index 895d165864d11..11257c8d1e0c0 100644 --- a/src/wp-includes/assets/script-loader-packages.min.php +++ b/src/wp-includes/assets/script-loader-packages.min.php @@ -1 +1 @@ - array('dependencies' => array('wp-dom-ready', 'wp-i18n', 'wp-polyfill'), 'version' => '7032343a947cfccf5608'), 'annotations.min.js' => array('dependencies' => array('wp-data', 'wp-hooks', 'wp-i18n', 'wp-polyfill', 'wp-rich-text'), 'version' => 'c4843f8e435a9d7a87bb'), 'api-fetch.min.js' => array('dependencies' => array('wp-i18n', 'wp-polyfill', 'wp-url'), 'version' => '0fa4dabf8bf2c7adf21a'), 'autop.min.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'dacd785d109317df2707'), 'blob.min.js' => array('dependencies' => array('wp-polyfill'), 'version' => '10a1c5c0acdef3d15657'), 'block-directory.min.js' => array('dependencies' => array('wp-a11y', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => '5b7cd5ab23c9d68e0b1e'), 'block-editor.min.js' => array('dependencies' => array('react', 'react-dom', 'wp-a11y', 'wp-api-fetch', 'wp-blob', 'wp-blocks', 'wp-commands', 'wp-components', 'wp-compose', 'wp-data', 'wp-date', '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-preferences', 'wp-primitives', 'wp-private-apis', 'wp-rich-text', 'wp-shortcode', 'wp-style-engine', 'wp-token-list', 'wp-url', 'wp-warning', 'wp-wordcount'), 'version' => '8a51b57fcf89fa4f37b2'), 'block-library.min.js' => array('dependencies' => array('wp-a11y', '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-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keycodes', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-private-apis', 'wp-rich-text', 'wp-server-side-render', 'wp-url', 'wp-viewport', 'wp-wordcount'), 'version' => '44e27c1179c5c75367af'), 'block-serialization-default-parser.min.js' => array('dependencies' => array('wp-polyfill'), 'version' => '30ffd7e7e199f10b2a6d'), 'blocks.min.js' => array('dependencies' => array('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-private-apis', 'wp-shortcode'), 'version' => '7204d43123223474471a'), 'commands.min.js' => array('dependencies' => array('react', 'react-dom', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-polyfill', 'wp-primitives', 'wp-private-apis'), 'version' => '07ff2b66990783ecd068'), 'components.min.js' => array('dependencies' => array('react', 'react-dom', 'wp-a11y', 'wp-compose', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-private-apis', 'wp-rich-text', 'wp-warning'), 'version' => '4bffbe88e13f0ade6d22'), 'compose.min.js' => array('dependencies' => array('react', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-priority-queue'), 'version' => '3189b344ff39fef940b7'), 'core-commands.min.js' => array('dependencies' => array('wp-commands', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-primitives', 'wp-private-apis', 'wp-router', 'wp-url'), 'version' => 'ade490de79d35734e06d'), 'core-data.min.js' => array('dependencies' => array('wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-private-apis', 'wp-url'), 'version' => '99b262137df116eb6013'), 'customize-widgets.min.js' => array('dependencies' => array('wp-block-editor', 'wp-block-library', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-polyfill', 'wp-preferences', 'wp-primitives', 'wp-private-apis', 'wp-widgets'), 'version' => 'bb454c7f10757887ce5a'), 'data.min.js' => array('dependencies' => array('wp-compose', 'wp-deprecated', 'wp-element', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-priority-queue', 'wp-private-apis', 'wp-redux-routine'), 'version' => 'dc5f255634f3da29c8d5'), 'data-controls.min.js' => array('dependencies' => array('wp-api-fetch', 'wp-data', 'wp-deprecated', 'wp-polyfill'), 'version' => 'fe4ccc8a1782ea8e2cb1'), 'date.min.js' => array('dependencies' => array('moment', 'wp-deprecated', 'wp-polyfill'), 'version' => '936c461ad5dce9c2c8ea'), 'deprecated.min.js' => array('dependencies' => array('wp-hooks', 'wp-polyfill'), 'version' => '73ad3591e7bc95f4777a'), 'dom.min.js' => array('dependencies' => array('wp-deprecated', 'wp-polyfill'), 'version' => '49ff2869626fbeaacc23'), 'dom-ready.min.js' => array('dependencies' => array('wp-polyfill'), 'version' => '392bdd43726760d1f3ca'), 'edit-post.min.js' => array('dependencies' => array('wp-a11y', 'wp-api-fetch', 'wp-block-editor', 'wp-block-library', 'wp-blocks', 'wp-commands', 'wp-components', 'wp-compose', 'wp-core-commands', 'wp-core-data', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-preferences', 'wp-primitives', 'wp-private-apis', 'wp-url', 'wp-viewport', 'wp-warning', 'wp-widgets'), 'version' => '6720d8a86f225f3ce492'), 'edit-site.min.js' => array('dependencies' => array('react', 'wp-a11y', 'wp-api-fetch', 'wp-block-editor', 'wp-block-library', 'wp-blocks', 'wp-commands', 'wp-components', 'wp-compose', 'wp-core-commands', 'wp-core-data', 'wp-data', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-editor', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-patterns', 'wp-plugins', 'wp-polyfill', 'wp-preferences', 'wp-primitives', 'wp-private-apis', 'wp-reusable-blocks', 'wp-router', 'wp-url', 'wp-viewport', 'wp-widgets', 'wp-wordcount'), 'version' => 'c25cbb9d6b28255c1cb6'), 'edit-widgets.min.js' => array('dependencies' => array('wp-api-fetch', 'wp-block-editor', 'wp-block-library', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-patterns', 'wp-plugins', 'wp-polyfill', 'wp-preferences', 'wp-primitives', 'wp-private-apis', 'wp-url', 'wp-viewport', 'wp-widgets'), 'version' => '64e3e5b8558ec09ac4ba'), 'editor.min.js' => array('dependencies' => array('react', 'wp-a11y', 'wp-api-fetch', '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-html-entities', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-patterns', 'wp-polyfill', 'wp-preferences', 'wp-primitives', 'wp-private-apis', 'wp-rich-text', 'wp-server-side-render', 'wp-url', 'wp-wordcount'), 'version' => '5abe10197275cf7808ee'), 'element.min.js' => array('dependencies' => array('react', 'react-dom', 'wp-escape-html', 'wp-polyfill'), 'version' => 'ed1c7604880e8b574b40'), 'escape-html.min.js' => array('dependencies' => array('wp-polyfill'), 'version' => '03e27a7b6ae14f7afaa6'), 'format-library.min.js' => array('dependencies' => array('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' => '57955a6a6df65c1fb8b6'), 'hooks.min.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'c6aec9a8d4e5a5d543a1'), 'html-entities.min.js' => array('dependencies' => array('wp-polyfill'), 'version' => '36a4a255da7dd2e1bf8e'), 'i18n.min.js' => array('dependencies' => array('wp-hooks', 'wp-polyfill'), 'version' => '7701b0c3857f914212ef'), 'is-shallow-equal.min.js' => array('dependencies' => array('wp-polyfill'), 'version' => '20c2b06ecf04afb14fee'), 'keyboard-shortcuts.min.js' => array('dependencies' => array('wp-data', 'wp-element', 'wp-keycodes', 'wp-polyfill'), 'version' => '525da859946d4df24898'), 'keycodes.min.js' => array('dependencies' => array('wp-i18n', 'wp-polyfill'), 'version' => '3460bd0fac9859d6886c'), 'list-reusable-blocks.min.js' => array('dependencies' => array('wp-api-fetch', 'wp-components', 'wp-compose', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => '4d77f2834116824e70c8'), 'media-utils.min.js' => array('dependencies' => array('wp-api-fetch', 'wp-blob', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => 'bcd60e7a2fb568f38015'), 'notices.min.js' => array('dependencies' => array('wp-data', 'wp-polyfill'), 'version' => '38e88f4b627cf873edd0'), 'nux.min.js' => array('dependencies' => array('wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-primitives'), 'version' => '59718fab5e39f9dd21b0'), 'patterns.min.js' => array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-private-apis', 'wp-url'), 'version' => 'efcce5c1b2c28e8b2865'), 'plugins.min.js' => array('dependencies' => array('wp-compose', 'wp-element', 'wp-hooks', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives'), 'version' => 'c485ff6186cdddabcf91'), 'preferences.min.js' => array('dependencies' => array('wp-a11y', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-primitives'), 'version' => 'ca088ba0a612bff77aa3'), 'preferences-persistence.min.js' => array('dependencies' => array('wp-api-fetch', 'wp-polyfill'), 'version' => '6c6b220422eb35541489'), 'primitives.min.js' => array('dependencies' => array('wp-element', 'wp-polyfill'), 'version' => '6984e6eb5d6157c4fe44'), 'priority-queue.min.js' => array('dependencies' => array('wp-polyfill'), 'version' => '422e19e9d48b269c5219'), 'private-apis.min.js' => array('dependencies' => array('wp-polyfill'), 'version' => '11cb2ebaa70a9f1f0ab5'), 'redux-routine.min.js' => array('dependencies' => array('wp-polyfill'), 'version' => '0be1b2a6a79703e28531'), 'reusable-blocks.min.js' => array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-private-apis', 'wp-url'), 'version' => 'f43df5cec4d4061a74f0'), 'rich-text.min.js' => array('dependencies' => array('wp-a11y', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-element', 'wp-escape-html', 'wp-i18n', 'wp-keycodes', 'wp-polyfill'), 'version' => '6222504ebedf0627981b'), 'router.min.js' => array('dependencies' => array('wp-element', 'wp-polyfill', 'wp-private-apis', 'wp-url'), 'version' => 'd1ae6718bab1f7073adb'), 'server-side-render.min.js' => array('dependencies' => array('wp-api-fetch', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-url'), 'version' => '81299db67c0fa2c65479'), 'shortcode.min.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'c128a3008a96e820aa86'), 'style-engine.min.js' => array('dependencies' => array('wp-polyfill'), 'version' => '17cbc030cba88a42ccb5'), 'token-list.min.js' => array('dependencies' => array('wp-polyfill'), 'version' => '199103fc7cec3b9eef5a'), 'undo-manager.min.js' => array('dependencies' => array('wp-is-shallow-equal', 'wp-polyfill'), 'version' => '312610424b40059d9f44'), 'url.min.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'b4979979018b684be209'), 'viewport.min.js' => array('dependencies' => array('wp-compose', 'wp-data', 'wp-element', 'wp-polyfill'), 'version' => '1fbef8175bb335c5603b'), 'warning.min.js' => array('dependencies' => array('wp-polyfill'), 'version' => '122829a085511691f14d'), 'widgets.min.js' => array('dependencies' => array('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'), 'version' => '938735ae45e739ac8b70'), 'wordcount.min.js' => array('dependencies' => array('wp-polyfill'), 'version' => '5a74890fd7c610679e34')); + array('dependencies' => array('wp-dom-ready', 'wp-i18n', 'wp-polyfill'), 'version' => '7032343a947cfccf5608'), 'annotations.min.js' => array('dependencies' => array('wp-data', 'wp-hooks', 'wp-i18n', 'wp-polyfill', 'wp-rich-text'), 'version' => 'c4843f8e435a9d7a87bb'), 'api-fetch.min.js' => array('dependencies' => array('wp-i18n', 'wp-polyfill', 'wp-url'), 'version' => '0fa4dabf8bf2c7adf21a'), 'autop.min.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'dacd785d109317df2707'), 'blob.min.js' => array('dependencies' => array('wp-polyfill'), 'version' => '10a1c5c0acdef3d15657'), 'block-directory.min.js' => array('dependencies' => array('wp-a11y', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => '5b7cd5ab23c9d68e0b1e'), 'block-editor.min.js' => array('dependencies' => array('react', 'react-dom', 'wp-a11y', 'wp-api-fetch', 'wp-blob', 'wp-blocks', 'wp-commands', 'wp-components', 'wp-compose', 'wp-data', 'wp-date', '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-preferences', 'wp-primitives', 'wp-private-apis', 'wp-rich-text', 'wp-shortcode', 'wp-style-engine', 'wp-token-list', 'wp-url', 'wp-warning', 'wp-wordcount'), 'version' => '8a070b748cf406a8d42e'), 'block-library.min.js' => array('dependencies' => array('wp-a11y', '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-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keycodes', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-private-apis', 'wp-rich-text', 'wp-server-side-render', 'wp-url', 'wp-viewport', 'wp-wordcount'), 'version' => '9c5365423f60fac3c287'), 'block-serialization-default-parser.min.js' => array('dependencies' => array('wp-polyfill'), 'version' => '30ffd7e7e199f10b2a6d'), 'blocks.min.js' => array('dependencies' => array('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-private-apis', 'wp-shortcode'), 'version' => '7204d43123223474471a'), 'commands.min.js' => array('dependencies' => array('react', 'react-dom', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-polyfill', 'wp-primitives', 'wp-private-apis'), 'version' => '07ff2b66990783ecd068'), 'components.min.js' => array('dependencies' => array('react', 'react-dom', 'wp-a11y', 'wp-compose', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-private-apis', 'wp-rich-text', 'wp-warning'), 'version' => '387d6480ace3103ccd8b'), 'compose.min.js' => array('dependencies' => array('react', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-priority-queue'), 'version' => '3189b344ff39fef940b7'), 'core-commands.min.js' => array('dependencies' => array('wp-commands', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-primitives', 'wp-private-apis', 'wp-router', 'wp-url'), 'version' => 'ade490de79d35734e06d'), 'core-data.min.js' => array('dependencies' => array('wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-private-apis', 'wp-url'), 'version' => '99b262137df116eb6013'), 'customize-widgets.min.js' => array('dependencies' => array('wp-block-editor', 'wp-block-library', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-polyfill', 'wp-preferences', 'wp-primitives', 'wp-private-apis', 'wp-widgets'), 'version' => 'bb454c7f10757887ce5a'), 'data.min.js' => array('dependencies' => array('wp-compose', 'wp-deprecated', 'wp-element', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-priority-queue', 'wp-private-apis', 'wp-redux-routine'), 'version' => 'dc5f255634f3da29c8d5'), 'data-controls.min.js' => array('dependencies' => array('wp-api-fetch', 'wp-data', 'wp-deprecated', 'wp-polyfill'), 'version' => 'fe4ccc8a1782ea8e2cb1'), 'date.min.js' => array('dependencies' => array('moment', 'wp-deprecated', 'wp-polyfill'), 'version' => '936c461ad5dce9c2c8ea'), 'deprecated.min.js' => array('dependencies' => array('wp-hooks', 'wp-polyfill'), 'version' => '73ad3591e7bc95f4777a'), 'dom.min.js' => array('dependencies' => array('wp-deprecated', 'wp-polyfill'), 'version' => '49ff2869626fbeaacc23'), 'dom-ready.min.js' => array('dependencies' => array('wp-polyfill'), 'version' => '392bdd43726760d1f3ca'), 'edit-post.min.js' => array('dependencies' => array('wp-a11y', 'wp-api-fetch', 'wp-block-editor', 'wp-block-library', 'wp-blocks', 'wp-commands', 'wp-components', 'wp-compose', 'wp-core-commands', 'wp-core-data', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-preferences', 'wp-primitives', 'wp-private-apis', 'wp-url', 'wp-viewport', 'wp-warning', 'wp-widgets'), 'version' => '6720d8a86f225f3ce492'), 'edit-site.min.js' => array('dependencies' => array('react', 'wp-a11y', 'wp-api-fetch', 'wp-block-editor', 'wp-block-library', 'wp-blocks', 'wp-commands', 'wp-components', 'wp-compose', 'wp-core-commands', 'wp-core-data', 'wp-data', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-editor', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-patterns', 'wp-plugins', 'wp-polyfill', 'wp-preferences', 'wp-primitives', 'wp-private-apis', 'wp-reusable-blocks', 'wp-router', 'wp-url', 'wp-viewport', 'wp-widgets', 'wp-wordcount'), 'version' => 'c25cbb9d6b28255c1cb6'), 'edit-widgets.min.js' => array('dependencies' => array('wp-api-fetch', 'wp-block-editor', 'wp-block-library', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-patterns', 'wp-plugins', 'wp-polyfill', 'wp-preferences', 'wp-primitives', 'wp-private-apis', 'wp-url', 'wp-viewport', 'wp-widgets'), 'version' => '64e3e5b8558ec09ac4ba'), 'editor.min.js' => array('dependencies' => array('react', 'wp-a11y', 'wp-api-fetch', '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-html-entities', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-patterns', 'wp-polyfill', 'wp-preferences', 'wp-primitives', 'wp-private-apis', 'wp-rich-text', 'wp-server-side-render', 'wp-url', 'wp-wordcount'), 'version' => '5abe10197275cf7808ee'), 'element.min.js' => array('dependencies' => array('react', 'react-dom', 'wp-escape-html', 'wp-polyfill'), 'version' => 'ed1c7604880e8b574b40'), 'escape-html.min.js' => array('dependencies' => array('wp-polyfill'), 'version' => '03e27a7b6ae14f7afaa6'), 'format-library.min.js' => array('dependencies' => array('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' => '57955a6a6df65c1fb8b6'), 'hooks.min.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'c6aec9a8d4e5a5d543a1'), 'html-entities.min.js' => array('dependencies' => array('wp-polyfill'), 'version' => '36a4a255da7dd2e1bf8e'), 'i18n.min.js' => array('dependencies' => array('wp-hooks', 'wp-polyfill'), 'version' => '7701b0c3857f914212ef'), 'is-shallow-equal.min.js' => array('dependencies' => array('wp-polyfill'), 'version' => '20c2b06ecf04afb14fee'), 'keyboard-shortcuts.min.js' => array('dependencies' => array('wp-data', 'wp-element', 'wp-keycodes', 'wp-polyfill'), 'version' => '525da859946d4df24898'), 'keycodes.min.js' => array('dependencies' => array('wp-i18n', 'wp-polyfill'), 'version' => '3460bd0fac9859d6886c'), 'list-reusable-blocks.min.js' => array('dependencies' => array('wp-api-fetch', 'wp-components', 'wp-compose', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => '4d77f2834116824e70c8'), 'media-utils.min.js' => array('dependencies' => array('wp-api-fetch', 'wp-blob', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => 'bcd60e7a2fb568f38015'), 'notices.min.js' => array('dependencies' => array('wp-data', 'wp-polyfill'), 'version' => '38e88f4b627cf873edd0'), 'nux.min.js' => array('dependencies' => array('wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-primitives'), 'version' => '59718fab5e39f9dd21b0'), 'patterns.min.js' => array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-private-apis', 'wp-url'), 'version' => 'efcce5c1b2c28e8b2865'), 'plugins.min.js' => array('dependencies' => array('wp-compose', 'wp-element', 'wp-hooks', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives'), 'version' => 'c485ff6186cdddabcf91'), 'preferences.min.js' => array('dependencies' => array('wp-a11y', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-primitives'), 'version' => 'ca088ba0a612bff77aa3'), 'preferences-persistence.min.js' => array('dependencies' => array('wp-api-fetch', 'wp-polyfill'), 'version' => '6c6b220422eb35541489'), 'primitives.min.js' => array('dependencies' => array('wp-element', 'wp-polyfill'), 'version' => '6984e6eb5d6157c4fe44'), 'priority-queue.min.js' => array('dependencies' => array('wp-polyfill'), 'version' => '422e19e9d48b269c5219'), 'private-apis.min.js' => array('dependencies' => array('wp-polyfill'), 'version' => '11cb2ebaa70a9f1f0ab5'), 'redux-routine.min.js' => array('dependencies' => array('wp-polyfill'), 'version' => '0be1b2a6a79703e28531'), 'reusable-blocks.min.js' => array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-private-apis', 'wp-url'), 'version' => 'f43df5cec4d4061a74f0'), 'rich-text.min.js' => array('dependencies' => array('wp-a11y', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-element', 'wp-escape-html', 'wp-i18n', 'wp-keycodes', 'wp-polyfill'), 'version' => '6222504ebedf0627981b'), 'router.min.js' => array('dependencies' => array('wp-element', 'wp-polyfill', 'wp-private-apis', 'wp-url'), 'version' => 'd1ae6718bab1f7073adb'), 'server-side-render.min.js' => array('dependencies' => array('wp-api-fetch', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-url'), 'version' => '81299db67c0fa2c65479'), 'shortcode.min.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'c128a3008a96e820aa86'), 'style-engine.min.js' => array('dependencies' => array('wp-polyfill'), 'version' => '17cbc030cba88a42ccb5'), 'token-list.min.js' => array('dependencies' => array('wp-polyfill'), 'version' => '199103fc7cec3b9eef5a'), 'undo-manager.min.js' => array('dependencies' => array('wp-is-shallow-equal', 'wp-polyfill'), 'version' => '312610424b40059d9f44'), 'url.min.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'b4979979018b684be209'), 'viewport.min.js' => array('dependencies' => array('wp-compose', 'wp-data', 'wp-element', 'wp-polyfill'), 'version' => '1fbef8175bb335c5603b'), 'warning.min.js' => array('dependencies' => array('wp-polyfill'), 'version' => '122829a085511691f14d'), 'widgets.min.js' => array('dependencies' => array('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'), 'version' => '938735ae45e739ac8b70'), 'wordcount.min.js' => array('dependencies' => array('wp-polyfill'), 'version' => '5a74890fd7c610679e34')); diff --git a/src/wp-includes/block-supports/background.php b/src/wp-includes/block-supports/background.php index a8de0c6b63b20..283833991f57b 100644 --- a/src/wp-includes/block-supports/background.php +++ b/src/wp-includes/block-supports/background.php @@ -40,6 +40,7 @@ function wp_register_background_support( $block_type ) { * it is also applied to non-server-rendered blocks. * * @since 6.4.0 + * @since 6.5.0 Added support for `backgroundPosition` and `backgroundRepeat` output. * @access private * * @param string $block_content Rendered block content. @@ -64,9 +65,20 @@ function wp_render_background_support( $block_content, $block ) { $background_image_url = isset( $block_attributes['style']['background']['backgroundImage']['url'] ) ? $block_attributes['style']['background']['backgroundImage']['url'] : null; + + if ( ! $background_image_source && ! $background_image_url ) { + return $block_content; + } + $background_size = isset( $block_attributes['style']['background']['backgroundSize'] ) ? $block_attributes['style']['background']['backgroundSize'] : 'cover'; + $background_position = isset( $block_attributes['style']['background']['backgroundPosition'] ) + ? $block_attributes['style']['background']['backgroundPosition'] + : null; + $background_repeat = isset( $block_attributes['style']['background']['backgroundRepeat'] ) + ? $block_attributes['style']['background']['backgroundRepeat'] + : null; $background_block_styles = array(); @@ -76,8 +88,15 @@ function wp_render_background_support( $block_content, $block ) { ) { // Set file based background URL. $background_block_styles['backgroundImage']['url'] = $background_image_url; - // Only output the background size when an image url is set. - $background_block_styles['backgroundSize'] = $background_size; + // Only output the background size and repeat when an image url is set. + $background_block_styles['backgroundSize'] = $background_size; + $background_block_styles['backgroundRepeat'] = $background_repeat; + $background_block_styles['backgroundPosition'] = $background_position; + + // If the background size is set to `contain` and no position is set, set the position to `center`. + if ( 'contain' === $background_size && ! isset( $background_position ) ) { + $background_block_styles['backgroundPosition'] = 'center'; + } } $styles = wp_style_engine_get_styles( array( 'background' => $background_block_styles ) ); @@ -99,6 +118,7 @@ function wp_render_background_support( $block_content, $block ) { $updated_style .= $styles['css']; $tags->set_attribute( 'style', $updated_style ); + $tags->add_class( 'has-background' ); } return $tags->get_updated_html(); diff --git a/src/wp-includes/block-supports/layout.php b/src/wp-includes/block-supports/layout.php index 70d1fe4255fdd..67d6a3f1b77ac 100644 --- a/src/wp-includes/block-supports/layout.php +++ b/src/wp-includes/block-supports/layout.php @@ -638,7 +638,7 @@ function wp_render_layout_support_flag( $block_content, $block ) { * for features like the enhanced pagination of the Query block. */ $container_class = wp_unique_prefixed_id( - 'wp-container-' . sanitize_title( $block['blockName'] ) . '-layout-' + 'wp-container-' . sanitize_title( $block['blockName'] ) . '-is-layout-' ); // Set the correct layout type for blocks using legacy content width. @@ -883,17 +883,45 @@ function wp_restore_group_inner_container( $block_content, $block ) { return $block_content; } - $replace_regex = sprintf( + /* + * This filter runs after the layout classnames have been added to the block, so they + * have to be removed from the outer wrapper and then added to the inner. + */ + $layout_classes = array(); + $processor = new WP_HTML_Tag_Processor( $block_content ); + + if ( $processor->next_tag( array( 'class_name' => 'wp-block-group' ) ) ) { + foreach ( $processor->class_list() as $class_name ) { + if ( str_contains( $class_name, 'is-layout-' ) ) { + $layout_classes[] = $class_name; + $processor->remove_class( $class_name ); + } + } + } + + $content_without_layout_classes = $processor->get_updated_html(); + $replace_regex = sprintf( '/(^\s*<%1$s\b[^>]*wp-block-group[^>]*>)(.*)(<\/%1$s>\s*$)/ms', preg_quote( $tag_name, '/' ) ); - $updated_content = preg_replace_callback( + $updated_content = preg_replace_callback( $replace_regex, static function ( $matches ) { return $matches[1] . '
' . $matches[2] . '
' . $matches[3]; }, - $block_content + $content_without_layout_classes ); + + // Add layout classes to inner wrapper. + if ( ! empty( $layout_classes ) ) { + $processor = new WP_HTML_Tag_Processor( $updated_content ); + if ( $processor->next_tag( array( 'class_name' => 'wp-block-group__inner-container' ) ) ) { + foreach ( $layout_classes as $class_name ) { + $processor->add_class( $class_name ); + } + } + $updated_content = $processor->get_updated_html(); + } return $updated_content; } diff --git a/src/wp-includes/block-template-utils.php b/src/wp-includes/block-template-utils.php index f47c649fff081..e2cd7c1587b9f 100644 --- a/src/wp-includes/block-template-utils.php +++ b/src/wp-includes/block-template-utils.php @@ -125,11 +125,11 @@ function get_default_block_template_types() { ), 'single' => array( 'title' => _x( 'Single Posts', 'Template name' ), - 'description' => __( 'Displays single posts on your website unless a custom template has been applied to that post or a dedicated template exists.' ), + 'description' => __( 'Displays a single post on your website unless a custom template has been applied to that post or a dedicated template exists.' ), ), 'page' => array( 'title' => _x( 'Pages', 'Template name' ), - 'description' => __( 'Display all static pages unless a custom template has been applied or a dedicated template exists.' ), + 'description' => __( 'Displays a static page unless a custom template has been applied to that page or a dedicated template exists.' ), ), 'archive' => array( 'title' => _x( 'All Archives', 'Template name' ), diff --git a/src/wp-includes/blocks.php b/src/wp-includes/blocks.php index 431e2b015332c..c9b3d51c32b60 100644 --- a/src/wp-includes/blocks.php +++ b/src/wp-includes/blocks.php @@ -59,6 +59,7 @@ function generate_block_asset_handle( $block_name, $field_name, $index = 0 ) { } $field_mappings = array( + 'viewModule' => 'view-module', 'editorScript' => 'editor-script', 'script' => 'script', 'viewScript' => 'view-script', @@ -121,6 +122,82 @@ function get_block_asset_url( $path ) { return plugins_url( basename( $path ), $path ); } +/** + * Finds a script handle for the selected block metadata field. It detects + * when a path to file was provided and finds a corresponding asset file + * with details necessary to register the script under automatically + * generated handle name. It returns unprocessed script handle otherwise. + * + * @since 5.5.0 + * @since 6.1.0 Added `$index` parameter. + * + * @param array $metadata Block metadata. + * @param string $field_name Field name to pick from metadata. + * @param int $index Optional. Index of the script to register when multiple items passed. + * Default 0. + * @return string|false Script handle provided directly or created through + * script's registration, or false on failure. + */ +function register_block_module_handle( $metadata, $field_name, $index = 0 ) { + if ( empty( $metadata[ $field_name ] ) ) { + return false; + } + + $module_handle = $metadata[ $field_name ]; + if ( is_array( $module_handle ) ) { + if ( empty( $module_handle[ $index ] ) ) { + return false; + } + $module_handle = $module_handle[ $index ]; + } + + $module_path = remove_block_asset_path_prefix( $module_handle ); + if ( $module_handle === $module_path ) { + return $module_handle; + } + + $path = dirname( $metadata['file'] ); + $module_asset_raw_path = $path . '/' . substr_replace( $module_path, '.asset.php', - strlen( '.js' ) ); + $module_handle = generate_block_asset_handle( $metadata['name'], $field_name, $index ); + $module_asset_path = wp_normalize_path( + realpath( $module_asset_raw_path ) + ); + + if ( empty( $module_asset_path ) ) { + _doing_it_wrong( + __FUNCTION__, + sprintf( + /* translators: 1: Asset file location, 2: Field name, 3: Block name. */ + __( 'The asset file (%1$s) for the "%2$s" defined in "%3$s" block definition is missing.' ), + $module_asset_raw_path, + $field_name, + $metadata['name'] + ), + '6.5.0' + ); + return false; + } + + $module_path_norm = wp_normalize_path( realpath( $path . '/' . $module_path ) ); + $module_uri = get_block_asset_url( $module_path_norm ); + + $module_asset = require $module_asset_path; + $module_dependencies = isset( $module_asset['dependencies'] ) ? $module_asset['dependencies'] : array(); + $result = wp_register_module( + $module_handle, + $module_uri, + $module_dependencies, + isset( $module_asset['version'] ) ? $module_asset['version'] : false, + ); + + if ( ! empty( $metadata['textdomain'] ) && in_array( 'wp-i18n', $module_dependencies, true ) ) { + // script translations? + wp_set_script_translations( $module_handle, $metadata['textdomain'] ); + } + + return $module_handle; +} + /** * Finds a script handle for the selected block metadata field. It detects * when a path to file was provided and finds a corresponding asset file @@ -500,6 +577,41 @@ function register_block_type_from_metadata( $file_or_folder, $args = array() ) { } } + $module_fields = array( + 'viewModule' => 'view_module_handles', + ); + foreach ( $module_fields as $metadata_field_name => $settings_field_name ) { + + if ( ! empty( $settings[ $metadata_field_name ] ) ) { + $metadata[ $metadata_field_name ] = $settings[ $metadata_field_name ]; + } + if ( ! empty( $metadata[ $metadata_field_name ] ) ) { + $modules = $metadata[ $metadata_field_name ]; + $processed_modules = array(); + if ( is_array( $modules ) ) { + for ( $index = 0; $index < count( $modules ); $index++ ) { + $result = register_block_module_handle( + $metadata, + $metadata_field_name, + $index + ); + if ( $result ) { + $processed_modules[] = $result; + } + } + } else { + $result = register_block_module_handle( + $metadata, + $metadata_field_name + ); + if ( $result ) { + $processed_modules[] = $result; + } + } + $settings[ $settings_field_name ] = $processed_modules; + } + } + $style_fields = array( 'editorStyle' => 'editor_style_handles', 'style' => 'style_handles', diff --git a/src/wp-includes/class-wp-block-type.php b/src/wp-includes/class-wp-block-type.php index 9caa366032a75..f2de01b9d3db3 100644 --- a/src/wp-includes/class-wp-block-type.php +++ b/src/wp-includes/class-wp-block-type.php @@ -209,6 +209,30 @@ class WP_Block_Type { */ public $view_script_handles = array(); + /** + * Block type editor only module handles. + * + * @since 6.5.0 + * @var string[] + */ + public $editor_module_handles = array(); + + /** + * Block type front end and editor module handles. + * + * @since 6.5.0 + * @var string[] + */ + public $module_handles = array(); + + /** + * Block type front end only module handles. + * + * @since 6.5.0 + * @var string[] + */ + public $view_module_handles = array(); + /** * Block type editor only style handles. * diff --git a/src/wp-includes/class-wp-block.php b/src/wp-includes/class-wp-block.php index 65d3af6a12f1a..b02f415e631d0 100644 --- a/src/wp-includes/class-wp-block.php +++ b/src/wp-includes/class-wp-block.php @@ -274,6 +274,18 @@ public function render( $options = array() ) { } } + if ( ( ! empty( $this->block_type->module_handles ) ) ) { + foreach ( $this->block_type->module_handles as $module_handle ) { + wp_enqueue_module( $module_handle ); + } + } + + if ( ! empty( $this->block_type->view_module_handles ) ) { + foreach ( $this->block_type->view_module_handles as $view_module_handle ) { + wp_enqueue_module( $view_module_handle ); + } + } + if ( ( ! empty( $this->block_type->style_handles ) ) ) { foreach ( $this->block_type->style_handles as $style_handle ) { wp_enqueue_style( $style_handle ); diff --git a/src/wp-includes/class-wp-customize-manager.php b/src/wp-includes/class-wp-customize-manager.php index 24f82510bd782..d12eea0e5f326 100644 --- a/src/wp-includes/class-wp-customize-manager.php +++ b/src/wp-includes/class-wp-customize-manager.php @@ -3079,25 +3079,26 @@ public function trash_changeset_post( $post ) { return false; } + $previous_status = $post->post_status; + /** This filter is documented in wp-includes/post.php */ - $check = apply_filters( 'pre_trash_post', null, $post ); + $check = apply_filters( 'pre_trash_post', null, $post, $previous_status ); if ( null !== $check ) { return $check; } /** This action is documented in wp-includes/post.php */ - do_action( 'wp_trash_post', $post_id ); + do_action( 'wp_trash_post', $post_id, $previous_status ); - add_post_meta( $post_id, '_wp_trash_meta_status', $post->post_status ); + add_post_meta( $post_id, '_wp_trash_meta_status', $previous_status ); add_post_meta( $post_id, '_wp_trash_meta_time', time() ); - $old_status = $post->post_status; $new_status = 'trash'; $wpdb->update( $wpdb->posts, array( 'post_status' => $new_status ), array( 'ID' => $post->ID ) ); clean_post_cache( $post->ID ); $post->post_status = $new_status; - wp_transition_post_status( $new_status, $old_status, $post ); + wp_transition_post_status( $new_status, $previous_status, $post ); /** This action is documented in wp-includes/post.php */ do_action( "edit_post_{$post->post_type}", $post->ID, $post ); @@ -3119,7 +3120,7 @@ public function trash_changeset_post( $post ) { wp_trash_post_comments( $post_id ); /** This action is documented in wp-includes/post.php */ - do_action( 'trashed_post', $post_id ); + do_action( 'trashed_post', $post_id, $previous_status ); return $post; } diff --git a/src/wp-includes/class-wp-script-modules.php b/src/wp-includes/class-wp-script-modules.php new file mode 100644 index 0000000000000..4c542211b86bf --- /dev/null +++ b/src/wp-includes/class-wp-script-modules.php @@ -0,0 +1,352 @@ + $deps Optional. An array of module + * identifiers of the dependencies of + * this module. The dependencies can + * be strings or arrays. If they are + * arrays, they need an `id` key with + * the module identifier, and can + * contain an `import` key with either + * `static` or `dynamic`. By default, + * dependencies that don't contain an + * `import` key are considered static. + * @param string|false|null $version Optional. String specifying the + * module version number. Defaults to + * false. It is added to the URL as a + * query string for cache busting + * purposes. If $version is set to + * false, the version number is the + * currently installed WordPress + * version. If $version is set to + * null, no version is added. + */ + public function register( $module_id, $src, $deps = array(), $version = false ) { + if ( ! isset( $this->registered[ $module_id ] ) ) { + $dependencies = array(); + foreach ( $deps as $dependency ) { + if ( is_array( $dependency ) ) { + if ( ! isset( $dependency['id'] ) ) { + _doing_it_wrong( __METHOD__, __( 'Missing required id key in entry among dependencies array.' ), '6.5.0' ); + continue; + } + $dependencies[] = array( + 'id' => $dependency['id'], + 'import' => isset( $dependency['import'] ) && 'dynamic' === $dependency['import'] ? 'dynamic' : 'static', + ); + } elseif ( is_string( $dependency ) ) { + $dependencies[] = array( + 'id' => $dependency, + 'import' => 'static', + ); + } else { + _doing_it_wrong( __METHOD__, __( 'Entries in dependencies array must be either strings or arrays with an id key.' ), '6.5.0' ); + } + } + + $this->registered[ $module_id ] = array( + 'src' => $src, + 'version' => $version, + 'enqueue' => isset( $this->enqueued_before_registered[ $module_id ] ), + 'dependencies' => $dependencies, + 'enqueued' => false, + 'preloaded' => false, + ); + } + } + + /** + * Marks the module to be enqueued in the page the next time + * `prints_enqueued_modules` is called. + * + * If a src is provided and the module has not been registered yet, it will be + * registered. + * + * @since 6.5.0 + * + * @param string $module_id The identifier of the module. + * Should be unique. It will be used + * in the final import map. + * @param string $src Optional. Full URL of the module, + * or path of the module relative to + * the WordPress root directory. If + * it is provided and the module has + * not been registered yet, it will be + * registered. + * @param array $deps Optional. An array of module + * identifiers of the dependencies of + * this module. The dependencies can + * be strings or arrays. If they are + * arrays, they need an `id` key with + * the module identifier, and can + * contain an `import` key with either + * `static` or `dynamic`. By default, + * dependencies that don't contain an + * `import` key are considered static. + * @param string|false|null $version Optional. String specifying the + * module version number. Defaults to + * false. It is added to the URL as a + * query string for cache busting + * purposes. If $version is set to + * false, the version number is the + * currently installed WordPress + * version. If $version is set to + * null, no version is added. + */ + public function enqueue( $module_id, $src = '', $deps = array(), $version = false ) { + if ( isset( $this->registered[ $module_id ] ) ) { + $this->registered[ $module_id ]['enqueue'] = true; + } elseif ( $src ) { + $this->register( $module_id, $src, $deps, $version ); + $this->registered[ $module_id ]['enqueue'] = true; + } else { + $this->enqueued_before_registered[ $module_id ] = true; + } + } + + /** + * Unmarks the module so it will no longer be enqueued in the page. + * + * @since 6.5.0 + * + * @param string $module_id The identifier of the module. + */ + public function dequeue( $module_id ) { + if ( isset( $this->registered[ $module_id ] ) ) { + $this->registered[ $module_id ]['enqueue'] = false; + } + unset( $this->enqueued_before_registered[ $module_id ] ); + } + + /** + * Adds the hooks to print the import map, enqueued modules and module + * preloads. + * + * It adds the actions to print the enqueued modules and module preloads to + * both `wp_head` and `wp_footer` because in classic themes, the modules + * used by the theme and plugins will likely be able to be printed in the + * `head`, but the ones used by the blocks will need to be enqueued in the + * `footer`. + * + * As all modules are deferred and dependencies are handled by the browser, + * the order of the modules is not important, but it's still better to print + * the ones that are available when the `wp_head` is rendered, so the browser + * starts downloading those as soon as possible. + * + * The import map is also printed in the footer to be able to include the + * dependencies of all the modules, including the ones printed in the footer. + * + * @since 6.5.0 + */ + public function add_hooks() { + add_action( 'wp_head', array( $this, 'print_enqueued_modules' ) ); + add_action( 'wp_head', array( $this, 'print_module_preloads' ) ); + add_action( 'wp_footer', array( $this, 'print_enqueued_modules' ) ); + add_action( 'wp_footer', array( $this, 'print_module_preloads' ) ); + add_action( 'wp_footer', array( $this, 'print_import_map' ) ); + } + + /** + * Prints the enqueued modules using script tags with type="module" + * attributes. + * + * If a enqueued module has already been printed, it will not be printed again + * on subsequent calls to this function. + * + * @since 6.5.0 + */ + public function print_enqueued_modules() { + foreach ( $this->get_marked_for_enqueue() as $module_id => $module ) { + if ( false === $module['enqueued'] ) { + // Mark it as enqueued so it doesn't get enqueued again. + $this->registered[ $module_id ]['enqueued'] = true; + + wp_print_script_tag( + array( + 'type' => 'module', + 'src' => $this->get_versioned_src( $module ), + 'id' => $module_id . '-js-module', + ) + ); + } + } + } + + /** + * Prints the the static dependencies of the enqueued modules using link tags + * with rel="modulepreload" attributes. + * + * If a module is marked for enqueue, it will not be preloaded. If a preloaded + * module has already been printed, it will not be printed again on subsequent + * calls to this function. + * + * @since 6.5.0 + */ + public function print_module_preloads() { + foreach ( $this->get_dependencies( array_keys( $this->get_marked_for_enqueue() ), array( 'static' ) ) as $module_id => $module ) { + // Don't preload if it's marked for enqueue or has already been preloaded. + if ( true !== $module['enqueue'] && false === $module['preloaded'] ) { + // Mark it as preloaded so it doesn't get preloaded again. + $this->registered[ $module_id ]['preloaded'] = true; + + echo sprintf( + '', + esc_url( $this->get_versioned_src( $module ) ), + esc_attr( $module_id . '-js-modulepreload' ) + ); + } + } + } + + /** + * Prints the import map using a script tag with a type="importmap" attribute. + * + * @since 6.5.0 + */ + public function print_import_map() { + $import_map = $this->get_import_map(); + if ( ! empty( $import_map['imports'] ) ) { + wp_print_inline_script_tag( + wp_json_encode( $import_map, JSON_HEX_TAG | JSON_HEX_AMP ), + array( + 'type' => 'importmap', + 'id' => 'wp-importmap', + ) + ); + } + } + + /** + * Returns the import map array. + * + * @since 6.5.0 + * + * @return array Array with an `imports` key mapping to an array of module identifiers and their respective URLs, + * including the version query. + */ + private function get_import_map() { + $imports = array(); + foreach ( $this->get_dependencies( array_keys( $this->get_marked_for_enqueue() ) ) as $module_id => $module ) { + $imports[ $module_id ] = $this->get_versioned_src( $module ); + } + return array( 'imports' => $imports ); + } + + /** + * Retrieves the list of modules marked for enqueue. + * + * @since 6.5.0 + * + * @return array Modules marked for enqueue, keyed by module identifier. + */ + private function get_marked_for_enqueue() { + $enqueued = array(); + foreach ( $this->registered as $module_id => $module ) { + if ( true === $module['enqueue'] ) { + $enqueued[ $module_id ] = $module; + } + } + return $enqueued; + } + + /** + * Retrieves all the dependencies for the given module identifiers, filtered + * by import types. + * + * It will consolidate an array containing a set of unique dependencies based + * on the requested import types: 'static', 'dynamic', or both. This method is + * recursive and also retrieves dependencies of the dependencies. + * + * @since 6.5.0 + * + * @param array $module_ids The identifiers of the modules for which to gather dependencies. + * @param array $import_types Optional. Import types of dependencies to retrieve: 'static', 'dynamic', or both. + * Default is both. + * @return array List of dependencies, keyed by module identifier. + */ + private function get_dependencies( $module_ids, $import_types = array( 'static', 'dynamic' ) ) { + return array_reduce( + $module_ids, + function ( $dependency_modules, $module_id ) use ( $import_types ) { + $dependencies = array(); + foreach ( $this->registered[ $module_id ]['dependencies'] as $dependency ) { + if ( + in_array( $dependency['import'], $import_types, true ) && + isset( $this->registered[ $dependency['id'] ] ) && + ! isset( $dependency_modules[ $dependency['id'] ] ) + ) { + $dependencies[ $dependency['id'] ] = $this->registered[ $dependency['id'] ]; + } + } + return array_merge( $dependency_modules, $dependencies, $this->get_dependencies( array_keys( $dependencies ), $import_types ) ); + }, + array() + ); + } + + /** + * Gets the versioned URL for a module src. + * + * If $version is set to false, the version number is the currently installed + * WordPress version. If $version is set to null, no version is added. + * Otherwise, the string passed in $version is used. + * + * @since 6.5.0 + * + * @param array $module The module. + * @return string The module src with a version if relevant. + */ + private function get_versioned_src( array $module ) { + $args = array(); + if ( false === $module['version'] ) { + $args['ver'] = get_bloginfo( 'version' ); + } elseif ( null !== $module['version'] ) { + $args['ver'] = $module['version']; + } + if ( $args ) { + return add_query_arg( $args, $module['src'] ); + } + return $module['src']; + } +} diff --git a/src/wp-includes/class-wp-tax-query.php b/src/wp-includes/class-wp-tax-query.php index 38841c42b06de..58e53ea4a2c75 100644 --- a/src/wp-includes/class-wp-tax-query.php +++ b/src/wp-includes/class-wp-tax-query.php @@ -505,7 +505,7 @@ public function get_sql_for_clause( &$clause, $parent_query ) { protected function find_compatible_table_alias( $clause, $parent_query ) { $alias = false; - // Sanity check. Only IN queries use the JOIN syntax. + // Confidence check. Only IN queries use the JOIN syntax. if ( ! isset( $clause['operator'] ) || 'IN' !== $clause['operator'] ) { return $alias; } diff --git a/src/wp-includes/class-wp-theme-json-resolver.php b/src/wp-includes/class-wp-theme-json-resolver.php index 90710a5c1b2f4..44db8364f1092 100644 --- a/src/wp-includes/class-wp-theme-json-resolver.php +++ b/src/wp-includes/class-wp-theme-json-resolver.php @@ -312,9 +312,6 @@ public static function get_theme_data( $deprecated = array(), $options = array() } $theme_support_data['settings']['color']['defaultGradients'] = $default_gradients; - // Classic themes without a theme.json don't support global duotone. - $theme_support_data['settings']['color']['defaultDuotone'] = false; - // Allow themes to enable link color setting via theme_support. if ( current_theme_supports( 'link-color' ) ) { $theme_support_data['settings']['color']['link'] = true; @@ -327,6 +324,11 @@ public static function get_theme_data( $deprecated = array(), $options = array() $theme_support_data['settings']['border']['style'] = true; $theme_support_data['settings']['border']['width'] = true; } + + // Allow themes to enable appearance tools via theme_support. + if ( current_theme_supports( 'appearance-tools' ) ) { + $theme_support_data['settings']['appearanceTools'] = true; + } } $with_theme_supports = new WP_Theme_JSON( $theme_support_data ); $with_theme_supports->merge( static::$theme ); diff --git a/src/wp-includes/class-wp-theme-json.php b/src/wp-includes/class-wp-theme-json.php index 9fea12a8d3e99..37f4d11ce9fb4 100644 --- a/src/wp-includes/class-wp-theme-json.php +++ b/src/wp-includes/class-wp-theme-json.php @@ -344,6 +344,8 @@ class WP_Theme_JSON { * @since 6.3.0 Added support for `typography.textColumns`, removed `layout.definitions`. * @since 6.4.0 Added support for `layout.allowEditing`, `background.backgroundImage`, * `typography.writingMode`, `lightbox.enabled` and `lightbox.allowEditing`. + * @since 6.5.0 Added support for `layout.allowCustomContentAndWideSize` and + * `background.backgroundSize`. * @var array */ const VALID_SETTINGS = array( @@ -351,6 +353,7 @@ class WP_Theme_JSON { 'useRootPaddingAwareAlignments' => null, 'background' => array( 'backgroundImage' => null, + 'backgroundSize' => null, ), 'border' => array( 'color' => null, @@ -380,9 +383,10 @@ class WP_Theme_JSON { 'minHeight' => null, ), 'layout' => array( - 'contentSize' => null, - 'wideSize' => null, - 'allowEditing' => null, + 'contentSize' => null, + 'wideSize' => null, + 'allowEditing' => null, + 'allowCustomContentAndWideSize' => null, ), 'lightbox' => array( 'enabled' => null, @@ -571,10 +575,12 @@ public static function get_element_class_name( $element ) { * @since 6.0.0 * @since 6.2.0 Added `dimensions.minHeight` and `position.sticky`. * @since 6.4.0 Added `background.backgroundImage`. + * @since 6.5.0 Added `background.backgroundSize`. * @var array */ const APPEARANCE_TOOLS_OPT_INS = array( array( 'background', 'backgroundImage' ), + array( 'background', 'backgroundSize' ), array( 'border', 'color' ), array( 'border', 'radius' ), array( 'border', 'style' ), diff --git a/src/wp-includes/class-wpdb.php b/src/wp-includes/class-wpdb.php index baba39d91f4d9..d9186b91f463f 100644 --- a/src/wp-includes/class-wpdb.php +++ b/src/wp-includes/class-wpdb.php @@ -154,7 +154,7 @@ class wpdb { protected $result; /** - * Cached column info, for sanity checking data before inserting. + * Cached column info, for confidence checking data before inserting. * * @since 4.2.0 * @@ -172,7 +172,7 @@ class wpdb { protected $table_charset = array(); /** - * Whether text fields in the current query need to be sanity checked. + * Whether text fields in the current query need to be confidence checked. * * @since 4.2.0 * @@ -1927,7 +1927,7 @@ public function flush() { mysqli_free_result( $this->result ); $this->result = null; - // Sanity check before using the handle. + // Confidence check before using the handle. if ( empty( $this->dbh ) || ! ( $this->dbh instanceof mysqli ) ) { return; } @@ -3516,7 +3516,7 @@ protected function check_safe_collation( $query ) { return false; } - // If any of the columns don't have one of these collations, it needs more sanity checking. + // If any of the columns don't have one of these collations, it needs more confidence checking. $safe_collations = array( 'utf8_bin', 'utf8_general_ci', diff --git a/src/wp-includes/cron.php b/src/wp-includes/cron.php index c1837e6051c1e..aadc22b7eb17d 100644 --- a/src/wp-includes/cron.php +++ b/src/wp-includes/cron.php @@ -874,7 +874,7 @@ function spawn_cron( $gmt_time = 0 ) { return false; } - // Sanity check. + // Confidence check. $crons = wp_get_ready_cron_jobs(); if ( empty( $crons ) ) { return false; diff --git a/src/wp-includes/fonts.php b/src/wp-includes/fonts.php index 306364bdc8099..87503c275f390 100644 --- a/src/wp-includes/fonts.php +++ b/src/wp-includes/fonts.php @@ -22,7 +22,7 @@ * @type array $font_variation { * @type string $font-family The font-family property. * @type string|string[] $src The URL(s) to each resource containing the font data. - * @type string $font_style Optional. The font-style property. Default 'normal'. + * @type string $font-style Optional. The font-style property. Default 'normal'. * @type string $font-weight Optional. The font-weight property. Default '400'. * @type string $font-display Optional. The font-display property. Default 'fallback'. * @type string $ascent-override Optional. The ascent-override property. diff --git a/src/wp-includes/formatting.php b/src/wp-includes/formatting.php index bc150c8a537cb..83938306b0774 100644 --- a/src/wp-includes/formatting.php +++ b/src/wp-includes/formatting.php @@ -3506,7 +3506,7 @@ function convert_smilies( $text ) { $textarr = preg_split( '/(<.*>)/U', $text, -1, PREG_SPLIT_DELIM_CAPTURE ); // Capture the tags as well as in between. $stop = count( $textarr ); // Loop stuff. - // Ignore proessing of specific tags. + // Ignore processing of specific tags. $tags_to_ignore = 'code|pre|style|script|textarea'; $ignore_block_element = ''; diff --git a/src/wp-includes/functions.php b/src/wp-includes/functions.php index d270157d1f886..c4ecb81f66160 100644 --- a/src/wp-includes/functions.php +++ b/src/wp-includes/functions.php @@ -4284,7 +4284,7 @@ function _wp_die_process_input( $message, $title = '', $args = array() ) { } /** - * Encodes a variable into JSON, with some sanity checks. + * Encodes a variable into JSON, with some confidence checks. * * @since 4.1.0 * @since 5.3.0 No longer handles support for PHP < 5.6. @@ -4300,7 +4300,7 @@ function _wp_die_process_input( $message, $title = '', $args = array() ) { function wp_json_encode( $value, $flags = 0, $depth = 512 ) { $json = json_encode( $value, $flags, $depth ); - // If json_encode() was successful, no need to do more sanity checking. + // If json_encode() was successful, no need to do more confidence checking. if ( false !== $json ) { return $json; } @@ -4315,7 +4315,7 @@ function wp_json_encode( $value, $flags = 0, $depth = 512 ) { } /** - * Performs sanity checks on data that shall be encoded to JSON. + * Performs confidence checks on data that shall be encoded to JSON. * * @ignore * @since 4.1.0 diff --git a/src/wp-includes/global-styles-and-settings.php b/src/wp-includes/global-styles-and-settings.php index 1258f1f4e37f1..acca33be1e844 100644 --- a/src/wp-includes/global-styles-and-settings.php +++ b/src/wp-includes/global-styles-and-settings.php @@ -222,7 +222,13 @@ function wp_get_global_stylesheet( $types = array() ) { * @see wp_add_global_styles_for_blocks */ $origins = array( 'default', 'theme', 'custom' ); - if ( ! $supports_theme_json ) { + /* + * If the theme doesn't have theme.json but supports both appearance tools and color palette, + * the 'theme' origin should be included so color palette presets are also output. + */ + if ( ! $supports_theme_json && ( current_theme_supports( 'appearance-tools' ) || current_theme_supports( 'border' ) ) && current_theme_supports( 'editor-color-palette' ) ) { + $origins = array( 'default', 'theme' ); + } elseif ( ! $supports_theme_json ) { $origins = array( 'default' ); } $styles_rest = $tree->get_stylesheet( $types, $origins ); diff --git a/src/wp-includes/html-api/class-wp-html-open-elements.php b/src/wp-includes/html-api/class-wp-html-open-elements.php index 55c4d3a663c5b..1234abcb9dfe4 100644 --- a/src/wp-includes/html-api/class-wp-html-open-elements.php +++ b/src/wp-includes/html-api/class-wp-html-open-elements.php @@ -129,7 +129,7 @@ public function has_element_in_specific_scope( $tag_name, $termination_list ) { } if ( in_array( $node->node_name, $termination_list, true ) ) { - return true; + return false; } } @@ -166,18 +166,22 @@ public function has_element_in_scope( $tag_name ) { * Returns whether a particular element is in list item scope. * * @since 6.4.0 + * @since 6.5.0 Implemented: no longer throws on every invocation. * * @see https://html.spec.whatwg.org/#has-an-element-in-list-item-scope * - * @throws WP_HTML_Unsupported_Exception Always until this function is implemented. - * * @param string $tag_name Name of tag to check. * @return bool Whether given element is in scope. */ public function has_element_in_list_item_scope( $tag_name ) { - throw new WP_HTML_Unsupported_Exception( 'Cannot process elements depending on list item scope.' ); - - return false; // The linter requires this unreachable code until the function is implemented and can return. + return $this->has_element_in_specific_scope( + $tag_name, + array( + // There are more elements that belong here which aren't currently supported. + 'OL', + 'UL', + ) + ); } /** @@ -375,10 +379,22 @@ public function walk_down() { * see WP_HTML_Open_Elements::walk_down(). * * @since 6.4.0 + * @since 6.5.0 Accepts $above_this_node to start traversal above a given node, if it exists. + * + * @param ?WP_HTML_Token $above_this_node Start traversing above this node, if provided and if the node exists. */ - public function walk_up() { + public function walk_up( $above_this_node = null ) { + $has_found_node = null === $above_this_node; + for ( $i = count( $this->stack ) - 1; $i >= 0; $i-- ) { - yield $this->stack[ $i ]; + $node = $this->stack[ $i ]; + + if ( ! $has_found_node ) { + $has_found_node = $node === $above_this_node; + continue; + } + + yield $node; } } diff --git a/src/wp-includes/html-api/class-wp-html-processor.php b/src/wp-includes/html-api/class-wp-html-processor.php index e46c368c702d4..cce26a60c5350 100644 --- a/src/wp-includes/html-api/class-wp-html-processor.php +++ b/src/wp-includes/html-api/class-wp-html-processor.php @@ -100,15 +100,19 @@ * The following list specifies the HTML tags that _are_ supported: * * - Containers: ADDRESS, BLOCKQUOTE, DETAILS, DIALOG, DIV, FOOTER, HEADER, MAIN, MENU, SPAN, SUMMARY. - * - Form elements: BUTTON, FIELDSET, SEARCH. + * - Custom elements: All custom elements are supported. :) + * - Form elements: BUTTON, DATALIST, FIELDSET, LABEL, LEGEND, METER, PROGRESS, SEARCH. * - Formatting elements: B, BIG, CODE, EM, FONT, I, SMALL, STRIKE, STRONG, TT, U. * - Heading elements: H1, H2, H3, H4, H5, H6, HGROUP. * - Links: A. - * - Lists: DL. - * - Media elements: FIGCAPTION, FIGURE, IMG. + * - Lists: DD, DL, DT, LI, OL, LI. + * - Media elements: AUDIO, CANVAS, FIGCAPTION, FIGURE, IMG, MAP, PICTURE, VIDEO. * - Paragraph: P. - * - Sectioning elements: ARTICLE, ASIDE, NAV, SECTION - * - Deprecated elements: CENTER, DIR + * - Phrasing elements: ABBR, BDI, BDO, CITE, DATA, DEL, DFN, INS, MARK, OUTPUT, Q, SAMP, SUB, SUP, TIME, VAR. + * - Sectioning elements: ARTICLE, ASIDE, NAV, SECTION. + * - Templating elements: SLOT. + * - Text decoration: RUBY. + * - Deprecated elements: ACRONYM, BLINK, CENTER, DIR, ISINDEX, MULTICOL, NEXTID, SPACER. * * ### Supported markup * @@ -644,10 +648,12 @@ private function step_in_body() { case '+MAIN': case '+MENU': case '+NAV': + case '+OL': case '+P': case '+SEARCH': case '+SECTION': case '+SUMMARY': + case '+UL': if ( $this->state->stack_of_open_elements->has_p_in_button_scope() ) { $this->close_a_p_element(); } @@ -681,9 +687,11 @@ private function step_in_body() { case '-MAIN': case '-MENU': case '-NAV': + case '-OL': case '-SEARCH': case '-SECTION': case '-SUMMARY': + case '-UL': if ( ! $this->state->stack_of_open_elements->has_element_in_scope( $tag_name ) ) { // @todo Report parse error. // Ignore the token. @@ -751,6 +759,109 @@ private function step_in_body() { $this->state->stack_of_open_elements->pop_until( '(internal: H1 through H6 - do not use)' ); return true; + /* + * > A start tag whose tag name is "li" + * > A start tag whose tag name is one of: "dd", "dt" + */ + case '+DD': + case '+DT': + case '+LI': + $this->state->frameset_ok = false; + $node = $this->state->stack_of_open_elements->current_node(); + $is_li = 'LI' === $tag_name; + + in_body_list_loop: + /* + * The logic for LI and DT/DD is the same except for one point: LI elements _only_ + * close other LI elements, but a DT or DD element closes _any_ open DT or DD element. + */ + if ( $is_li ? 'LI' === $node->node_name : ( 'DD' === $node->node_name || 'DT' === $node->node_name ) ) { + $node_name = $is_li ? 'LI' : $node->node_name; + $this->generate_implied_end_tags( $node_name ); + if ( $node_name !== $this->state->stack_of_open_elements->current_node()->node_name ) { + // @todo Indicate a parse error once it's possible. This error does not impact the logic here. + } + + $this->state->stack_of_open_elements->pop_until( $node_name ); + goto in_body_list_done; + } + + if ( + 'ADDRESS' !== $node->node_name && + 'DIV' !== $node->node_name && + 'P' !== $node->node_name && + $this->is_special( $node->node_name ) + ) { + /* + * > If node is in the special category, but is not an address, div, + * > or p element, then jump to the step labeled done below. + */ + goto in_body_list_done; + } else { + /* + * > Otherwise, set node to the previous entry in the stack of open elements + * > and return to the step labeled loop. + */ + foreach ( $this->state->stack_of_open_elements->walk_up( $node ) as $item ) { + $node = $item; + break; + } + goto in_body_list_loop; + } + + in_body_list_done: + if ( $this->state->stack_of_open_elements->has_p_in_button_scope() ) { + $this->close_a_p_element(); + } + + $this->insert_html_element( $this->state->current_token ); + return true; + + /* + * > An end tag whose tag name is "li" + * > An end tag whose tag name is one of: "dd", "dt" + */ + case '-DD': + case '-DT': + case '-LI': + if ( + /* + * An end tag whose tag name is "li": + * If the stack of open elements does not have an li element in list item scope, + * then this is a parse error; ignore the token. + */ + ( + 'LI' === $tag_name && + ! $this->state->stack_of_open_elements->has_element_in_list_item_scope( 'LI' ) + ) || + /* + * An end tag whose tag name is one of: "dd", "dt": + * If the stack of open elements does not have an element in scope that is an + * HTML element with the same tag name as that of the token, then this is a + * parse error; ignore the token. + */ + ( + 'LI' !== $tag_name && + ! $this->state->stack_of_open_elements->has_element_in_scope( $tag_name ) + ) + ) { + /* + * This is a parse error, ignore the token. + * + * @todo Indicate a parse error once it's possible. + */ + return $this->step(); + } + + $this->generate_implied_end_tags( $tag_name ); + + if ( $tag_name !== $this->state->stack_of_open_elements->current_node()->node_name ) { + // @todo Indicate a parse error once it's possible. This error does not impact the logic here. + } + + $this->state->stack_of_open_elements->pop_until( $tag_name ); + return true; + /* * > An end tag whose tag name is "p" */ @@ -830,41 +941,132 @@ private function step_in_body() { $this->reconstruct_active_formatting_elements(); $this->insert_html_element( $this->state->current_token ); return true; + } + /* + * These tags require special handling in the 'in body' insertion mode + * but that handling hasn't yet been implemented. + * + * As the rules for each tag are implemented, the corresponding tag + * name should be removed from this list. An accompanying test should + * help ensure this list is maintained. + * + * @see Tests_HtmlApi_WpHtmlProcessor::test_step_in_body_fails_on_unsupported_tags + * + * Since this switch structure throws a WP_HTML_Unsupported_Exception, it's + * possible to handle "any other start tag" and "any other end tag" below, + * as that guarantees execution doesn't proceed for the unimplemented tags. + * + * @see https://html.spec.whatwg.org/multipage/parsing.html#parsing-main-inbody + */ + switch ( $tag_name ) { + case 'APPLET': + case 'AREA': + case 'BASE': + case 'BASEFONT': + case 'BGSOUND': + case 'BODY': + case 'BR': + case 'CAPTION': + case 'COL': + case 'COLGROUP': + case 'DD': + case 'DT': + case 'EMBED': + case 'FORM': + case 'FRAME': + case 'FRAMESET': + case 'HEAD': + case 'HR': + case 'HTML': + case 'IFRAME': + case 'INPUT': + case 'KEYGEN': + case 'LI': + case 'LINK': + case 'LISTING': + case 'MARQUEE': + case 'MATH': + case 'META': + case 'NOBR': + case 'NOEMBED': + case 'NOFRAMES': + case 'NOSCRIPT': + case 'OBJECT': + case 'OL': + case 'OPTGROUP': + case 'OPTION': + case 'PARAM': + case 'PLAINTEXT': + case 'PRE': + case 'RB': + case 'RP': + case 'RT': + case 'RTC': + case 'SARCASM': + case 'SCRIPT': + case 'SELECT': + case 'SOURCE': + case 'STYLE': + case 'SVG': + case 'TABLE': + case 'TBODY': + case 'TD': + case 'TEMPLATE': + case 'TEXTAREA': + case 'TFOOT': + case 'TH': + case 'THEAD': + case 'TITLE': + case 'TR': + case 'TRACK': + case 'UL': + case 'WBR': + case 'XMP': + $this->last_error = self::ERROR_UNSUPPORTED; + throw new WP_HTML_Unsupported_Exception( "Cannot process {$tag_name} element." ); + } + + if ( ! $this->is_tag_closer() ) { /* * > Any other start tag */ - case '+SPAN': - $this->reconstruct_active_formatting_elements(); - $this->insert_html_element( $this->state->current_token ); - return true; + $this->reconstruct_active_formatting_elements(); + $this->insert_html_element( $this->state->current_token ); + return true; + } else { + /* + * > Any other end tag + */ /* - * Any other end tag + * Find the corresponding tag opener in the stack of open elements, if + * it exists before reaching a special element, which provides a kind + * of boundary in the stack. For example, a `` should not + * close anything beyond its containing `P` or `DIV` element. */ - case '-SPAN': - foreach ( $this->state->stack_of_open_elements->walk_up() as $item ) { - // > If node is an HTML element with the same tag name as the token, then: - if ( $item->node_name === $tag_name ) { - $this->generate_implied_end_tags( $tag_name ); + foreach ( $this->state->stack_of_open_elements->walk_up() as $node ) { + if ( $tag_name === $node->node_name ) { + break; + } - // > If node is not the current node, then this is a parse error. + if ( self::is_special( $node->node_name ) ) { + // This is a parse error, ignore the token. + return $this->step(); + } + } - $this->state->stack_of_open_elements->pop_until( $tag_name ); - return true; - } + $this->generate_implied_end_tags( $tag_name ); + if ( $node !== $this->state->stack_of_open_elements->current_node() ) { + // @todo Record parse error: this error doesn't impact parsing. + } - // > Otherwise, if node is in the special category, then this is a parse error; ignore the token, and return. - if ( self::is_special( $item->node_name ) ) { - return $this->step(); - } + foreach ( $this->state->stack_of_open_elements->walk_up() as $item ) { + $this->state->stack_of_open_elements->pop(); + if ( $node === $item ) { + return true; } - // Execution should not reach here; if it does then something went wrong. - return false; - - default: - $this->last_error = self::ERROR_UNSUPPORTED; - throw new WP_HTML_Unsupported_Exception( "Cannot process {$tag_name} element." ); + } } } @@ -1128,6 +1330,9 @@ private function close_a_p_element() { */ private function generate_implied_end_tags( $except_for_this_element = null ) { $elements_with_implied_end_tags = array( + 'DD', + 'DT', + 'LI', 'P', ); @@ -1153,6 +1358,9 @@ private function generate_implied_end_tags( $except_for_this_element = null ) { */ private function generate_implied_end_tags_thoroughly() { $elements_with_implied_end_tags = array( + 'DD', + 'DT', + 'LI', 'P', ); @@ -1264,7 +1472,7 @@ private function run_adoption_agency_algorithm() { // > If formatting element is not in the stack of open elements, then this is a parse error; remove the element from the list, and return. if ( ! $this->state->stack_of_open_elements->contains_node( $formatting_element ) ) { - $this->state->active_formatting_elements->remove_node( $formatting_element->bookmark_name ); + $this->state->active_formatting_elements->remove_node( $formatting_element ); return; } diff --git a/src/wp-includes/media.php b/src/wp-includes/media.php index 224d8a18caf98..9cf301e95c11a 100644 --- a/src/wp-includes/media.php +++ b/src/wp-includes/media.php @@ -4133,7 +4133,7 @@ function _wp_image_editor_choose( $args = array() ) { ! call_user_func( array( $implementation, 'supports_mime_type' ), $args['output_mime_type'] ) ) { /* - * This implementation supports the imput type but not the output type. + * This implementation supports the input type but not the output type. * Keep looking to see if we can find an implementation that supports both. */ $supports_input = $implementation; diff --git a/src/wp-includes/post.php b/src/wp-includes/post.php index d6b6bc6649cc9..25fefbb6211cb 100644 --- a/src/wp-includes/post.php +++ b/src/wp-includes/post.php @@ -3861,7 +3861,7 @@ function wp_untrash_post_comments( $post = null ) { } foreach ( $group_by_status as $status => $comments ) { - // Sanity check. This shouldn't happen. + // Confidence check. This shouldn't happen. if ( 'post-trashed' === $status ) { $status = '0'; } diff --git a/src/wp-includes/script-modules.php b/src/wp-includes/script-modules.php new file mode 100644 index 0000000000000..52552317e4aa5 --- /dev/null +++ b/src/wp-includes/script-modules.php @@ -0,0 +1,116 @@ +add_hooks(); + } + return $instance; +} + +/** + * Registers the module if no module with that module identifier has already + * been registered. + * + * @since 6.5.0 + * + * @param string $module_id The identifier of the module. + * Should be unique. It will be used + * in the final import map. + * @param string $src Full URL of the module, or path of + * the module relative to the + * WordPress root directory. + * @param array $deps Optional. An array of module + * identifiers of the dependencies of + * this module. The dependencies can + * be strings or arrays. If they are + * arrays, they need an `id` key with + * the module identifier, and can + * contain an `import` key with either + * `static` or `dynamic`. By default, + * dependencies that don't contain an + * `import` key are considered static. + * @param string|false|null $version Optional. String specifying the + * module version number. Defaults to + * false. It is added to the URL as a + * query string for cache busting + * purposes. If $version is set to + * false, the version number is the + * currently installed WordPress + * version. If $version is set to + * null, no version is added. + */ +function wp_register_module( $module_id, $src, $deps = array(), $version = false ) { + wp_modules()->register( $module_id, $src, $deps, $version ); +} + +/** + * Marks the module to be enqueued in the page. + * + * If a src is provided and the module has not been registered yet, it will be + * registered. + * + * @since 6.5.0 + * + * @param string $module_id The identifier of the module. + * Should be unique. It will be used + * in the final import map. + * @param string $src Optional. Full URL of the module, + * or path of the module relative to + * the WordPress root directory. If + * it is provided and the module has + * not been registered yet, it will be + * registered. + * @param array $deps Optional. An array of module + * identifiers of the dependencies of + * this module. The dependencies can + * be strings or arrays. If they are + * arrays, they need an `id` key with + * the module identifier, and can + * contain an `import` key with either + * `static` or `dynamic`. By default, + * dependencies that don't contain an + * `import` key are considered static. + * @param string|false|null $version Optional. String specifying the + * module version number. Defaults to + * false. It is added to the URL as a + * query string for cache busting + * purposes. If $version is set to + * false, the version number is the + * currently installed WordPress + * version. If $version is set to + * null, no version is added. + */ +function wp_enqueue_module( $module_id, $src = '', $deps = array(), $version = false ) { + wp_modules()->enqueue( $module_id, $src, $deps, $version ); +} + +/** + * Unmarks the module so it is no longer enqueued in the page. + * + * @since 6.5.0 + * + * @param string $module_id The identifier of the module. + */ +function wp_dequeue_module( $module_id ) { + wp_modules()->dequeue( $module_id ); +} diff --git a/src/wp-includes/shortcodes.php b/src/wp-includes/shortcodes.php index 24df21d4da11e..98cd8f71ddd02 100644 --- a/src/wp-includes/shortcodes.php +++ b/src/wp-includes/shortcodes.php @@ -504,7 +504,7 @@ function do_shortcodes_in_html_tags( $content, $ignore_html, $tagnames ) { $element = preg_replace_callback( "/$pattern/", 'do_shortcode_tag', $element ); } - // Looks like we found some crazy unfiltered HTML. Skipping it for sanity. + // Looks like we found some crazy unfiltered HTML. Skipping it for confidence. $element = strtr( $element, $trans ); continue; } diff --git a/src/wp-includes/style-engine/class-wp-style-engine.php b/src/wp-includes/style-engine/class-wp-style-engine.php index 121bac2d927ba..790e33f38c0e3 100644 --- a/src/wp-includes/style-engine/class-wp-style-engine.php +++ b/src/wp-includes/style-engine/class-wp-style-engine.php @@ -23,6 +23,7 @@ * @since 6.1.0 * @since 6.3.0 Added support for text-columns. * @since 6.4.0 Added support for background.backgroundImage. + * @since 6.5.0 Added support for background.backgroundPosition and background.backgroundRepeat. */ #[AllowDynamicProperties] final class WP_Style_Engine { @@ -48,14 +49,26 @@ final class WP_Style_Engine { */ const BLOCK_STYLE_DEFINITIONS_METADATA = array( 'background' => array( - 'backgroundImage' => array( + 'backgroundImage' => array( 'property_keys' => array( 'default' => 'background-image', ), 'value_func' => array( self::class, 'get_url_or_value_css_declaration' ), 'path' => array( 'background', 'backgroundImage' ), ), - 'backgroundSize' => array( + 'backgroundPosition' => array( + 'property_keys' => array( + 'default' => 'background-position', + ), + 'path' => array( 'background', 'backgroundPosition' ), + ), + 'backgroundRepeat' => array( + 'property_keys' => array( + 'default' => 'background-repeat', + ), + 'path' => array( 'background', 'backgroundRepeat' ), + ), + 'backgroundSize' => array( 'property_keys' => array( 'default' => 'background-size', ), @@ -215,6 +228,9 @@ final class WP_Style_Engine { 'default' => 'font-size', ), 'path' => array( 'typography', 'fontSize' ), + 'css_vars' => array( + 'font-size' => '--wp--preset--font-size--$slug', + ), 'classnames' => array( 'has-$slug-font-size' => 'font-size', ), @@ -223,6 +239,9 @@ final class WP_Style_Engine { 'property_keys' => array( 'default' => 'font-family', ), + 'css_vars' => array( + 'font-family' => '--wp--preset--font-family--$slug', + ), 'path' => array( 'typography', 'fontFamily' ), 'classnames' => array( 'has-$slug-font-family' => 'font-family', diff --git a/src/wp-includes/taxonomy.php b/src/wp-includes/taxonomy.php index 59ec5345fe0cd..b64a2f08db3ee 100644 --- a/src/wp-includes/taxonomy.php +++ b/src/wp-includes/taxonomy.php @@ -2434,6 +2434,11 @@ function wp_insert_term( $term, $taxonomy, $args = array() ) { $description = wp_unslash( $args['description'] ); $parent = (int) $args['parent']; + // Sanitization could clean the name to an empty string that must be checked again. + if ( '' === $name ) { + return new WP_Error( 'invalid_term_name', __( 'Invalid term name.' ) ); + } + $slug_provided = ! empty( $args['slug'] ); if ( ! $slug_provided ) { $slug = sanitize_title( $name ); @@ -2573,7 +2578,7 @@ function wp_insert_term( $term, $taxonomy, $args = array() ) { $tt_id = (int) $wpdb->insert_id; /* - * Sanity check: if we just created a term with the same parent + taxonomy + slug but a higher term_id than + * Confidence check: if we just created a term with the same parent + taxonomy + slug but a higher term_id than * an existing term, then we have unwittingly created a duplicate term. Delete the dupe, and use the term_id * and term_taxonomy_id of the older term instead. Then return out of the function so that the "create" hooks * are not fired. diff --git a/src/wp-includes/theme.php b/src/wp-includes/theme.php index 1638128b4cf26..040275e0f8377 100644 --- a/src/wp-includes/theme.php +++ b/src/wp-includes/theme.php @@ -2617,12 +2617,15 @@ function get_theme_starter_content() { * @since 5.6.0 The `post-formats` feature warns if no array is passed as the second parameter. * @since 5.8.0 The `widgets-block-editor` feature enables the Widgets block editor. * @since 6.0.0 The `html5` feature warns if no array is passed as the second parameter. + * @since 6.5.0 The `appearance-tools` feature enables a few design tools for blocks, + * see `WP_Theme_JSON::APPEARANCE_TOOLS_OPT_INS` for a complete list. * * @global array $_wp_theme_features * * @param string $feature The feature being added. Likely core values include: * - 'admin-bar' * - 'align-wide' + * - 'appearance-tools' * - 'automatic-feed-links' * - 'core-block-patterns' * - 'custom-background' diff --git a/src/wp-settings.php b/src/wp-settings.php index 38b03ecf7268f..c354747f32148 100644 --- a/src/wp-settings.php +++ b/src/wp-settings.php @@ -365,6 +365,8 @@ require ABSPATH . WPINC . '/fonts/class-wp-font-face-resolver.php'; require ABSPATH . WPINC . '/fonts/class-wp-font-face.php'; require ABSPATH . WPINC . '/fonts.php'; +require ABSPATH . WPINC . '/class-wp-script-modules.php'; +require ABSPATH . WPINC . '/script-modules.php'; $GLOBALS['wp_embed'] = new WP_Embed(); diff --git a/tests/phpunit/tests/actions.php b/tests/phpunit/tests/actions.php index 8b57382b9c545..e25183f75913d 100644 --- a/tests/phpunit/tests/actions.php +++ b/tests/phpunit/tests/actions.php @@ -229,35 +229,133 @@ public function test_action_args_with_php4_syntax() { $this->assertSame( array( $val ), array_pop( $argsvar ) ); } - public function test_action_priority() { - $a = new MockAction(); + /** + * @ticket 60193 + * + * @dataProvider data_priority_callback_order_with_integers + * @dataProvider data_priority_callback_order_with_unhappy_path_nonintegers + * + * @covers ::do_action + * + * @param array $priorities { + * Indexed array of the priorities for the MockAction callbacks. + * + * @type mixed $0 Priority for 'action' callback. + * @type mixed $1 Priority for 'action2' callback. + * } + * @param array $expected_call_order An array of callback names in expected call order. + * @param string $expected_deprecation Optional. Deprecation message. Default ''. + */ + public function test_priority_callback_order( $priorities, $expected_call_order, $expected_deprecation = '' ) { + $mock = new MockAction(); $hook_name = __FUNCTION__; - add_action( $hook_name, array( &$a, 'action' ), 10 ); - add_action( $hook_name, array( &$a, 'action2' ), 9 ); + if ( $expected_deprecation && PHP_VERSION_ID >= 80100 ) { + $this->expectDeprecation(); + $this->expectDeprecationMessage( $expected_deprecation ); + } + + add_action( $hook_name, array( $mock, 'action' ), $priorities[0] ); + add_action( $hook_name, array( $mock, 'action2' ), $priorities[1] ); do_action( $hook_name ); - // Two events, one per action. - $this->assertSame( 2, $a->get_call_count() ); + $this->assertSame( 2, $mock->get_call_count(), 'The number of call counts does not match' ); + + $actual_call_order = wp_list_pluck( $mock->get_events(), 'action' ); + $this->assertSame( $expected_call_order, $actual_call_order, 'The action callback order does not match the expected order' ); + } - $expected = array( - // 'action2' is called first because it has priority 9. - array( - 'action' => 'action2', - 'hook_name' => $hook_name, - 'tag' => $hook_name, // Back compat. - 'args' => array( '' ), + /** + * Happy path data provider. + * + * @return array[] + */ + public function data_priority_callback_order_with_integers() { + return array( + 'int DESC' => array( + 'priorities' => array( 10, 9 ), + 'expected_call_order' => array( 'action2', 'action' ), ), - // 'action' is called second. - array( - 'action' => 'action', - 'hook_name' => $hook_name, - 'tag' => $hook_name, // Back compat. - 'args' => array( '' ), + 'int ASC' => array( + 'priorities' => array( 9, 10 ), + 'expected_call_order' => array( 'action', 'action2' ), ), ); + } + + /** + * Unhappy path data provider. + * + * @return array[] + */ + public function data_priority_callback_order_with_unhappy_path_nonintegers() { + return array( + // Numbers as strings and floats. + 'int as string DESC' => array( + 'priorities' => array( '10', '9' ), + 'expected_call_order' => array( 'action2', 'action' ), + ), + 'int as string ASC' => array( + 'priorities' => array( '9', '10' ), + 'expected_call_order' => array( 'action', 'action2' ), + ), + 'float DESC' => array( + 'priorities' => array( 10.0, 9.5 ), + 'expected_call_order' => array( 'action2', 'action' ), + 'expected_deprecation' => 'Implicit conversion from float 9.5 to int loses precision', + ), + 'float ASC' => array( + 'priorities' => array( 9.5, 10.0 ), + 'expected_call_order' => array( 'action', 'action2' ), + 'expected_deprecation' => 'Implicit conversion from float 9.5 to int loses precision', + ), + 'float as string DESC' => array( + 'priorities' => array( '10.0', '9.5' ), + 'expected_call_order' => array( 'action2', 'action' ), + ), + 'float as string ASC' => array( + 'priorities' => array( '9.5', '10.0' ), + 'expected_call_order' => array( 'action', 'action2' ), + ), - $this->assertSame( $expected, $a->get_events() ); + // Non-numeric. + 'null' => array( + 'priorities' => array( null, null ), + 'expected_call_order' => array( 'action', 'action2' ), + ), + 'bool DESC' => array( + 'priorities' => array( true, false ), + 'expected_call_order' => array( 'action2', 'action' ), + ), + 'bool ASC' => array( + 'priorities' => array( false, true ), + 'expected_call_order' => array( 'action', 'action2' ), + ), + 'non-numerical string DESC' => array( + 'priorities' => array( 'test1', 'test2' ), + 'expected_call_order' => array( 'action', 'action2' ), + ), + 'non-numerical string ASC' => array( + 'priorities' => array( 'test1', 'test2' ), + 'expected_call_order' => array( 'action', 'action2' ), + ), + 'int, non-numerical string DESC' => array( + 'priorities' => array( 10, 'test' ), + 'expected_call_order' => array( 'action2', 'action' ), + ), + 'int, non-numerical string ASC' => array( + 'priorities' => array( 'test', 10 ), + 'expected_call_order' => array( 'action', 'action2' ), + ), + 'float, non-numerical string DESC' => array( + 'priorities' => array( 10.0, 'test' ), + 'expected_call_order' => array( 'action2', 'action' ), + ), + 'float, non-numerical string ASC' => array( + 'priorities' => array( 'test', 10.0 ), + 'expected_call_order' => array( 'action', 'action2' ), + ), + ); } /** diff --git a/tests/phpunit/tests/ajax/wpAjaxImageEditor.php b/tests/phpunit/tests/ajax/wpAjaxImageEditor.php index ac761c3520341..89745d645883c 100644 --- a/tests/phpunit/tests/ajax/wpAjaxImageEditor.php +++ b/tests/phpunit/tests/ajax/wpAjaxImageEditor.php @@ -52,7 +52,7 @@ public function testCropImageIntoLargerOne() { $ret = wp_save_image( $id ); $this->assertObjectHasProperty( 'error', $ret ); - $this->assertEquals( 'Images cannot be scaled to a size larger than the original.', $ret->error ); + $this->assertSame( 'Images cannot be scaled to a size larger than the original.', $ret->error ); } /** diff --git a/tests/phpunit/tests/ajax/wpAjaxInlineSave.php b/tests/phpunit/tests/ajax/wpAjaxInlineSave.php index 2edd630de8c64..afb73e6dcff61 100644 --- a/tests/phpunit/tests/ajax/wpAjaxInlineSave.php +++ b/tests/phpunit/tests/ajax/wpAjaxInlineSave.php @@ -110,7 +110,7 @@ public function test_quick_edit_draft_should_not_set_publish_date() { $this->assertSame( 'draft', $post->post_status ); - $this->assertEquals( '0000-00-00 00:00:00', $post->post_date_gmt ); + $this->assertSame( '0000-00-00 00:00:00', $post->post_date_gmt ); // Set up a request. $_POST['_inline_edit'] = wp_create_nonce( 'inlineeditnonce' ); @@ -142,7 +142,7 @@ public function test_quick_edit_draft_should_not_set_publish_date() { $post_date = sprintf( '%04d-%02d-%02d %02d:%02d:%02d', $_POST['aa'], $_POST['mm'], $_POST['jj'], $_POST['hh'], $_POST['mn'], $_POST['ss'] ); - $this->assertEquals( '0000-00-00 00:00:00', $post->post_date_gmt ); + $this->assertSame( '0000-00-00 00:00:00', $post->post_date_gmt ); } /** @@ -167,7 +167,7 @@ public function test_quick_edit_draft_should_set_publish_date() { $this->assertSame( 'draft', $post->post_status ); - $this->assertEquals( '0000-00-00 00:00:00', $post->post_date_gmt ); + $this->assertSame( '0000-00-00 00:00:00', $post->post_date_gmt ); // Set up a request. $_POST['_inline_edit'] = wp_create_nonce( 'inlineeditnonce' ); @@ -197,6 +197,6 @@ public function test_quick_edit_draft_should_set_publish_date() { $post = get_post( $post->ID ); - $this->assertEquals( '2020-09-11 19:20:11', $post->post_date_gmt ); + $this->assertSame( '2020-09-11 19:20:11', $post->post_date_gmt ); } } diff --git a/tests/phpunit/tests/block-supports/layout.php b/tests/phpunit/tests/block-supports/layout.php index df0abf9b49922..379c10fe2b566 100644 --- a/tests/phpunit/tests/block-supports/layout.php +++ b/tests/phpunit/tests/block-supports/layout.php @@ -252,4 +252,94 @@ public function data_layout_support_flag_renders_classnames_on_wrapper() { ), ); } + + /** + * Check that wp_restore_group_inner_container() restores the legacy inner container on the Group block. + * + * @ticket 60130 + * + * @covers ::wp_restore_group_inner_container + * + * @dataProvider data_restore_group_inner_container + * + * @param array $args Dataset to test. + * @param string $expected_output The expected output. + */ + public function test_restore_group_inner_container( $args, $expected_output ) { + $actual_output = wp_restore_group_inner_container( $args['block_content'], $args['block'] ); + $this->assertEquals( $expected_output, $actual_output ); + } + + /** + * Data provider for test_restore_group_inner_container. + * + * @return array + */ + public function data_restore_group_inner_container() { + return array( + 'group block with existing inner container' => array( + 'args' => array( + 'block_content' => '
', + 'block' => array( + 'blockName' => 'core/group', + 'attrs' => array( + 'layout' => array( + 'type' => 'default', + ), + ), + 'innerBlocks' => array(), + 'innerHTML' => '
', + 'innerContent' => array( + '
', + ' ', + '
', + ), + ), + ), + 'expected_output' => '
', + ), + 'group block with no existing inner container' => array( + 'args' => array( + 'block_content' => '
', + 'block' => array( + 'blockName' => 'core/group', + 'attrs' => array( + 'layout' => array( + 'type' => 'default', + ), + ), + 'innerBlocks' => array(), + 'innerHTML' => '
', + 'innerContent' => array( + '
', + ' ', + '
', + ), + ), + ), + 'expected_output' => '
', + ), + 'group block with layout classnames' => array( + 'args' => array( + 'block_content' => '
', + 'block' => array( + 'blockName' => 'core/group', + 'attrs' => array( + 'layout' => array( + 'type' => 'default', + ), + ), + 'innerBlocks' => array(), + 'innerHTML' => '
', + 'innerContent' => array( + '
', + ' ', + '
', + ), + ), + ), + 'expected_output' => '
', + ), + ); + } } diff --git a/tests/phpunit/tests/block-supports/wpRenderBackgroundSupport.php b/tests/phpunit/tests/block-supports/wpRenderBackgroundSupport.php index 4f38db87ab317..83ea7cd47c972 100644 --- a/tests/phpunit/tests/block-supports/wpRenderBackgroundSupport.php +++ b/tests/phpunit/tests/block-supports/wpRenderBackgroundSupport.php @@ -67,6 +67,7 @@ public function filter_set_theme_root() { * Tests that background image block support works as expected. * * @ticket 59357 + * @ticket 60175 * * @covers ::wp_render_background_support * @@ -135,7 +136,24 @@ public function data_background_block_support() { 'source' => 'file', ), ), - 'expected_wrapper' => '
Content
', + 'expected_wrapper' => '
Content
', + 'wrapper' => '
Content
', + ), + 'background image style with contain, position, and repeat is applied' => array( + 'theme_name' => 'block-theme-child-with-fluid-typography', + 'block_name' => 'test/background-rules-are-output', + 'background_settings' => array( + 'backgroundImage' => true, + ), + 'background_style' => array( + 'backgroundImage' => array( + 'url' => 'https://example.com/image.jpg', + 'source' => 'file', + ), + 'backgroundRepeat' => 'no-repeat', + 'backgroundSize' => 'contain', + ), + 'expected_wrapper' => '
Content
', 'wrapper' => '
Content
', ), 'background image style is appended if a style attribute already exists' => array( @@ -150,8 +168,8 @@ public function data_background_block_support() { 'source' => 'file', ), ), - 'expected_wrapper' => '
Content
', - 'wrapper' => '
Content
', + 'expected_wrapper' => '
Content
', + 'wrapper' => '
Content
', ), 'background image style is appended if a style attribute containing multiple styles already exists' => array( 'theme_name' => 'block-theme-child-with-fluid-typography', @@ -165,8 +183,8 @@ public function data_background_block_support() { 'source' => 'file', ), ), - 'expected_wrapper' => '
Content
', - 'wrapper' => '
Content
', + 'expected_wrapper' => '
Content
', + 'wrapper' => '
Content
', ), 'background image style is not applied if the block does not support background image' => array( 'theme_name' => 'block-theme-child-with-fluid-typography', diff --git a/tests/phpunit/tests/block-templates/buildBlockTemplateResultFromFile.php b/tests/phpunit/tests/block-templates/buildBlockTemplateResultFromFile.php index efc93d6ac3688..3aedcf0c2c7b8 100644 --- a/tests/phpunit/tests/block-templates/buildBlockTemplateResultFromFile.php +++ b/tests/phpunit/tests/block-templates/buildBlockTemplateResultFromFile.php @@ -26,7 +26,7 @@ public function test_should_build_template() { $this->assertSame( 'publish', $template->status ); $this->assertSame( 'theme', $template->source ); $this->assertSame( 'Single Posts', $template->title ); - $this->assertSame( 'Displays single posts on your website unless a custom template has been applied to that post or a dedicated template exists.', $template->description ); + $this->assertSame( 'Displays a single post on your website unless a custom template has been applied to that post or a dedicated template exists.', $template->description ); $this->assertSame( 'wp_template', $template->type ); $this->assertEmpty( $template->modified ); } @@ -64,7 +64,7 @@ public function test_should_enforce_default_properties_when_building_template() $this->assertSame( 'single', $template->slug ); $this->assertSame( 'Single Posts', $template->title ); - $this->assertSame( 'Displays single posts on your website unless a custom template has been applied to that post or a dedicated template exists.', $template->description ); + $this->assertSame( 'Displays a single post on your website unless a custom template has been applied to that post or a dedicated template exists.', $template->description ); $this->assertFalse( $template->is_custom ); } diff --git a/tests/phpunit/tests/customize/manager.php b/tests/phpunit/tests/customize/manager.php index 9f0ff383ed0e8..0f8ddb2d9bbf3 100644 --- a/tests/phpunit/tests/customize/manager.php +++ b/tests/phpunit/tests/customize/manager.php @@ -2150,6 +2150,45 @@ public function test_trash_changeset_post_preserves_properties() { $this->assertSame( $args['post_content'], $post->post_content ); } + /** + * Test that trash_changeset_post() passes the correct number of arguments to post trash hooks. + * + * @ticket 60183 + * @covers WP_Customize_Manager::trash_changeset_post + */ + public function test_trash_changeset_post_passes_all_arguments_to_trash_hooks() { + $args = array( + 'post_type' => 'customize_changeset', + 'post_content' => wp_json_encode( + array( + 'blogname' => array( + 'value' => 'Test', + ), + ) + ), + 'post_name' => wp_generate_uuid4(), + 'post_status' => 'draft', + ); + + $post_id = wp_insert_post( $args ); + + $manager = $this->create_test_manager( $args['post_name'] ); + + $pre_trash_post = new MockAction(); + $wp_trash_post = new MockAction(); + $trashed_post = new MockAction(); + + add_action( 'pre_trash_post', array( $pre_trash_post, 'action' ), 10, 3 ); + add_action( 'wp_trash_post', array( $wp_trash_post, 'action' ), 10, 2 ); + add_action( 'trashed_post', array( $trashed_post, 'action' ), 10, 2 ); + + $manager->trash_changeset_post( $post_id ); + + $this->assertCount( 3, $pre_trash_post->get_args()[0] ); + $this->assertCount( 2, $wp_trash_post->get_args()[0] ); + $this->assertCount( 2, $trashed_post->get_args()[0] ); + } + /** * Register scratchpad setting. * diff --git a/tests/phpunit/tests/db/charset.php b/tests/phpunit/tests/db/charset.php index 1a79ab911f2fb..52eb56a7a80f4 100644 --- a/tests/phpunit/tests/db/charset.php +++ b/tests/phpunit/tests/db/charset.php @@ -1022,7 +1022,7 @@ public function data_table_collation_check() { $table_name = 'table_collation_check'; $data = array( 'utf8_bin' => array( - // utf8_bin tables don't need extra sanity checking. + // utf8_bin tables don't need extra confidence checking. 'create' => '( a VARCHAR(50) COLLATE utf8_bin )', 'expected' => true, ), @@ -1037,13 +1037,13 @@ public function data_table_collation_check() { 'expected' => false, ), 'utf8_bin + big5_chinese_ci' => array( - // utf8_bin tables don't need extra sanity checking, + // utf8_bin tables don't need extra confidence checking, // except for when they're not just utf8_bin. 'create' => '( a VARCHAR(50) COLLATE utf8_bin, b VARCHAR(50) COLLATE big5_chinese_ci )', 'expected' => false, ), 'utf8_bin + int' => array( - // utf8_bin tables don't need extra sanity checking + // utf8_bin tables don't need extra confidence checking // when the other columns aren't strings. 'create' => '( a VARCHAR(50) COLLATE utf8_bin, b INT )', 'expected' => true, diff --git a/tests/phpunit/tests/dependencies/scripts.php b/tests/phpunit/tests/dependencies/scripts.php index 9021397e3b94c..228077188067b 100644 --- a/tests/phpunit/tests/dependencies/scripts.php +++ b/tests/phpunit/tests/dependencies/scripts.php @@ -3366,7 +3366,7 @@ public function test_wp_default_packages_vendor( $script ) { wp_default_packages_vendor( $wp_scripts ); - $this->assertEquals( $package_json[ $script ], $wp_scripts->query( $script, 'registered' )->ver ); + $this->assertSame( $package_json[ $script ], $wp_scripts->query( $script, 'registered' )->ver ); } public function data_wp_default_packages_vendor() { diff --git a/tests/phpunit/tests/filters.php b/tests/phpunit/tests/filters.php index 04a5f9e915030..6d512a19acb64 100644 --- a/tests/phpunit/tests/filters.php +++ b/tests/phpunit/tests/filters.php @@ -118,37 +118,133 @@ public function test_filter_args_2() { $this->assertSame( array( $val ), array_pop( $argsvar2 ) ); } - public function test_filter_priority() { - $a = new MockAction(); + /** + * @ticket 60193 + * + * @dataProvider data_priority_callback_order_with_integers + * @dataProvider data_priority_callback_order_with_unhappy_path_nonintegers + * + * @covers ::apply_filters + * + * @param array $priorities { + * Indexed array of the priorities for the MockAction callbacks. + * + * @type mixed $0 Priority for 'action' callback. + * @type mixed $1 Priority for 'action2' callback. + * } + * @param array $expected_call_order An array of callback names in expected call order. + * @param string $expected_deprecation Optional. Deprecation message. Default ''. + */ + public function test_priority_callback_order( $priorities, $expected_call_order, $expected_deprecation = '' ) { + $mock = new MockAction(); $hook_name = __FUNCTION__; - $val = __FUNCTION__ . '_val'; - // Make two filters with different priorities. - add_filter( $hook_name, array( $a, 'filter' ), 10 ); - add_filter( $hook_name, array( $a, 'filter2' ), 9 ); - $this->assertSame( $val, apply_filters( $hook_name, $val ) ); + if ( $expected_deprecation && PHP_VERSION_ID >= 80100 ) { + $this->expectDeprecation(); + $this->expectDeprecationMessage( $expected_deprecation ); + } + + add_filter( $hook_name, array( $mock, 'filter' ), $priorities[0] ); + add_filter( $hook_name, array( $mock, 'filter2' ), $priorities[1] ); + apply_filters( $hook_name, __FUNCTION__ . '_val' ); + + $this->assertSame( 2, $mock->get_call_count(), 'The number of call counts does not match' ); - // There should be two events, one per filter. - $this->assertSame( 2, $a->get_call_count() ); + $actual_call_order = wp_list_pluck( $mock->get_events(), 'filter' ); + $this->assertSame( $expected_call_order, $actual_call_order, 'The filter callback order does not match the expected order' ); + } - $expected = array( - // 'filter2' is called first because it has priority 9. - array( - 'filter' => 'filter2', - 'hook_name' => $hook_name, - 'tag' => $hook_name, // Back compat. - 'args' => array( $val ), + /** + * Happy path data provider. + * + * @return array[] + */ + public function data_priority_callback_order_with_integers() { + return array( + 'int DESC' => array( + 'priorities' => array( 10, 9 ), + 'expected_call_order' => array( 'filter2', 'filter' ), ), - // 'filter' is called second. - array( - 'filter' => 'filter', - 'hook_name' => $hook_name, - 'tag' => $hook_name, // Back compat. - 'args' => array( $val ), + 'int ASC' => array( + 'priorities' => array( 9, 10 ), + 'expected_call_order' => array( 'filter', 'filter2' ), ), ); + } - $this->assertSame( $expected, $a->get_events() ); + /** + * Unhappy path data provider. + * + * @return array[] + */ + public function data_priority_callback_order_with_unhappy_path_nonintegers() { + return array( + // Numbers as strings and floats. + 'int as string DESC' => array( + 'priorities' => array( '10', '9' ), + 'expected_call_order' => array( 'filter2', 'filter' ), + ), + 'int as string ASC' => array( + 'priorities' => array( '9', '10' ), + 'expected_call_order' => array( 'filter', 'filter2' ), + ), + 'float DESC' => array( + 'priorities' => array( 10.0, 9.5 ), + 'expected_call_order' => array( 'filter2', 'filter' ), + 'expected_deprecation' => 'Implicit conversion from float 9.5 to int loses precision', + ), + 'float ASC' => array( + 'priorities' => array( 9.5, 10.0 ), + 'expected_call_order' => array( 'filter', 'filter2' ), + 'expected_deprecation' => 'Implicit conversion from float 9.5 to int loses precision', + ), + 'float as string DESC' => array( + 'priorities' => array( '10.0', '9.5' ), + 'expected_call_order' => array( 'filter2', 'filter' ), + ), + 'float as string ASC' => array( + 'priorities' => array( '9.5', '10.0' ), + 'expected_call_order' => array( 'filter', 'filter2' ), + ), + + // Non-numeric. + 'null' => array( + 'priorities' => array( null, null ), + 'expected_call_order' => array( 'filter', 'filter2' ), + ), + 'bool DESC' => array( + 'priorities' => array( true, false ), + 'expected_call_order' => array( 'filter2', 'filter' ), + ), + 'bool ASC' => array( + 'priorities' => array( false, true ), + 'expected_call_order' => array( 'filter', 'filter2' ), + ), + 'non-numerical string DESC' => array( + 'priorities' => array( 'test1', 'test2' ), + 'expected_call_order' => array( 'filter', 'filter2' ), + ), + 'non-numerical string ASC' => array( + 'priorities' => array( 'test1', 'test2' ), + 'expected_call_order' => array( 'filter', 'filter2' ), + ), + 'int, non-numerical string DESC' => array( + 'priorities' => array( 10, 'test' ), + 'expected_call_order' => array( 'filter2', 'filter' ), + ), + 'int, non-numerical string ASC' => array( + 'priorities' => array( 'test', 10 ), + 'expected_call_order' => array( 'filter', 'filter2' ), + ), + 'float, non-numerical string DESC' => array( + 'priorities' => array( 10.0, 'test' ), + 'expected_call_order' => array( 'filter2', 'filter' ), + ), + 'float, non-numerical string ASC' => array( + 'priorities' => array( 'test', 10.0 ), + 'expected_call_order' => array( 'filter', 'filter2' ), + ), + ); } /** diff --git a/tests/phpunit/tests/formatting/wpTexturize.php b/tests/phpunit/tests/formatting/wpTexturize.php index 3202db4ba760f..fa81245c83bb9 100644 --- a/tests/phpunit/tests/formatting/wpTexturize.php +++ b/tests/phpunit/tests/formatting/wpTexturize.php @@ -1788,7 +1788,7 @@ public function data_translate() { } /** - * Extra sanity checks for _wptexturize_pushpop_element() + * Extra confidence checks for _wptexturize_pushpop_element() * * @ticket 28483 * @dataProvider data_element_stack diff --git a/tests/phpunit/tests/functions.php b/tests/phpunit/tests/functions.php index cef6a1eaf5462..828184491d7b9 100644 --- a/tests/phpunit/tests/functions.php +++ b/tests/phpunit/tests/functions.php @@ -229,7 +229,7 @@ public function test_wp_unique_filename() { $testdir = DIR_TESTDATA . '/images/'; - // Sanity check. + // Confidence check. $this->assertSame( 'abcdefg.png', wp_unique_filename( $testdir, 'abcdefg.png' ), 'Test non-existing file, file name should be unchanged.' ); // Ensure correct images exist. diff --git a/tests/phpunit/tests/functions/wpScheduledDelete.php b/tests/phpunit/tests/functions/wpScheduledDelete.php index 38044d44a1827..d3f4d144aa665 100644 --- a/tests/phpunit/tests/functions/wpScheduledDelete.php +++ b/tests/phpunit/tests/functions/wpScheduledDelete.php @@ -1,9 +1,9 @@ post->create( @@ -40,21 +41,21 @@ public function test_wp_scheduled_delete() { add_post_meta( self::$page_id, '_wp_trash_meta_time', time() - ( DAY_IN_SECONDS * EMPTY_TRASH_DAYS + 1 ) ); add_post_meta( self::$page_id, '_wp_trash_meta_status', 'published' ); - $this->assertNotEmpty( get_post( self::$page_id ) ); + $this->assertInstanceOf( 'WP_Post', get_post( self::$page_id ) ); wp_scheduled_delete(); - $this->assertEmpty( get_post( self::$page_id ) ); + $this->assertNull( get_post( self::$page_id ) ); } /** - * Don't delete old trashed post/pages if status not trash. - * Remove the trash meta status. + * Tests that old trashed posts/pages are not deleted if status is not 'trash'. * - * @ticket 59938 + * Ensures that the trash meta status is removed. * + * @ticket 59938 */ - public function test_wp_scheduled_delete_not_trash() { + public function test_wp_scheduled_delete_status_not_trash() { self::$page_id = self::factory()->post->create( array( 'post_type' => 'page', @@ -64,23 +65,22 @@ public function test_wp_scheduled_delete_not_trash() { add_post_meta( self::$page_id, '_wp_trash_meta_time', time() - ( DAY_IN_SECONDS * EMPTY_TRASH_DAYS + 1 ) ); add_post_meta( self::$page_id, '_wp_trash_meta_status', 'published' ); - $this->assertNotEmpty( get_post( self::$page_id ) ); + $this->assertInstanceOf( 'WP_Post', get_post( self::$page_id ) ); wp_scheduled_delete(); - $this->assertNotEmpty( get_post( self::$page_id ) ); - $this->assertEmpty( get_post_meta( self::$page_id, '_wp_trash_meta_time', true ) ); - $this->assertEmpty( get_post_meta( self::$page_id, '_wp_trash_meta_status', true ) ); + $this->assertInstanceOf( 'WP_Post', get_post( self::$page_id ) ); + $this->assertSame( '', get_post_meta( self::$page_id, '_wp_trash_meta_time', true ) ); + $this->assertSame( '', get_post_meta( self::$page_id, '_wp_trash_meta_status', true ) ); } /** - * Don't delete old trashed post/pages if old enough. + * Tests that old trashed posts/pages are not deleted if not old enough. * * @ticket 59938 - * */ - public function test_wp_scheduled_delete_not_old() { + public function test_wp_scheduled_delete_page_not_old_enough() { self::$page_id = self::factory()->post->create( array( 'post_type' => 'page', @@ -90,20 +90,19 @@ public function test_wp_scheduled_delete_not_old() { add_post_meta( self::$page_id, '_wp_trash_meta_time', time() - ( DAY_IN_SECONDS * EMPTY_TRASH_DAYS ) ); add_post_meta( self::$page_id, '_wp_trash_meta_status', 'published' ); - $this->assertNotEmpty( get_post( self::$page_id ) ); + $this->assertInstanceOf( 'WP_Post', get_post( self::$page_id ) ); wp_scheduled_delete(); - $this->assertNotEmpty( get_post( self::$page_id ) ); - $this->assertNotEmpty( get_post_meta( self::$page_id, '_wp_trash_meta_time', true ) ); - $this->assertNotEmpty( get_post_meta( self::$page_id, '_wp_trash_meta_status', true ) ); + $this->assertInstanceOf( 'WP_Post', get_post( self::$page_id ) ); + $this->assertIsNumeric( get_post_meta( self::$page_id, '_wp_trash_meta_time', true ) ); + $this->assertSame( 'published', get_post_meta( self::$page_id, '_wp_trash_meta_status', true ) ); } /** - * Delete old trashed comments. + * Tests that old trashed comments are deleted. * * @ticket 59938 - * */ public function test_wp_scheduled_delete_comment() { self::$comment_id = self::factory()->comment->create( @@ -114,21 +113,21 @@ public function test_wp_scheduled_delete_comment() { add_comment_meta( self::$comment_id, '_wp_trash_meta_time', time() - ( DAY_IN_SECONDS * EMPTY_TRASH_DAYS + 1 ) ); add_post_meta( self::$comment_id, '_wp_trash_meta_status', 'published' ); - $this->assertNotEmpty( get_comment( self::$comment_id ) ); + $this->assertInstanceOf( 'WP_Comment', get_comment( self::$comment_id ) ); wp_scheduled_delete(); - $this->assertEmpty( get_comment( self::$comment_id ) ); + $this->assertNull( get_comment( self::$comment_id ) ); } /** - * Don't delete old trashed comments if status not trash. - * Remove the trash meta status. + * Tests that old trashed comments are not deleted if status is not 'trash'. * - * @ticket 59938 + * Ensures that the trash meta status is removed. * + * @ticket 59938 */ - public function test_wp_scheduled_delete_not_trash_comment() { + public function test_wp_scheduled_delete_comment_status_not_trash() { self::$comment_id = self::factory()->comment->create( array( 'comment_approved' => '1', @@ -137,23 +136,22 @@ public function test_wp_scheduled_delete_not_trash_comment() { add_comment_meta( self::$comment_id, '_wp_trash_meta_time', time() - ( DAY_IN_SECONDS * EMPTY_TRASH_DAYS + 1 ) ); add_comment_meta( self::$comment_id, '_wp_trash_meta_status', 'published' ); - $this->assertNotEmpty( get_comment( self::$comment_id ) ); + $this->assertInstanceOf( 'WP_Comment', get_comment( self::$comment_id ) ); wp_scheduled_delete(); - $this->assertNotEmpty( get_comment( self::$comment_id ) ); - $this->assertEmpty( get_comment_meta( self::$comment_id, '_wp_trash_meta_time', true ) ); - $this->assertEmpty( get_comment_meta( self::$comment_id, '_wp_trash_meta_status', true ) ); + $this->assertInstanceOf( 'WP_Comment', get_comment( self::$comment_id ) ); + $this->assertSame( '', get_comment_meta( self::$comment_id, '_wp_trash_meta_time', true ) ); + $this->assertSame( '', get_comment_meta( self::$comment_id, '_wp_trash_meta_status', true ) ); } /** - * Don't delete old trashed comments if old enough. + * Tests that old trashed comments are not deleted if not old enough. * * @ticket 59938 - * */ - public function test_wp_scheduled_delete_not_old_comment() { + public function test_wp_scheduled_delete_comment_not_old_enough() { self::$comment_id = self::factory()->comment->create( array( 'comment_approved' => 'trash', @@ -162,12 +160,12 @@ public function test_wp_scheduled_delete_not_old_comment() { add_comment_meta( self::$comment_id, '_wp_trash_meta_time', time() - ( DAY_IN_SECONDS * EMPTY_TRASH_DAYS ) ); add_comment_meta( self::$comment_id, '_wp_trash_meta_status', 'published' ); - $this->assertNotEmpty( get_comment( self::$comment_id ) ); + $this->assertInstanceOf( 'WP_Comment', get_comment( self::$comment_id ) ); wp_scheduled_delete(); - $this->assertNotEmpty( get_comment( self::$comment_id ) ); - $this->assertNotEmpty( get_comment_meta( self::$comment_id, '_wp_trash_meta_time', true ) ); - $this->assertNotEmpty( get_comment_meta( self::$comment_id, '_wp_trash_meta_status', true ) ); + $this->assertInstanceOf( 'WP_Comment', get_comment( self::$comment_id ) ); + $this->assertIsNumeric( get_comment_meta( self::$comment_id, '_wp_trash_meta_time', true ) ); + $this->assertSame( 'published', get_comment_meta( self::$comment_id, '_wp_trash_meta_status', true ) ); } } diff --git a/tests/phpunit/tests/hooks/applyFilters.php b/tests/phpunit/tests/hooks/applyFilters.php index 4c3a594aa98e0..50c35e3498a96 100644 --- a/tests/phpunit/tests/hooks/applyFilters.php +++ b/tests/phpunit/tests/hooks/applyFilters.php @@ -42,4 +42,132 @@ public function test_apply_filters_with_multiple_calls() { $this->assertSame( $returned_two, $arg ); $this->assertSame( 2, $a->get_call_count() ); } + + /** + * @ticket 60193 + * + * @dataProvider data_priority_callback_order_with_integers + * @dataProvider data_priority_callback_order_with_unhappy_path_nonintegers + * + * @param array $priorities { + * Indexed array of the priorities for the MockAction callbacks. + * + * @type mixed $0 Priority for 'action' callback. + * @type mixed $1 Priority for 'action2' callback. + * } + * @param array $expected_call_order An array of callback names in expected call order. + * @param string $expected_deprecation Optional. Deprecation message. Default ''. + */ + public function test_priority_callback_order( $priorities, $expected_call_order, $expected_deprecation = '' ) { + $mock = new MockAction(); + $hook = new WP_Hook(); + $hook_name = __FUNCTION__; + + if ( $expected_deprecation && PHP_VERSION_ID >= 80100 ) { + $this->expectDeprecation(); + $this->expectDeprecationMessage( $expected_deprecation ); + } + + $hook->add_filter( $hook_name, array( $mock, 'filter' ), $priorities[0], 1 ); + $hook->add_filter( $hook_name, array( $mock, 'filter2' ), $priorities[1], 1 ); + $hook->apply_filters( __FUNCTION__ . '_val', array( '' ) ); + + $this->assertSame( 2, $mock->get_call_count(), 'The number of call counts does not match' ); + + $actual_call_order = wp_list_pluck( $mock->get_events(), 'filter' ); + $this->assertSame( $expected_call_order, $actual_call_order, 'The filter callback order does not match the expected order' ); + } + + /** + * Happy path data provider. + * + * @return array[] + */ + public function data_priority_callback_order_with_integers() { + return array( + 'int DESC' => array( + 'priorities' => array( 10, 9 ), + 'expected_call_order' => array( 'filter2', 'filter' ), + ), + 'int ASC' => array( + 'priorities' => array( 9, 10 ), + 'expected_call_order' => array( 'filter', 'filter2' ), + ), + ); + } + + /** + * Unhappy path data provider. + * + * @return array[] + */ + public function data_priority_callback_order_with_unhappy_path_nonintegers() { + return array( + // Numbers as strings and floats. + 'int as string DESC' => array( + 'priorities' => array( '10', '9' ), + 'expected_call_order' => array( 'filter2', 'filter' ), + ), + 'int as string ASC' => array( + 'priorities' => array( '9', '10' ), + 'expected_call_order' => array( 'filter', 'filter2' ), + ), + 'float DESC' => array( + 'priorities' => array( 10.0, 9.5 ), + 'expected_call_order' => array( 'filter2', 'filter' ), + 'expected_deprecation' => 'Implicit conversion from float 9.5 to int loses precision', + ), + 'float ASC' => array( + 'priorities' => array( 9.5, 10.0 ), + 'expected_call_order' => array( 'filter', 'filter2' ), + 'expected_deprecation' => 'Implicit conversion from float 9.5 to int loses precision', + ), + 'float as string DESC' => array( + 'priorities' => array( '10.0', '9.5' ), + 'expected_call_order' => array( 'filter2', 'filter' ), + ), + 'float as string ASC' => array( + 'priorities' => array( '9.5', '10.0' ), + 'expected_call_order' => array( 'filter', 'filter2' ), + ), + + // Non-numeric. + 'null' => array( + 'priorities' => array( null, null ), + 'expected_call_order' => array( 'filter', 'filter2' ), + ), + 'bool DESC' => array( + 'priorities' => array( true, false ), + 'expected_call_order' => array( 'filter2', 'filter' ), + ), + 'bool ASC' => array( + 'priorities' => array( false, true ), + 'expected_call_order' => array( 'filter', 'filter2' ), + ), + 'non-numerical string DESC' => array( + 'priorities' => array( 'test1', 'test2' ), + 'expected_call_order' => array( 'filter', 'filter2' ), + ), + 'non-numerical string ASC' => array( + 'priorities' => array( 'test1', 'test2' ), + 'expected_call_order' => array( 'filter', 'filter2' ), + ), + 'int, non-numerical string DESC' => array( + 'priorities' => array( 10, 'test' ), + 'expected_call_order' => array( 'filter2', 'filter' ), + ), + 'int, non-numerical string ASC' => array( + 'priorities' => array( 'test', 10 ), + 'expected_call_order' => array( 'filter', 'filter2' ), + ), + 'float, non-numerical string DESC' => array( + 'priorities' => array( 10.0, 'test' ), + 'expected_call_order' => array( 'filter2', 'filter' ), + ), + 'float, non-numerical string ASC' => array( + 'priorities' => array( 'test', 10.0 ), + 'expected_call_order' => array( 'filter', 'filter2' ), + ), + ); + } } diff --git a/tests/phpunit/tests/hooks/doAction.php b/tests/phpunit/tests/hooks/doAction.php index 858917fdcede1..c9767f865df26 100644 --- a/tests/phpunit/tests/hooks/doAction.php +++ b/tests/phpunit/tests/hooks/doAction.php @@ -85,6 +85,134 @@ public function test_do_action_with_multiple_callbacks_on_different_priorities() $this->assertSame( 1, $a->get_call_count() ); } + /** + * @ticket 60193 + * + * @dataProvider data_priority_callback_order_with_integers + * @dataProvider data_priority_callback_order_with_unhappy_path_nonintegers + * + * @param array $priorities { + * Indexed array of the priorities for the MockAction callbacks. + * + * @type mixed $0 Priority for 'action' callback. + * @type mixed $1 Priority for 'action2' callback. + * } + * @param array $expected_call_order An array of callback names in expected call order. + * @param string $expected_deprecation Optional. Deprecation message. Default ''. + */ + public function test_priority_callback_order( $priorities, $expected_call_order, $expected_deprecation = '' ) { + $mock = new MockAction(); + $hook = new WP_Hook(); + $hook_name = __FUNCTION__; + + if ( $expected_deprecation && PHP_VERSION_ID >= 80100 ) { + $this->expectDeprecation(); + $this->expectDeprecationMessage( $expected_deprecation ); + } + + $hook->add_filter( $hook_name, array( $mock, 'action' ), $priorities[0], 1 ); + $hook->add_filter( $hook_name, array( $mock, 'action2' ), $priorities[1], 1 ); + $hook->do_action( array( '' ) ); + + $this->assertSame( 2, $mock->get_call_count(), 'The number of call counts does not match' ); + + $actual_call_order = wp_list_pluck( $mock->get_events(), 'action' ); + $this->assertSame( $expected_call_order, $actual_call_order, 'The action callback order does not match the expected order' ); + } + + /** + * Happy path data provider. + * + * @return array[] + */ + public function data_priority_callback_order_with_integers() { + return array( + 'int DESC' => array( + 'priorities' => array( 10, 9 ), + 'expected_call_order' => array( 'action2', 'action' ), + ), + 'int ASC' => array( + 'priorities' => array( 9, 10 ), + 'expected_call_order' => array( 'action', 'action2' ), + ), + ); + } + + /** + * Unhappy path data provider. + * + * @return array[] + */ + public function data_priority_callback_order_with_unhappy_path_nonintegers() { + return array( + // Numbers as strings and floats. + 'int as string DESC' => array( + 'priorities' => array( '10', '9' ), + 'expected_call_order' => array( 'action2', 'action' ), + ), + 'int as string ASC' => array( + 'priorities' => array( '9', '10' ), + 'expected_call_order' => array( 'action', 'action2' ), + ), + 'float DESC' => array( + 'priorities' => array( 10.0, 9.5 ), + 'expected_call_order' => array( 'action2', 'action' ), + 'expected_deprecation' => 'Implicit conversion from float 9.5 to int loses precision', + ), + 'float ASC' => array( + 'priorities' => array( 9.5, 10.0 ), + 'expected_call_order' => array( 'action', 'action2' ), + 'expected_deprecation' => 'Implicit conversion from float 9.5 to int loses precision', + ), + 'float as string DESC' => array( + 'priorities' => array( '10.0', '9.5' ), + 'expected_call_order' => array( 'action2', 'action' ), + ), + 'float as string ASC' => array( + 'priorities' => array( '9.5', '10.0' ), + 'expected_call_order' => array( 'action', 'action2' ), + ), + + // Non-numeric. + 'null' => array( + 'priorities' => array( null, null ), + 'expected_call_order' => array( 'action', 'action2' ), + ), + 'bool DESC' => array( + 'priorities' => array( true, false ), + 'expected_call_order' => array( 'action2', 'action' ), + ), + 'bool ASC' => array( + 'priorities' => array( false, true ), + 'expected_call_order' => array( 'action', 'action2' ), + ), + 'non-numerical string DESC' => array( + 'priorities' => array( 'test1', 'test2' ), + 'expected_call_order' => array( 'action', 'action2' ), + ), + 'non-numerical string ASC' => array( + 'priorities' => array( 'test1', 'test2' ), + 'expected_call_order' => array( 'action', 'action2' ), + ), + 'int, non-numerical string DESC' => array( + 'priorities' => array( 10, 'test' ), + 'expected_call_order' => array( 'action2', 'action' ), + ), + 'int, non-numerical string ASC' => array( + 'priorities' => array( 'test', 10 ), + 'expected_call_order' => array( 'action', 'action2' ), + ), + 'float, non-numerical string DESC' => array( + 'priorities' => array( 10.0, 'test' ), + 'expected_call_order' => array( 'action2', 'action' ), + ), + 'float, non-numerical string ASC' => array( + 'priorities' => array( 'test', 10.0 ), + 'expected_call_order' => array( 'action', 'action2' ), + ), + ); + } + public function test_do_action_with_no_accepted_args() { $callback = array( $this, '_action_callback' ); $hook = new WP_Hook(); diff --git a/tests/phpunit/tests/html-api/wpHtmlProcessor.php b/tests/phpunit/tests/html-api/wpHtmlProcessor.php index a9af5d790fc53..d9f1357b5c66f 100644 --- a/tests/phpunit/tests/html-api/wpHtmlProcessor.php +++ b/tests/phpunit/tests/html-api/wpHtmlProcessor.php @@ -60,22 +60,6 @@ public function test_get_tag_is_null_once_document_is_finished() { $this->assertNull( $p->get_tag() ); } - /** - * Ensures that if the HTML Processor encounters inputs that it can't properly handle, - * that it stops processing the rest of the document. This prevents data corruption. - * - * @ticket 59167 - * - * @covers WP_HTML_Processor::next_tag - */ - public function test_stops_processing_after_unsupported_elements() { - $p = WP_HTML_Processor::create_fragment( '

' ); - $p->next_tag( 'P' ); - $this->assertFalse( $p->next_tag(), 'Stepped into a tag after encountering X-NOT-SUPPORTED element when it should have aborted.' ); - $this->assertNull( $p->get_tag(), "Should have aborted processing, but still reported tag {$p->get_tag()} after properly failing to step into tag." ); - $this->assertFalse( $p->next_tag( 'P' ), 'Stepped into normal P element after X-NOT-SUPPORTED element when it should have aborted.' ); - } - /** * Ensures that the HTML Processor maintains its internal state through seek calls. * @@ -147,4 +131,91 @@ public function test_fails_to_reconstruct_formatting_elements() { $this->assertTrue( $p->next_tag( 'EM' ), 'Could not find first EM.' ); $this->assertFalse( $p->next_tag( 'EM' ), 'Should have aborted before finding second EM as it required reconstructing the first EM.' ); } + + /** + * Ensures that special handling of unsupported tags is cleaned up + * as handling is implemented. Otherwise there's risk of leaving special + * handling (that is never reached) when tag handling is implemented. + * + * @ticket 60092 + * + * @dataProvider data_unsupported_special_in_body_tags + * + * @covers WP_HTML_Processor::step_in_body + * + * @param string $tag_name Name of the tag to test. + */ + public function test_step_in_body_fails_on_unsupported_tags( $tag_name ) { + $fragment = WP_HTML_Processor::create_fragment( '<' . $tag_name . '>' ); + $this->assertFalse( $fragment->next_tag(), 'Should fail to find tag: ' . $tag_name . '.' ); + $this->assertEquals( $fragment->get_last_error(), WP_HTML_Processor::ERROR_UNSUPPORTED, 'Should have unsupported last error.' ); + } + + /** + * Data provider. + * + * @return array[] + */ + public function data_unsupported_special_in_body_tags() { + return array( + 'APPLET' => array( 'APPLET' ), + 'AREA' => array( 'AREA' ), + 'BASE' => array( 'BASE' ), + 'BASEFONT' => array( 'BASEFONT' ), + 'BGSOUND' => array( 'BGSOUND' ), + 'BODY' => array( 'BODY' ), + 'BR' => array( 'BR' ), + 'CAPTION' => array( 'CAPTION' ), + 'COL' => array( 'COL' ), + 'COLGROUP' => array( 'COLGROUP' ), + 'EMBED' => array( 'EMBED' ), + 'FORM' => array( 'FORM' ), + 'FRAME' => array( 'FRAME' ), + 'FRAMESET' => array( 'FRAMESET' ), + 'HEAD' => array( 'HEAD' ), + 'HR' => array( 'HR' ), + 'HTML' => array( 'HTML' ), + 'IFRAME' => array( 'IFRAME' ), + 'INPUT' => array( 'INPUT' ), + 'KEYGEN' => array( 'KEYGEN' ), + 'LINK' => array( 'LINK' ), + 'LISTING' => array( 'LISTING' ), + 'MARQUEE' => array( 'MARQUEE' ), + 'MATH' => array( 'MATH' ), + 'META' => array( 'META' ), + 'NOBR' => array( 'NOBR' ), + 'NOEMBED' => array( 'NOEMBED' ), + 'NOFRAMES' => array( 'NOFRAMES' ), + 'NOSCRIPT' => array( 'NOSCRIPT' ), + 'OBJECT' => array( 'OBJECT' ), + 'OPTGROUP' => array( 'OPTGROUP' ), + 'OPTION' => array( 'OPTION' ), + 'PARAM' => array( 'PARAM' ), + 'PLAINTEXT' => array( 'PLAINTEXT' ), + 'PRE' => array( 'PRE' ), + 'RB' => array( 'RB' ), + 'RP' => array( 'RP' ), + 'RT' => array( 'RT' ), + 'RTC' => array( 'RTC' ), + 'SARCASM' => array( 'SARCASM' ), + 'SCRIPT' => array( 'SCRIPT' ), + 'SELECT' => array( 'SELECT' ), + 'SOURCE' => array( 'SOURCE' ), + 'STYLE' => array( 'STYLE' ), + 'SVG' => array( 'SVG' ), + 'TABLE' => array( 'TABLE' ), + 'TBODY' => array( 'TBODY' ), + 'TD' => array( 'TD' ), + 'TEMPLATE' => array( 'TEMPLATE' ), + 'TEXTAREA' => array( 'TEXTAREA' ), + 'TFOOT' => array( 'TFOOT' ), + 'TH' => array( 'TH' ), + 'THEAD' => array( 'THEAD' ), + 'TITLE' => array( 'TITLE' ), + 'TR' => array( 'TR' ), + 'TRACK' => array( 'TRACK' ), + 'WBR' => array( 'WBR' ), + 'XMP' => array( 'XMP' ), + ); + } } diff --git a/tests/phpunit/tests/html-api/wpHtmlProcessorBreadcrumbs.php b/tests/phpunit/tests/html-api/wpHtmlProcessorBreadcrumbs.php index 2fd852e434412..15d38d6f70c6c 100644 --- a/tests/phpunit/tests/html-api/wpHtmlProcessorBreadcrumbs.php +++ b/tests/phpunit/tests/html-api/wpHtmlProcessorBreadcrumbs.php @@ -37,19 +37,33 @@ public function test_navigates_into_normative_html_for_supported_elements( $html public function data_single_tag_of_supported_elements() { $supported_elements = array( 'A', + 'ABBR', + 'ACRONYM', // Neutralized. 'ADDRESS', 'ARTICLE', 'ASIDE', + 'AUDIO', 'B', + 'BDI', + 'BDO', 'BIG', + 'BLINK', // Deprecated. 'BUTTON', - 'CENTER', // Neutralized + 'CANVAS', + 'CENTER', // Neutralized. + 'CITE', 'CODE', + 'DATA', + 'DD', + 'DATALIST', + 'DFN', + 'DEL', 'DETAILS', 'DIALOG', 'DIR', 'DIV', 'DL', + 'DT', 'EM', 'FIELDSET', 'FIGCAPTION', @@ -66,19 +80,45 @@ public function data_single_tag_of_supported_elements() { 'HGROUP', 'I', 'IMG', + 'INS', + 'LI', + 'ISINDEX', // Deprecated + 'KBD', + 'LABEL', + 'LEGEND', 'MAIN', + 'MAP', + 'MARK', 'MENU', + 'METER', + 'MULTICOL', // Deprecated 'NAV', + 'NEXTID', // Deprecated + 'OL', + 'OUTPUT', 'P', + 'PICTURE', + 'PROGRESS', + 'Q', + 'RUBY', + 'SAMP', 'SEARCH', 'SECTION', + 'SLOT', 'SMALL', + 'SPACER', // Deprecated 'SPAN', 'STRIKE', 'STRONG', + 'SUB', 'SUMMARY', + 'SUP', + 'TIME', 'TT', 'U', + 'UL', + 'VAR', + 'VIDEO', ); $data = array(); @@ -121,29 +161,15 @@ public function test_fails_when_encountering_unsupported_tag( $html ) { */ public function data_unsupported_elements() { $unsupported_elements = array( - 'ABBR', - 'ACRONYM', // Neutralized - 'APPLET', // Deprecated + 'APPLET', // Deprecated. 'AREA', - 'AUDIO', 'BASE', - 'BDI', - 'BDO', 'BGSOUND', // Deprecated; self-closing if self-closing flag provided, otherwise normal. - 'BLINK', // Deprecated 'BODY', 'BR', - 'CANVAS', 'CAPTION', - 'CITE', 'COL', 'COLGROUP', - 'DATA', - 'DATALIST', - 'DD', - 'DEL', - 'DEFN', - 'DT', 'EMBED', 'FORM', 'FRAME', @@ -153,51 +179,29 @@ public function data_unsupported_elements() { 'HTML', 'IFRAME', 'INPUT', - 'INS', - 'ISINDEX', // Deprecated - 'KBD', - 'KEYGEN', // Deprecated; void - 'LABEL', - 'LEGEND', - 'LI', + 'KEYGEN', // Deprecated; void. 'LINK', 'LISTING', // Deprecated, use PRE instead. - 'MAP', - 'MARK', - 'MARQUEE', // Deprecated + 'MARQUEE', // Deprecated. 'MATH', 'META', - 'METER', - 'MULTICOL', // Deprecated - 'NEXTID', // Deprecated - 'NOBR', // Neutralized - 'NOEMBED', // Neutralized - 'NOFRAMES', // Neutralized + 'NOBR', // Neutralized. + 'NOEMBED', // Neutralized. + 'NOFRAMES', // Neutralized. 'NOSCRIPT', 'OBJECT', - 'OL', 'OPTGROUP', 'OPTION', - 'OUTPUT', - 'PICTURE', - 'PLAINTEXT', // Neutralized + 'PLAINTEXT', // Neutralized. 'PRE', - 'PROGRESS', - 'Q', - 'RB', // Neutralized + 'RB', // Neutralized. 'RP', 'RT', - 'RTC', // Neutralized - 'RUBY', - 'SAMP', + 'RTC', // Neutralized. 'SCRIPT', 'SELECT', - 'SLOT', 'SOURCE', - 'SPACER', // Deprecated 'STYLE', - 'SUB', - 'SUP', 'SVG', 'TABLE', 'TBODY', @@ -207,19 +211,11 @@ public function data_unsupported_elements() { 'TFOOT', 'TH', 'THEAD', - 'TIME', 'TITLE', 'TR', 'TRACK', - 'UL', - 'VAR', - 'VIDEO', 'WBR', 'XMP', // Deprecated, use PRE instead. - - // Made up elements, custom elements. - 'X-NOT-AN-HTML-ELEMENT', - 'HUMAN-TIME', ); $data = array(); @@ -352,6 +348,12 @@ public function data_html_target_with_breadcrumbs() { ), 'MAIN inside MAIN inside SPAN' => array( '
', array( 'HTML', 'BODY', 'SPAN', 'MAIN', 'MAIN' ), 1 ), 'MAIN next to unclosed P' => array( '

', array( 'HTML', 'BODY', 'MAIN' ), 1 ), + 'LI after unclosed LI' => array( '
  • one
  • two
  • three', array( 'HTML', 'BODY', 'LI' ), 3 ), + 'LI in UL in LI' => array( '
    • one
      • two', array( 'HTML', 'BODY', 'UL', 'LI', 'UL', 'LI' ), 1 ), + 'DD and DT mutually close, LI self-closes (dt 2)' => array( '
      • ', array( 'HTML', 'BODY', 'DT' ), 2 ), + 'DD and DT mutually close, LI self-closes (dd 3)' => array( '
      • ', array( 'HTML', 'BODY', 'DD' ), 3 ), + 'DD and DT mutually close, LI self-closes (li 1)' => array( '
      • ', array( 'HTML', 'BODY', 'DD', 'LI' ), 1 ), + 'DD and DT mutually close, LI self-closes (li 2)' => array( '
      • ', array( 'HTML', 'BODY', 'DD', 'LI' ), 2 ), // H1 - H6 close out _any_ H1 - H6 when encountering _any_ of H1 - H6, making this section surprising. 'EM inside H3 after unclosed P' => array( '

        Important Message

        ', array( 'HTML', 'BODY', 'H3', 'EM' ), 1 ), @@ -360,6 +362,10 @@ public function data_html_target_with_breadcrumbs() { 'H4 inside H2' => array( '

        Major

        Minor

        ', array( 'HTML', 'BODY', 'H2', 'SPAN', 'H4' ), 1 ), 'H5 after unclosed H4 inside H2' => array( '

        Major

        Minor

        ', array( 'HTML', 'BODY', 'H2', 'SPAN', 'H5' ), 1 ), 'H5 after H4 inside H2' => array( '

        Major

        Minor

        ', array( 'HTML', 'BODY', 'H5' ), 1 ), + + // Custom elements. + 'WP-EMOJI' => array( '
        ', array( 'HTML', 'BODY', 'DIV', 'WP-EMOJI' ), 1 ), + 'WP-EMOJI then IMG' => array( '
        ', array( 'HTML', 'BODY', 'DIV', 'IMG' ), 1 ), ); } diff --git a/tests/phpunit/tests/html-api/wpHtmlProcessorSemanticRules.php b/tests/phpunit/tests/html-api/wpHtmlProcessorSemanticRules.php index 7bd243d8dce9a..c1adf9a71a3f8 100644 --- a/tests/phpunit/tests/html-api/wpHtmlProcessorSemanticRules.php +++ b/tests/phpunit/tests/html-api/wpHtmlProcessorSemanticRules.php @@ -35,7 +35,7 @@ public function test_in_body_article_group_closes_open_p_element( $tag_name ) { continue; } - $this->assertEquals( + $this->assertSame( $tag_name, $processor->get_tag(), "Expected to find {$tag_name} but found {$processor->get_tag()} instead." @@ -125,7 +125,7 @@ public function test_in_body_skips_unexpected_button_closer() { $p = WP_HTML_Processor::create_fragment( '
        Test
        ' ); $p->step(); - $this->assertEquals( 'DIV', $p->get_tag(), 'Did not stop at initial DIV tag.' ); + $this->assertSame( 'DIV', $p->get_tag(), 'Did not stop at initial DIV tag.' ); $this->assertFalse( $p->is_tag_closer(), 'Did not find that initial DIV tag is an opener.' ); /* @@ -133,7 +133,7 @@ public function test_in_body_skips_unexpected_button_closer() { * It should be ignored as there's no BUTTON to close. */ $this->assertTrue( $p->step(), 'Found no further tags when it should have found the closing DIV' ); - $this->assertEquals( 'DIV', $p->get_tag(), "Did not skip unexpected BUTTON; stopped at {$p->get_tag()}." ); + $this->assertSame( 'DIV', $p->get_tag(), "Did not skip unexpected BUTTON; stopped at {$p->get_tag()}." ); $this->assertTrue( $p->is_tag_closer(), 'Did not find that the terminal DIV tag is a closer.' ); } @@ -224,6 +224,109 @@ public function test_in_body_button_with_button_in_scope_as_ancestor() { $this->assertSame( array( 'HTML', 'BODY', 'BUTTON' ), $p->get_breadcrumbs(), 'Failed to produce expected DOM nesting for third button.' ); } + /** + * Verifies that H1 through H6 elements close an open P element. + * + * @ticket 60215 + * + * @dataProvider data_heading_elements + * + * @param string $tag_name Name of H1 - H6 element under test. + */ + public function test_in_body_heading_element_closes_open_p_tag( $tag_name ) { + $processor = WP_HTML_Processor::create_fragment( + "

        Open<{$tag_name}>Closed P

        " + ); + + $processor->next_tag( $tag_name ); + $this->assertSame( + array( 'HTML', 'BODY', $tag_name ), + $processor->get_breadcrumbs(), + "Expected {$tag_name} to be a direct child of the BODY, having closed the open P element." + ); + + $processor->next_tag( 'IMG' ); + $this->assertSame( + array( 'HTML', 'BODY', 'IMG' ), + $processor->get_breadcrumbs(), + 'Expected IMG to be a direct child of BODY, having closed the open P element.' + ); + } + + /** + * Data provider. + * + * @return array[]. + */ + public function data_heading_elements() { + return array( + 'H1' => array( 'H1' ), + 'H2' => array( 'H2' ), + 'H3' => array( 'H3' ), + 'H4' => array( 'H4' ), + 'H5' => array( 'H5' ), + 'H6' => array( 'H5' ), + ); + } + + /** + * Verifies that H1 through H6 elements close an open H1 through H6 element. + * + * @ticket 60215 + * + * @dataProvider data_heading_combinations + * + * @param string $first_heading H1 - H6 element appearing (unclosed) before the second. + * @param string $second_heading H1 - H6 element appearing after the first. + */ + public function test_in_body_heading_element_closes_other_heading_elements( $first_heading, $second_heading ) { + $processor = WP_HTML_Processor::create_fragment( + "
        <{$first_heading} first> then <{$second_heading} second> and end
        " + ); + + while ( $processor->next_tag() && null === $processor->get_attribute( 'second' ) ) { + continue; + } + + $this->assertTrue( + $processor->get_attribute( 'second' ), + "Failed to find expected {$second_heading} tag." + ); + + $this->assertSame( + array( 'HTML', 'BODY', 'DIV', $second_heading ), + $processor->get_breadcrumbs(), + "Expected {$second_heading} to be a direct child of the DIV, having closed the open {$first_heading} element." + ); + + $processor->next_tag( 'IMG' ); + $this->assertSame( + array( 'HTML', 'BODY', 'DIV', 'IMG' ), + $processor->get_breadcrumbs(), + "Expected IMG to be a direct child of DIV, having closed the open {$first_heading} element." + ); + } + + /** + * Data provider. + * + * @return array[] + */ + public function data_heading_combinations() { + $headings = array( 'H1', 'H2', 'H3', 'H4', 'H5', 'H6' ); + + $combinations = array(); + + // Create all unique pairs of H1 - H6 elements. + foreach ( $headings as $first_tag ) { + foreach ( $headings as $second_tag ) { + $combinations[ "{$first_tag} then {$second_tag}" ] = array( $first_tag, $second_tag ); + } + } + + return $combinations; + } + /** * Verifies that when "in body" and encountering "any other end tag" * that the HTML processor ignores the end tag if there's a special diff --git a/tests/phpunit/tests/html-api/wpHtmlProcessorSemanticRulesListElements.php b/tests/phpunit/tests/html-api/wpHtmlProcessorSemanticRulesListElements.php new file mode 100644 index 0000000000000..0c7e3422f09fc --- /dev/null +++ b/tests/phpunit/tests/html-api/wpHtmlProcessorSemanticRulesListElements.php @@ -0,0 +1,431 @@ +
      • ' ); + + while ( + null === $processor->get_attribute( 'target' ) && + $processor->next_tag() + ) { + continue; + } + + $this->assertTrue( + $processor->get_attribute( 'target' ), + 'Failed to find target node.' + ); + + $this->assertSame( + array( 'HTML', 'BODY', 'LI' ), + $processor->get_breadcrumbs(), + "LI should have closed open LI, but didn't." + ); + } + + /** + * Ensures that an opening LI element implicitly closes other open elements with optional closing tags. + * + * @ticket 60215 + */ + public function test_in_body_li_generates_implied_end_tags_inside_open_li() { + $processor = WP_HTML_Processor::create_fragment( '
      • ' ); + + while ( + null === $processor->get_attribute( 'target' ) && + $processor->next_tag() + ) { + continue; + } + + $this->assertTrue( + $processor->get_attribute( 'target' ), + 'Failed to find target node.' + ); + + $this->assertSame( + array( 'HTML', 'BODY', 'LI' ), + $processor->get_breadcrumbs(), + "LI should have closed open LI, but didn't." + ); + } + + /** + * Ensures that when closing tags with optional tag closers, an opening LI tag doesn't close beyond a special boundary. + * + * @ticket 60215 + */ + public function test_in_body_li_generates_implied_end_tags_inside_open_li_but_stopping_at_special_tags() { + $processor = WP_HTML_Processor::create_fragment( '
      • ' ); + + while ( + null === $processor->get_attribute( 'target' ) && + $processor->next_tag() + ) { + continue; + } + + $this->assertTrue( + $processor->get_attribute( 'target' ), + 'Failed to find target node.' + ); + + $this->assertSame( + array( 'HTML', 'BODY', 'LI', 'BLOCKQUOTE', 'LI' ), + $processor->get_breadcrumbs(), + 'LI should have left the BLOCKQOUTE open, but closed it.' + ); + } + + /** + * Ensures that an opening LI closes an open P in button scope. + * + * @ticket 60215 + */ + public function test_in_body_li_in_li_closes_p_in_button_scope() { + $processor = WP_HTML_Processor::create_fragment( '