diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000000000..5034a3299ac90 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,7 @@ +/src/wp-includes/assets/script-loader-packages.php -text binary diff=generated +/src/wp-includes/assets/script-modules-packages.php -text binary diff=generated +/src/wp-includes/assets/script-loader-packages.min.php -text binary diff=generated +/src/wp-includes/assets/script-modules-packages.min.php -text binary diff=generated +/src/wp-includes/icons/** -text binary diff=generated +/src/wp-includes/blocks/*/view.asset.php -text binary diff=generated +/src/wp-includes/blocks/*/view.min.asset.php -text binary diff=generated diff --git a/.github/workflows/reusable-coding-standards-javascript.yml b/.github/workflows/reusable-coding-standards-javascript.yml index 5ad9212e7e58d..3fb98c0f64106 100644 --- a/.github/workflows/reusable-coding-standards-javascript.yml +++ b/.github/workflows/reusable-coding-standards-javascript.yml @@ -58,4 +58,4 @@ jobs: run: npm run grunt jshint - name: Ensure version-controlled files are not modified or deleted - run: git diff --exit-code + run: npm run diff:non-generated diff --git a/.github/workflows/reusable-coding-standards-php.yml b/.github/workflows/reusable-coding-standards-php.yml index 59aacd51d1d44..12f77cb44e5b0 100644 --- a/.github/workflows/reusable-coding-standards-php.yml +++ b/.github/workflows/reusable-coding-standards-php.yml @@ -105,4 +105,4 @@ jobs: run: phpcbf - name: Ensure version-controlled files are not modified during the tests - run: git diff --exit-code + run: npm run diff:non-generated diff --git a/.github/workflows/reusable-end-to-end-tests.yml b/.github/workflows/reusable-end-to-end-tests.yml index 4c8f2214890ec..903ed823e1e4c 100644 --- a/.github/workflows/reusable-end-to-end-tests.yml +++ b/.github/workflows/reusable-end-to-end-tests.yml @@ -154,4 +154,4 @@ jobs: include-hidden-files: true - name: Ensure version-controlled files are not modified or deleted - run: git diff --exit-code + run: npm run diff:non-generated diff --git a/.github/workflows/reusable-javascript-tests.yml b/.github/workflows/reusable-javascript-tests.yml index 0b6d28e44a93b..6b5b498df724a 100644 --- a/.github/workflows/reusable-javascript-tests.yml +++ b/.github/workflows/reusable-javascript-tests.yml @@ -68,4 +68,4 @@ jobs: run: npm run grunt qunit:compiled - name: Ensure version-controlled files are not modified or deleted - run: git diff --exit-code + run: npm run diff:non-generated diff --git a/.github/workflows/reusable-performance-test-v2.yml b/.github/workflows/reusable-performance-test-v2.yml index cd9e27b38e74f..2ac8cff60dd48 100644 --- a/.github/workflows/reusable-performance-test-v2.yml +++ b/.github/workflows/reusable-performance-test-v2.yml @@ -264,4 +264,5 @@ jobs: include-hidden-files: true - name: Ensure version-controlled files are not modified or deleted - run: git diff --exit-code + run: npm run diff:non-generated + diff --git a/.github/workflows/reusable-performance.yml b/.github/workflows/reusable-performance.yml index b2c851659ab4c..5f73000560441 100644 --- a/.github/workflows/reusable-performance.yml +++ b/.github/workflows/reusable-performance.yml @@ -354,4 +354,4 @@ jobs: node ./tests/performance/log-results.js "$CODEVITALS_PROJECT_TOKEN" trunk "$GITHUB_SHA" "$BASE_SHA" "$COMMITTED_AT" "$HOST_NAME" - name: Ensure version-controlled files are not modified or deleted - run: git diff --exit-code + run: npm run diff:non-generated diff --git a/.github/workflows/reusable-php-compatibility.yml b/.github/workflows/reusable-php-compatibility.yml index 9bec4260c184a..763695076193c 100644 --- a/.github/workflows/reusable-php-compatibility.yml +++ b/.github/workflows/reusable-php-compatibility.yml @@ -87,4 +87,4 @@ jobs: run: cs2pr ./.cache/phpcs-compat-report.xml - name: Ensure version-controlled files are not modified or deleted - run: git diff --exit-code + run: npm run diff:non-generated diff --git a/.github/workflows/reusable-phpstan-static-analysis.yml b/.github/workflows/reusable-phpstan-static-analysis.yml index 879c3e5657bc4..f1c00cd4db64d 100644 --- a/.github/workflows/reusable-phpstan-static-analysis.yml +++ b/.github/workflows/reusable-phpstan-static-analysis.yml @@ -106,4 +106,4 @@ jobs: key: "phpstan-result-cache-${{ github.run_id }}" - name: Ensure version-controlled files are not modified or deleted - run: git diff --exit-code + run: npm run diff:non-generated diff --git a/.github/workflows/reusable-phpunit-tests-v2.yml b/.github/workflows/reusable-phpunit-tests-v2.yml index 523db98096d1d..43341d22fdb94 100644 --- a/.github/workflows/reusable-phpunit-tests-v2.yml +++ b/.github/workflows/reusable-phpunit-tests-v2.yml @@ -209,4 +209,4 @@ jobs: run: LOCAL_PHP_XDEBUG=true npm run "test:${PHPUNIT_SCRIPT}" -- -v --group xdebug --exclude-group __fakegroup__ - name: Ensure version-controlled files are not modified or deleted - run: git diff --exit-code + run: npm run diff:non-generated diff --git a/.github/workflows/reusable-phpunit-tests-v3.yml b/.github/workflows/reusable-phpunit-tests-v3.yml index 45198c20f5e52..7d9a4f650eebe 100644 --- a/.github/workflows/reusable-phpunit-tests-v3.yml +++ b/.github/workflows/reusable-phpunit-tests-v3.yml @@ -253,7 +253,7 @@ jobs: overwrite: true - name: Ensure version-controlled files are not modified or deleted - run: git diff --exit-code + run: npm run diff:non-generated - name: Checkout the WordPress Test Reporter if: ${{ github.ref == 'refs/heads/trunk' && inputs.report }} diff --git a/.github/workflows/reusable-test-core-build-process.yml b/.github/workflows/reusable-test-core-build-process.yml index 4bec59e285c57..6220bd47f53d1 100644 --- a/.github/workflows/reusable-test-core-build-process.yml +++ b/.github/workflows/reusable-test-core-build-process.yml @@ -120,7 +120,7 @@ jobs: run: npm run ${{ inputs.directory == 'src' && 'build:dev' || 'build' }} - name: Ensure version-controlled files are not modified or deleted during building - run: git diff --exit-code + run: npm run diff:non-generated - name: Create ZIP of built files if: ${{ inputs.directory == 'build' && contains( inputs.os, 'ubuntu-' ) }} @@ -130,7 +130,7 @@ jobs: run: npm run grunt ${{ inputs.directory == 'src' && 'clean -- --dev' || 'clean' }} - name: Ensure version-controlled files are not modified or deleted during cleaning - run: git diff --exit-code + run: npm run diff:non-generated - name: Upload ZIP as a GitHub Actions artifact uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 diff --git a/.github/workflows/reusable-test-gutenberg-build-process.yml b/.github/workflows/reusable-test-gutenberg-build-process.yml index c0fa87aa3ab20..f30113e18e1ad 100644 --- a/.github/workflows/reusable-test-gutenberg-build-process.yml +++ b/.github/workflows/reusable-test-gutenberg-build-process.yml @@ -97,4 +97,4 @@ jobs: working-directory: ${{ env.GUTENBERG_DIRECTORY }} - name: Ensure version-controlled files are not modified or deleted during building - run: git diff --exit-code + run: npm run diff:non-generated diff --git a/.github/workflows/reusable-test-local-docker-environment-v1.yml b/.github/workflows/reusable-test-local-docker-environment-v1.yml index 698956ff00346..ffa862d2c3158 100644 --- a/.github/workflows/reusable-test-local-docker-environment-v1.yml +++ b/.github/workflows/reusable-test-local-docker-environment-v1.yml @@ -167,4 +167,4 @@ jobs: run: npm run env:reset - name: Ensure version-controlled files are not modified or deleted - run: git diff --exit-code + run: npm run diff:non-generated diff --git a/.github/workflows/test-and-zip-default-themes.yml b/.github/workflows/test-and-zip-default-themes.yml index 5af965af0907a..01296274d8702 100644 --- a/.github/workflows/test-and-zip-default-themes.yml +++ b/.github/workflows/test-and-zip-default-themes.yml @@ -183,7 +183,7 @@ jobs: path: src/wp-content/themes/${{ matrix.theme }}/changes.diff - name: Ensure version-controlled files are not modified or deleted - run: git diff --exit-code + run: npm run diff:non-generated # Prepares bundled themes for release. # diff --git a/.gitignore b/.gitignore index 1cd9da16b3ed0..0439f304e1b5d 100644 --- a/.gitignore +++ b/.gitignore @@ -32,15 +32,18 @@ wp-tests-config.php /src/wp-admin/css/colors/*/*.css /src/wp-admin/js /src/wp-includes/assets/* +!/src/wp-includes/assets/script-loader-packages.php +!/src/wp-includes/assets/script-modules-packages.php +!/src/wp-includes/assets/script-loader-packages.min.php +!/src/wp-includes/assets/script-modules-packages.min.php /src/wp-includes/js /src/wp-includes/css/dist /src/wp-includes/css/*.min.css /src/wp-includes/css/*-rtl.css -/src/wp-includes/blocks/* -!/src/wp-includes/blocks/index.php -/src/wp-includes/icons +/src/wp-includes/blocks/**/*.css +/src/wp-includes/blocks/**/*.js +/src/wp-includes/blocks/**/*.js.map /src/wp-includes/build -/src/wp-includes/theme.json /packagehash.txt /.gutenberg-hash /artifacts diff --git a/package.json b/package.json index 745ec98ab6b58..03cebaca666cd 100644 --- a/package.json +++ b/package.json @@ -110,6 +110,7 @@ "build": "grunt build", "build:dev": "grunt build --dev", "dev": "grunt watch --dev", + "diff:non-generated": "sh ./tools/diff-non-generated.sh", "test": "grunt test", "watch": "grunt watch", "grunt": "grunt", @@ -139,4 +140,4 @@ "sync-gutenberg-packages": "grunt sync-gutenberg-packages", "postsync-gutenberg-packages": "grunt wp-packages:sync-stable-blocks && grunt build --dev && grunt build" } -} \ No newline at end of file +} diff --git a/src/wp-includes/assets/script-loader-packages.min.php b/src/wp-includes/assets/script-loader-packages.min.php new file mode 100644 index 0000000000000..1fac04f534e7a --- /dev/null +++ b/src/wp-includes/assets/script-loader-packages.min.php @@ -0,0 +1,896 @@ + array( + 'dependencies' => array( + 'wp-dom-ready', + 'wp-i18n' + ), + 'version' => 'af934e5259bc51b8718e' + ), + 'annotations.min.js' => array( + 'dependencies' => array( + 'wp-data', + 'wp-hooks', + 'wp-i18n', + 'wp-rich-text' + ), + 'version' => '4b07d06c67c3b5ea590c' + ), + 'api-fetch.min.js' => array( + 'dependencies' => array( + 'wp-i18n', + 'wp-url' + ), + 'version' => 'd7efe4dc1468d36c39b8' + ), + 'autop.min.js' => array( + 'dependencies' => array( + + ), + 'version' => '9d0d0901b46f0a9027c9' + ), + 'base-styles.min.js' => array( + 'dependencies' => array( + + ), + 'version' => '8ebe97b095beb7e9279b' + ), + 'blob.min.js' => array( + 'dependencies' => array( + + ), + 'version' => '198af75fe06d924090d8' + ), + 'block-directory.min.js' => array( + 'dependencies' => array( + 'react-jsx-runtime', + '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-primitives', + 'wp-url' + ), + 'version' => '17c7b74296ea735c0361' + ), + 'block-editor.min.js' => array( + 'dependencies' => array( + 'react', + 'react-dom', + 'react-jsx-runtime', + 'wp-a11y', + 'wp-api-fetch', + 'wp-blob', + 'wp-block-serialization-default-parser', + '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-preferences', + 'wp-primitives', + 'wp-priority-queue', + 'wp-private-apis', + 'wp-rich-text', + 'wp-style-engine', + 'wp-theme', + 'wp-token-list', + 'wp-upload-media', + 'wp-url', + 'wp-warning' + ), + 'version' => 'ac99dc4813ce9ba62863' + ), + 'block-library.min.js' => array( + 'dependencies' => array( + 'react', + 'react-jsx-runtime', + '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-keyboard-shortcuts', + 'wp-keycodes', + 'wp-notices', + 'wp-patterns', + 'wp-primitives', + 'wp-private-apis', + 'wp-rich-text', + 'wp-server-side-render', + 'wp-upload-media', + 'wp-url', + 'wp-wordcount' + ), + 'module_dependencies' => array( + array( + 'id' => '@wordpress/latex-to-mathml', + 'import' => 'dynamic' + ) + ), + 'version' => '28f00a6393f97214aa04' + ), + 'block-serialization-default-parser.min.js' => array( + 'dependencies' => array( + + ), + 'version' => 'bff55bd3f1ce9df0c99c' + ), + 'block-serialization-spec-parser.min.js' => array( + 'dependencies' => array( + + ), + 'version' => '9ebc5e95e1de1cabd1e6' + ), + 'blocks.min.js' => array( + 'dependencies' => array( + 'react-jsx-runtime', + 'wp-autop', + 'wp-blob', + 'wp-block-serialization-default-parser', + 'wp-data', + 'wp-deprecated', + 'wp-dom', + 'wp-element', + 'wp-hooks', + 'wp-html-entities', + 'wp-i18n', + 'wp-is-shallow-equal', + 'wp-private-apis', + 'wp-rich-text', + 'wp-shortcode', + 'wp-warning' + ), + 'version' => '043731fad526d26793c6' + ), + 'commands.min.js' => array( + 'dependencies' => array( + 'react', + 'react-dom', + 'react-jsx-runtime', + 'wp-components', + 'wp-data', + 'wp-element', + 'wp-i18n', + 'wp-keyboard-shortcuts', + 'wp-primitives', + 'wp-private-apis' + ), + 'version' => 'e3d8bba53f4ffea4fcd2' + ), + 'components.min.js' => array( + 'dependencies' => array( + 'react', + 'react-dom', + 'react-jsx-runtime', + '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-primitives', + 'wp-private-apis', + 'wp-rich-text', + 'wp-warning' + ), + 'version' => '498bf90967fccacc8857' + ), + 'compose.min.js' => array( + 'dependencies' => array( + 'react', + 'react-jsx-runtime', + 'wp-deprecated', + 'wp-dom', + 'wp-element', + 'wp-is-shallow-equal', + 'wp-keycodes', + 'wp-priority-queue', + 'wp-undo-manager' + ), + 'version' => '42e10ac07bc50b2c5314' + ), + 'core-commands.min.js' => array( + 'dependencies' => array( + 'react-jsx-runtime', + 'wp-commands', + 'wp-compose', + 'wp-core-data', + 'wp-data', + 'wp-element', + 'wp-html-entities', + 'wp-i18n', + 'wp-primitives', + 'wp-private-apis', + 'wp-router', + 'wp-url' + ), + 'version' => 'b209152e7e51279d7c28' + ), + 'core-data.min.js' => array( + 'dependencies' => array( + 'react-jsx-runtime', + 'wp-api-fetch', + 'wp-block-editor', + 'wp-blocks', + 'wp-compose', + 'wp-data', + 'wp-deprecated', + 'wp-element', + 'wp-html-entities', + 'wp-i18n', + 'wp-private-apis', + 'wp-rich-text', + 'wp-sync', + 'wp-undo-manager', + 'wp-url', + 'wp-warning' + ), + 'version' => '553521bc03a0cb8c2fb5' + ), + 'customize-widgets.min.js' => array( + 'dependencies' => array( + 'react-jsx-runtime', + 'wp-block-editor', + 'wp-block-library', + 'wp-blocks', + 'wp-components', + 'wp-compose', + 'wp-core-data', + 'wp-data', + 'wp-dom', + 'wp-element', + 'wp-hooks', + 'wp-i18n', + 'wp-is-shallow-equal', + 'wp-keyboard-shortcuts', + 'wp-keycodes', + 'wp-media-utils', + 'wp-preferences', + 'wp-primitives', + 'wp-private-apis', + 'wp-widgets' + ), + 'version' => '524dc7a4326b77064831' + ), + 'data.min.js' => array( + 'dependencies' => array( + 'react-jsx-runtime', + 'wp-compose', + 'wp-deprecated', + 'wp-element', + 'wp-is-shallow-equal', + 'wp-priority-queue', + 'wp-private-apis', + 'wp-redux-routine' + ), + 'version' => 'dc7feb6ad8da53887680' + ), + 'data-controls.min.js' => array( + 'dependencies' => array( + 'wp-api-fetch', + 'wp-data', + 'wp-deprecated' + ), + 'version' => '730061ade69d7f341014' + ), + 'date.min.js' => array( + 'dependencies' => array( + 'moment', + 'wp-deprecated' + ), + 'version' => 'c9f8e7dd3232716f34e9' + ), + 'deprecated.min.js' => array( + 'dependencies' => array( + 'wp-hooks' + ), + 'version' => '990e85f234fee8f7d446' + ), + 'dom.min.js' => array( + 'dependencies' => array( + 'wp-deprecated' + ), + 'version' => 'aac39fc255d02334a74e' + ), + 'dom-ready.min.js' => array( + 'dependencies' => array( + + ), + 'version' => 'a06281ae5cf5500e9317' + ), + 'edit-post.min.js' => array( + 'dependencies' => array( + 'media-models', + 'media-views', + 'postbox', + 'react-jsx-runtime', + 'wp-api-fetch', + 'wp-block-editor', + 'wp-block-library', + 'wp-blocks', + 'wp-commands', + 'wp-components', + 'wp-compose', + 'wp-core-data', + 'wp-data', + 'wp-deprecated', + 'wp-editor', + 'wp-element', + 'wp-hooks', + 'wp-html-entities', + 'wp-i18n', + 'wp-keyboard-shortcuts', + 'wp-keycodes', + 'wp-notices', + 'wp-plugins', + 'wp-preferences', + 'wp-primitives', + 'wp-private-apis', + 'wp-style-engine', + 'wp-url', + 'wp-widgets' + ), + 'module_dependencies' => array( + array( + 'id' => '@wordpress/route', + 'import' => 'static' + ) + ), + 'version' => '1a6b82c9f517652a242b' + ), + 'edit-site.min.js' => array( + 'dependencies' => array( + 'react', + 'react-dom', + 'react-jsx-runtime', + 'wp-a11y', + 'wp-api-fetch', + 'wp-blob', + 'wp-block-editor', + 'wp-block-library', + 'wp-blocks', + 'wp-commands', + 'wp-components', + 'wp-compose', + 'wp-core-data', + 'wp-data', + 'wp-date', + 'wp-deprecated', + 'wp-dom', + 'wp-dom-ready', + 'wp-editor', + 'wp-element', + 'wp-html-entities', + 'wp-i18n', + 'wp-keyboard-shortcuts', + 'wp-keycodes', + 'wp-notices', + 'wp-patterns', + 'wp-plugins', + 'wp-preferences', + 'wp-primitives', + 'wp-private-apis', + 'wp-router', + 'wp-style-engine', + 'wp-theme', + 'wp-url', + 'wp-warning', + 'wp-widgets' + ), + 'module_dependencies' => array( + array( + 'id' => '@wordpress/route', + 'import' => 'static' + ) + ), + 'version' => '621fb808445b3c4c8b9e' + ), + 'edit-widgets.min.js' => array( + 'dependencies' => array( + 'react-jsx-runtime', + '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-preferences', + 'wp-primitives', + 'wp-private-apis', + 'wp-url', + 'wp-viewport', + 'wp-widgets' + ), + 'module_dependencies' => array( + array( + 'id' => '@wordpress/route', + 'import' => 'static' + ) + ), + 'version' => 'be944f745795910dc41a' + ), + 'editor.min.js' => array( + 'dependencies' => array( + 'react', + 'react-dom', + 'react-jsx-runtime', + 'wp-a11y', + 'wp-api-fetch', + 'wp-blob', + 'wp-block-editor', + 'wp-block-serialization-default-parser', + 'wp-blocks', + 'wp-commands', + '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-plugins', + 'wp-preferences', + 'wp-primitives', + 'wp-private-apis', + 'wp-rich-text', + 'wp-server-side-render', + 'wp-style-engine', + 'wp-theme', + 'wp-upload-media', + 'wp-url', + 'wp-viewport', + 'wp-warning', + 'wp-wordcount' + ), + 'module_dependencies' => array( + array( + 'id' => '@wordpress/route', + 'import' => 'static' + ) + ), + 'version' => '9d4db71493e63db7e654' + ), + 'element.min.js' => array( + 'dependencies' => array( + 'react', + 'react-dom', + 'wp-escape-html' + ), + 'version' => '15ba804677f72a8db97b' + ), + 'escape-html.min.js' => array( + 'dependencies' => array( + + ), + 'version' => '3f093e5cca67aa0f8b56' + ), + 'format-library.min.js' => array( + 'dependencies' => array( + 'react-jsx-runtime', + 'wp-a11y', + 'wp-block-editor', + 'wp-components', + 'wp-compose', + 'wp-data', + 'wp-element', + 'wp-html-entities', + 'wp-i18n', + 'wp-primitives', + 'wp-private-apis', + 'wp-rich-text', + 'wp-url' + ), + 'module_dependencies' => array( + array( + 'id' => '@wordpress/latex-to-mathml', + 'import' => 'dynamic' + ) + ), + 'version' => 'f89be9586f2d9ce4545a' + ), + 'hooks.min.js' => array( + 'dependencies' => array( + + ), + 'version' => '7496969728ca0f95732d' + ), + 'html-entities.min.js' => array( + 'dependencies' => array( + + ), + 'version' => '8c6fa5b869dfeadc4af2' + ), + 'i18n.min.js' => array( + 'dependencies' => array( + 'wp-hooks' + ), + 'version' => '781d11515ad3d91786ec' + ), + 'is-shallow-equal.min.js' => array( + 'dependencies' => array( + + ), + 'version' => '5d84b9f3cb50d2ce7d04' + ), + 'keyboard-shortcuts.min.js' => array( + 'dependencies' => array( + 'react-jsx-runtime', + 'wp-data', + 'wp-element', + 'wp-keycodes' + ), + 'version' => '2ed78d3b4c23f38804e0' + ), + 'keycodes.min.js' => array( + 'dependencies' => array( + 'wp-i18n' + ), + 'version' => 'aa1a141e3468afe7f852' + ), + 'list-reusable-blocks.min.js' => array( + 'dependencies' => array( + 'react-jsx-runtime', + 'wp-api-fetch', + 'wp-blob', + 'wp-components', + 'wp-compose', + 'wp-element', + 'wp-i18n' + ), + 'version' => '2e35ebd5dbaccb5a90c5' + ), + 'media-utils.min.js' => array( + 'dependencies' => array( + 'react', + 'react-dom', + 'react-jsx-runtime', + 'wp-a11y', + 'wp-api-fetch', + 'wp-blob', + 'wp-components', + 'wp-compose', + 'wp-core-data', + 'wp-data', + 'wp-date', + 'wp-deprecated', + 'wp-element', + 'wp-i18n', + 'wp-keycodes', + 'wp-notices', + 'wp-primitives', + 'wp-private-apis', + 'wp-theme', + 'wp-url', + 'wp-warning' + ), + 'version' => '5275f42a22469e56c419' + ), + 'notices.min.js' => array( + 'dependencies' => array( + 'react-jsx-runtime', + 'wp-components', + 'wp-data' + ), + 'version' => '1df43b4122aaf25134bb' + ), + 'nux.min.js' => array( + 'dependencies' => array( + 'react-jsx-runtime', + 'wp-components', + 'wp-compose', + 'wp-data', + 'wp-deprecated', + 'wp-element', + 'wp-i18n', + 'wp-primitives' + ), + 'version' => '14d2335a0007b36b9112' + ), + 'patterns.min.js' => array( + 'dependencies' => array( + 'react-jsx-runtime', + 'wp-a11y', + 'wp-block-editor', + 'wp-blocks', + 'wp-components', + 'wp-compose', + 'wp-core-data', + 'wp-data', + 'wp-element', + 'wp-html-entities', + 'wp-i18n', + 'wp-notices', + 'wp-primitives', + 'wp-private-apis', + 'wp-url' + ), + 'version' => '1fcfba2e7d83ba54735d' + ), + 'plugins.min.js' => array( + 'dependencies' => array( + 'react-jsx-runtime', + 'wp-compose', + 'wp-deprecated', + 'wp-element', + 'wp-hooks', + 'wp-is-shallow-equal', + 'wp-primitives' + ), + 'version' => 'b03040c408cd5bcc9f89' + ), + 'preferences.min.js' => array( + 'dependencies' => array( + 'react-jsx-runtime', + 'wp-a11y', + 'wp-components', + 'wp-compose', + 'wp-data', + 'wp-deprecated', + 'wp-element', + 'wp-i18n', + 'wp-preferences-persistence', + 'wp-primitives', + 'wp-private-apis' + ), + 'version' => 'd3f26a2b3620d15a60a3' + ), + 'preferences-persistence.min.js' => array( + 'dependencies' => array( + 'wp-api-fetch' + ), + 'version' => 'e8033be98338d1861bca' + ), + 'primitives.min.js' => array( + 'dependencies' => array( + 'react-jsx-runtime', + 'wp-element' + ), + 'version' => 'a5c905ec27bcd76ef287' + ), + 'priority-queue.min.js' => array( + 'dependencies' => array( + + ), + 'version' => '1f0e89e247bc0bd3f9b9' + ), + 'private-apis.min.js' => array( + 'dependencies' => array( + + ), + 'version' => '5f0ec184488dba9baabb' + ), + 'react-i18n.min.js' => array( + 'dependencies' => array( + 'react-jsx-runtime', + 'wp-element', + 'wp-i18n' + ), + 'version' => '9b74577dbd7e50f6b77b' + ), + 'redux-routine.min.js' => array( + 'dependencies' => array( + + ), + 'version' => '64f9f5001aabc046c605' + ), + 'reusable-blocks.min.js' => array( + 'dependencies' => array( + 'react-jsx-runtime', + 'wp-block-editor', + 'wp-blocks', + 'wp-components', + 'wp-core-data', + 'wp-data', + 'wp-element', + 'wp-i18n', + 'wp-notices', + 'wp-primitives', + 'wp-url' + ), + 'version' => 'c72d27a8ac4e33cb74d6' + ), + 'rich-text.min.js' => array( + 'dependencies' => array( + 'wp-a11y', + 'wp-compose', + 'wp-data', + 'wp-deprecated', + 'wp-dom', + 'wp-element', + 'wp-escape-html', + 'wp-i18n', + 'wp-keycodes', + 'wp-private-apis' + ), + 'version' => '9d9d9b99a28b17452d87' + ), + 'router.min.js' => array( + 'dependencies' => array( + 'react-jsx-runtime', + 'wp-compose', + 'wp-element', + 'wp-private-apis', + 'wp-url' + ), + 'version' => '0249e6724784b1c2583b' + ), + 'server-side-render.min.js' => array( + 'dependencies' => array( + 'react-jsx-runtime', + 'wp-api-fetch', + 'wp-blocks', + 'wp-components', + 'wp-compose', + 'wp-data', + 'wp-element', + 'wp-i18n', + 'wp-url' + ), + 'version' => '10a51bf05ced35b78092' + ), + 'shortcode.min.js' => array( + 'dependencies' => array( + + ), + 'version' => '11742fe18cc215d3d5ab' + ), + 'style-engine.min.js' => array( + 'dependencies' => array( + + ), + 'version' => 'faa37ce61b7ec8394b2a' + ), + 'sync.min.js' => array( + 'dependencies' => array( + 'wp-api-fetch', + 'wp-hooks', + 'wp-private-apis' + ), + 'version' => '345bb2a88a140f25cd55' + ), + 'theme.min.js' => array( + 'dependencies' => array( + 'react-jsx-runtime', + 'wp-element', + 'wp-private-apis' + ), + 'version' => '63db44adf5194c9389bf' + ), + 'token-list.min.js' => array( + 'dependencies' => array( + + ), + 'version' => '16f0aebdd39d87c2a84b' + ), + 'undo-manager.min.js' => array( + 'dependencies' => array( + 'wp-is-shallow-equal' + ), + 'version' => '27bb0ae036a2c9d4a1b5' + ), + 'upload-media.min.js' => array( + 'dependencies' => array( + 'react-jsx-runtime', + 'wp-blob', + 'wp-compose', + 'wp-data', + 'wp-element', + 'wp-i18n', + 'wp-private-apis', + 'wp-url' + ), + 'module_dependencies' => array( + array( + 'id' => '@wordpress/vips/worker', + 'import' => 'dynamic' + ) + ), + 'version' => '012bdf4e5d634c0e3e01' + ), + 'url.min.js' => array( + 'dependencies' => array( + + ), + 'version' => 'bb0f766c3d2efe497871' + ), + 'viewport.min.js' => array( + 'dependencies' => array( + 'react-jsx-runtime', + 'wp-compose', + 'wp-data' + ), + 'version' => '8614025b8075d220d78f' + ), + 'warning.min.js' => array( + 'dependencies' => array( + + ), + 'version' => '36fdbdc984d93aee8a97' + ), + 'widgets.min.js' => array( + 'dependencies' => array( + 'react-jsx-runtime', + 'wp-api-fetch', + 'wp-block-editor', + 'wp-blocks', + 'wp-components', + 'wp-compose', + 'wp-core-data', + 'wp-data', + 'wp-element', + 'wp-i18n', + 'wp-notices', + 'wp-primitives' + ), + 'version' => '7064da49d4dd3848ba8a' + ), + 'wordcount.min.js' => array( + 'dependencies' => array( + + ), + 'version' => '3b928d5db8724a8614dd' + ) +); \ No newline at end of file diff --git a/src/wp-includes/assets/script-loader-packages.php b/src/wp-includes/assets/script-loader-packages.php new file mode 100644 index 0000000000000..916e24cf98fa8 --- /dev/null +++ b/src/wp-includes/assets/script-loader-packages.php @@ -0,0 +1,896 @@ + array( + 'dependencies' => array( + 'wp-dom-ready', + 'wp-i18n' + ), + 'version' => 'af934e5259bc51b8718e' + ), + 'annotations.js' => array( + 'dependencies' => array( + 'wp-data', + 'wp-hooks', + 'wp-i18n', + 'wp-rich-text' + ), + 'version' => '4b07d06c67c3b5ea590c' + ), + 'api-fetch.js' => array( + 'dependencies' => array( + 'wp-i18n', + 'wp-url' + ), + 'version' => 'd7efe4dc1468d36c39b8' + ), + 'autop.js' => array( + 'dependencies' => array( + + ), + 'version' => '9d0d0901b46f0a9027c9' + ), + 'base-styles.js' => array( + 'dependencies' => array( + + ), + 'version' => '8ebe97b095beb7e9279b' + ), + 'blob.js' => array( + 'dependencies' => array( + + ), + 'version' => '198af75fe06d924090d8' + ), + 'block-directory.js' => array( + 'dependencies' => array( + 'react-jsx-runtime', + '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-primitives', + 'wp-url' + ), + 'version' => '17c7b74296ea735c0361' + ), + 'block-editor.js' => array( + 'dependencies' => array( + 'react', + 'react-dom', + 'react-jsx-runtime', + 'wp-a11y', + 'wp-api-fetch', + 'wp-blob', + 'wp-block-serialization-default-parser', + '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-preferences', + 'wp-primitives', + 'wp-priority-queue', + 'wp-private-apis', + 'wp-rich-text', + 'wp-style-engine', + 'wp-theme', + 'wp-token-list', + 'wp-upload-media', + 'wp-url', + 'wp-warning' + ), + 'version' => 'ac99dc4813ce9ba62863' + ), + 'block-library.js' => array( + 'dependencies' => array( + 'react', + 'react-jsx-runtime', + '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-keyboard-shortcuts', + 'wp-keycodes', + 'wp-notices', + 'wp-patterns', + 'wp-primitives', + 'wp-private-apis', + 'wp-rich-text', + 'wp-server-side-render', + 'wp-upload-media', + 'wp-url', + 'wp-wordcount' + ), + 'module_dependencies' => array( + array( + 'id' => '@wordpress/latex-to-mathml', + 'import' => 'dynamic' + ) + ), + 'version' => '28f00a6393f97214aa04' + ), + 'block-serialization-default-parser.js' => array( + 'dependencies' => array( + + ), + 'version' => 'bff55bd3f1ce9df0c99c' + ), + 'block-serialization-spec-parser.js' => array( + 'dependencies' => array( + + ), + 'version' => '9ebc5e95e1de1cabd1e6' + ), + 'blocks.js' => array( + 'dependencies' => array( + 'react-jsx-runtime', + 'wp-autop', + 'wp-blob', + 'wp-block-serialization-default-parser', + 'wp-data', + 'wp-deprecated', + 'wp-dom', + 'wp-element', + 'wp-hooks', + 'wp-html-entities', + 'wp-i18n', + 'wp-is-shallow-equal', + 'wp-private-apis', + 'wp-rich-text', + 'wp-shortcode', + 'wp-warning' + ), + 'version' => '043731fad526d26793c6' + ), + 'commands.js' => array( + 'dependencies' => array( + 'react', + 'react-dom', + 'react-jsx-runtime', + 'wp-components', + 'wp-data', + 'wp-element', + 'wp-i18n', + 'wp-keyboard-shortcuts', + 'wp-primitives', + 'wp-private-apis' + ), + 'version' => 'e3d8bba53f4ffea4fcd2' + ), + 'components.js' => array( + 'dependencies' => array( + 'react', + 'react-dom', + 'react-jsx-runtime', + '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-primitives', + 'wp-private-apis', + 'wp-rich-text', + 'wp-warning' + ), + 'version' => '498bf90967fccacc8857' + ), + 'compose.js' => array( + 'dependencies' => array( + 'react', + 'react-jsx-runtime', + 'wp-deprecated', + 'wp-dom', + 'wp-element', + 'wp-is-shallow-equal', + 'wp-keycodes', + 'wp-priority-queue', + 'wp-undo-manager' + ), + 'version' => '42e10ac07bc50b2c5314' + ), + 'core-commands.js' => array( + 'dependencies' => array( + 'react-jsx-runtime', + 'wp-commands', + 'wp-compose', + 'wp-core-data', + 'wp-data', + 'wp-element', + 'wp-html-entities', + 'wp-i18n', + 'wp-primitives', + 'wp-private-apis', + 'wp-router', + 'wp-url' + ), + 'version' => 'b209152e7e51279d7c28' + ), + 'core-data.js' => array( + 'dependencies' => array( + 'react-jsx-runtime', + 'wp-api-fetch', + 'wp-block-editor', + 'wp-blocks', + 'wp-compose', + 'wp-data', + 'wp-deprecated', + 'wp-element', + 'wp-html-entities', + 'wp-i18n', + 'wp-private-apis', + 'wp-rich-text', + 'wp-sync', + 'wp-undo-manager', + 'wp-url', + 'wp-warning' + ), + 'version' => '553521bc03a0cb8c2fb5' + ), + 'customize-widgets.js' => array( + 'dependencies' => array( + 'react-jsx-runtime', + 'wp-block-editor', + 'wp-block-library', + 'wp-blocks', + 'wp-components', + 'wp-compose', + 'wp-core-data', + 'wp-data', + 'wp-dom', + 'wp-element', + 'wp-hooks', + 'wp-i18n', + 'wp-is-shallow-equal', + 'wp-keyboard-shortcuts', + 'wp-keycodes', + 'wp-media-utils', + 'wp-preferences', + 'wp-primitives', + 'wp-private-apis', + 'wp-widgets' + ), + 'version' => '524dc7a4326b77064831' + ), + 'data.js' => array( + 'dependencies' => array( + 'react-jsx-runtime', + 'wp-compose', + 'wp-deprecated', + 'wp-element', + 'wp-is-shallow-equal', + 'wp-priority-queue', + 'wp-private-apis', + 'wp-redux-routine' + ), + 'version' => 'dc7feb6ad8da53887680' + ), + 'data-controls.js' => array( + 'dependencies' => array( + 'wp-api-fetch', + 'wp-data', + 'wp-deprecated' + ), + 'version' => '730061ade69d7f341014' + ), + 'date.js' => array( + 'dependencies' => array( + 'moment', + 'wp-deprecated' + ), + 'version' => 'c9f8e7dd3232716f34e9' + ), + 'deprecated.js' => array( + 'dependencies' => array( + 'wp-hooks' + ), + 'version' => '990e85f234fee8f7d446' + ), + 'dom.js' => array( + 'dependencies' => array( + 'wp-deprecated' + ), + 'version' => 'aac39fc255d02334a74e' + ), + 'dom-ready.js' => array( + 'dependencies' => array( + + ), + 'version' => 'a06281ae5cf5500e9317' + ), + 'edit-post.js' => array( + 'dependencies' => array( + 'media-models', + 'media-views', + 'postbox', + 'react-jsx-runtime', + 'wp-api-fetch', + 'wp-block-editor', + 'wp-block-library', + 'wp-blocks', + 'wp-commands', + 'wp-components', + 'wp-compose', + 'wp-core-data', + 'wp-data', + 'wp-deprecated', + 'wp-editor', + 'wp-element', + 'wp-hooks', + 'wp-html-entities', + 'wp-i18n', + 'wp-keyboard-shortcuts', + 'wp-keycodes', + 'wp-notices', + 'wp-plugins', + 'wp-preferences', + 'wp-primitives', + 'wp-private-apis', + 'wp-style-engine', + 'wp-url', + 'wp-widgets' + ), + 'module_dependencies' => array( + array( + 'id' => '@wordpress/route', + 'import' => 'static' + ) + ), + 'version' => '1a6b82c9f517652a242b' + ), + 'edit-site.js' => array( + 'dependencies' => array( + 'react', + 'react-dom', + 'react-jsx-runtime', + 'wp-a11y', + 'wp-api-fetch', + 'wp-blob', + 'wp-block-editor', + 'wp-block-library', + 'wp-blocks', + 'wp-commands', + 'wp-components', + 'wp-compose', + 'wp-core-data', + 'wp-data', + 'wp-date', + 'wp-deprecated', + 'wp-dom', + 'wp-dom-ready', + 'wp-editor', + 'wp-element', + 'wp-html-entities', + 'wp-i18n', + 'wp-keyboard-shortcuts', + 'wp-keycodes', + 'wp-notices', + 'wp-patterns', + 'wp-plugins', + 'wp-preferences', + 'wp-primitives', + 'wp-private-apis', + 'wp-router', + 'wp-style-engine', + 'wp-theme', + 'wp-url', + 'wp-warning', + 'wp-widgets' + ), + 'module_dependencies' => array( + array( + 'id' => '@wordpress/route', + 'import' => 'static' + ) + ), + 'version' => '621fb808445b3c4c8b9e' + ), + 'edit-widgets.js' => array( + 'dependencies' => array( + 'react-jsx-runtime', + '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-preferences', + 'wp-primitives', + 'wp-private-apis', + 'wp-url', + 'wp-viewport', + 'wp-widgets' + ), + 'module_dependencies' => array( + array( + 'id' => '@wordpress/route', + 'import' => 'static' + ) + ), + 'version' => 'be944f745795910dc41a' + ), + 'editor.js' => array( + 'dependencies' => array( + 'react', + 'react-dom', + 'react-jsx-runtime', + 'wp-a11y', + 'wp-api-fetch', + 'wp-blob', + 'wp-block-editor', + 'wp-block-serialization-default-parser', + 'wp-blocks', + 'wp-commands', + '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-plugins', + 'wp-preferences', + 'wp-primitives', + 'wp-private-apis', + 'wp-rich-text', + 'wp-server-side-render', + 'wp-style-engine', + 'wp-theme', + 'wp-upload-media', + 'wp-url', + 'wp-viewport', + 'wp-warning', + 'wp-wordcount' + ), + 'module_dependencies' => array( + array( + 'id' => '@wordpress/route', + 'import' => 'static' + ) + ), + 'version' => '9d4db71493e63db7e654' + ), + 'element.js' => array( + 'dependencies' => array( + 'react', + 'react-dom', + 'wp-escape-html' + ), + 'version' => '15ba804677f72a8db97b' + ), + 'escape-html.js' => array( + 'dependencies' => array( + + ), + 'version' => '3f093e5cca67aa0f8b56' + ), + 'format-library.js' => array( + 'dependencies' => array( + 'react-jsx-runtime', + 'wp-a11y', + 'wp-block-editor', + 'wp-components', + 'wp-compose', + 'wp-data', + 'wp-element', + 'wp-html-entities', + 'wp-i18n', + 'wp-primitives', + 'wp-private-apis', + 'wp-rich-text', + 'wp-url' + ), + 'module_dependencies' => array( + array( + 'id' => '@wordpress/latex-to-mathml', + 'import' => 'dynamic' + ) + ), + 'version' => 'f89be9586f2d9ce4545a' + ), + 'hooks.js' => array( + 'dependencies' => array( + + ), + 'version' => '7496969728ca0f95732d' + ), + 'html-entities.js' => array( + 'dependencies' => array( + + ), + 'version' => '8c6fa5b869dfeadc4af2' + ), + 'i18n.js' => array( + 'dependencies' => array( + 'wp-hooks' + ), + 'version' => '781d11515ad3d91786ec' + ), + 'is-shallow-equal.js' => array( + 'dependencies' => array( + + ), + 'version' => '5d84b9f3cb50d2ce7d04' + ), + 'keyboard-shortcuts.js' => array( + 'dependencies' => array( + 'react-jsx-runtime', + 'wp-data', + 'wp-element', + 'wp-keycodes' + ), + 'version' => '2ed78d3b4c23f38804e0' + ), + 'keycodes.js' => array( + 'dependencies' => array( + 'wp-i18n' + ), + 'version' => 'aa1a141e3468afe7f852' + ), + 'list-reusable-blocks.js' => array( + 'dependencies' => array( + 'react-jsx-runtime', + 'wp-api-fetch', + 'wp-blob', + 'wp-components', + 'wp-compose', + 'wp-element', + 'wp-i18n' + ), + 'version' => '2e35ebd5dbaccb5a90c5' + ), + 'media-utils.js' => array( + 'dependencies' => array( + 'react', + 'react-dom', + 'react-jsx-runtime', + 'wp-a11y', + 'wp-api-fetch', + 'wp-blob', + 'wp-components', + 'wp-compose', + 'wp-core-data', + 'wp-data', + 'wp-date', + 'wp-deprecated', + 'wp-element', + 'wp-i18n', + 'wp-keycodes', + 'wp-notices', + 'wp-primitives', + 'wp-private-apis', + 'wp-theme', + 'wp-url', + 'wp-warning' + ), + 'version' => '5275f42a22469e56c419' + ), + 'notices.js' => array( + 'dependencies' => array( + 'react-jsx-runtime', + 'wp-components', + 'wp-data' + ), + 'version' => '1df43b4122aaf25134bb' + ), + 'nux.js' => array( + 'dependencies' => array( + 'react-jsx-runtime', + 'wp-components', + 'wp-compose', + 'wp-data', + 'wp-deprecated', + 'wp-element', + 'wp-i18n', + 'wp-primitives' + ), + 'version' => '14d2335a0007b36b9112' + ), + 'patterns.js' => array( + 'dependencies' => array( + 'react-jsx-runtime', + 'wp-a11y', + 'wp-block-editor', + 'wp-blocks', + 'wp-components', + 'wp-compose', + 'wp-core-data', + 'wp-data', + 'wp-element', + 'wp-html-entities', + 'wp-i18n', + 'wp-notices', + 'wp-primitives', + 'wp-private-apis', + 'wp-url' + ), + 'version' => '1fcfba2e7d83ba54735d' + ), + 'plugins.js' => array( + 'dependencies' => array( + 'react-jsx-runtime', + 'wp-compose', + 'wp-deprecated', + 'wp-element', + 'wp-hooks', + 'wp-is-shallow-equal', + 'wp-primitives' + ), + 'version' => 'b03040c408cd5bcc9f89' + ), + 'preferences.js' => array( + 'dependencies' => array( + 'react-jsx-runtime', + 'wp-a11y', + 'wp-components', + 'wp-compose', + 'wp-data', + 'wp-deprecated', + 'wp-element', + 'wp-i18n', + 'wp-preferences-persistence', + 'wp-primitives', + 'wp-private-apis' + ), + 'version' => 'd3f26a2b3620d15a60a3' + ), + 'preferences-persistence.js' => array( + 'dependencies' => array( + 'wp-api-fetch' + ), + 'version' => 'e8033be98338d1861bca' + ), + 'primitives.js' => array( + 'dependencies' => array( + 'react-jsx-runtime', + 'wp-element' + ), + 'version' => 'a5c905ec27bcd76ef287' + ), + 'priority-queue.js' => array( + 'dependencies' => array( + + ), + 'version' => '1f0e89e247bc0bd3f9b9' + ), + 'private-apis.js' => array( + 'dependencies' => array( + + ), + 'version' => '5f0ec184488dba9baabb' + ), + 'react-i18n.js' => array( + 'dependencies' => array( + 'react-jsx-runtime', + 'wp-element', + 'wp-i18n' + ), + 'version' => '9b74577dbd7e50f6b77b' + ), + 'redux-routine.js' => array( + 'dependencies' => array( + + ), + 'version' => '64f9f5001aabc046c605' + ), + 'reusable-blocks.js' => array( + 'dependencies' => array( + 'react-jsx-runtime', + 'wp-block-editor', + 'wp-blocks', + 'wp-components', + 'wp-core-data', + 'wp-data', + 'wp-element', + 'wp-i18n', + 'wp-notices', + 'wp-primitives', + 'wp-url' + ), + 'version' => 'c72d27a8ac4e33cb74d6' + ), + 'rich-text.js' => array( + 'dependencies' => array( + 'wp-a11y', + 'wp-compose', + 'wp-data', + 'wp-deprecated', + 'wp-dom', + 'wp-element', + 'wp-escape-html', + 'wp-i18n', + 'wp-keycodes', + 'wp-private-apis' + ), + 'version' => '9d9d9b99a28b17452d87' + ), + 'router.js' => array( + 'dependencies' => array( + 'react-jsx-runtime', + 'wp-compose', + 'wp-element', + 'wp-private-apis', + 'wp-url' + ), + 'version' => '0249e6724784b1c2583b' + ), + 'server-side-render.js' => array( + 'dependencies' => array( + 'react-jsx-runtime', + 'wp-api-fetch', + 'wp-blocks', + 'wp-components', + 'wp-compose', + 'wp-data', + 'wp-element', + 'wp-i18n', + 'wp-url' + ), + 'version' => '10a51bf05ced35b78092' + ), + 'shortcode.js' => array( + 'dependencies' => array( + + ), + 'version' => '11742fe18cc215d3d5ab' + ), + 'style-engine.js' => array( + 'dependencies' => array( + + ), + 'version' => 'faa37ce61b7ec8394b2a' + ), + 'sync.js' => array( + 'dependencies' => array( + 'wp-api-fetch', + 'wp-hooks', + 'wp-private-apis' + ), + 'version' => '345bb2a88a140f25cd55' + ), + 'theme.js' => array( + 'dependencies' => array( + 'react-jsx-runtime', + 'wp-element', + 'wp-private-apis' + ), + 'version' => '63db44adf5194c9389bf' + ), + 'token-list.js' => array( + 'dependencies' => array( + + ), + 'version' => '16f0aebdd39d87c2a84b' + ), + 'undo-manager.js' => array( + 'dependencies' => array( + 'wp-is-shallow-equal' + ), + 'version' => '27bb0ae036a2c9d4a1b5' + ), + 'upload-media.js' => array( + 'dependencies' => array( + 'react-jsx-runtime', + 'wp-blob', + 'wp-compose', + 'wp-data', + 'wp-element', + 'wp-i18n', + 'wp-private-apis', + 'wp-url' + ), + 'module_dependencies' => array( + array( + 'id' => '@wordpress/vips/worker', + 'import' => 'dynamic' + ) + ), + 'version' => '012bdf4e5d634c0e3e01' + ), + 'url.js' => array( + 'dependencies' => array( + + ), + 'version' => 'bb0f766c3d2efe497871' + ), + 'viewport.js' => array( + 'dependencies' => array( + 'react-jsx-runtime', + 'wp-compose', + 'wp-data' + ), + 'version' => '8614025b8075d220d78f' + ), + 'warning.js' => array( + 'dependencies' => array( + + ), + 'version' => '36fdbdc984d93aee8a97' + ), + 'widgets.js' => array( + 'dependencies' => array( + 'react-jsx-runtime', + 'wp-api-fetch', + 'wp-block-editor', + 'wp-blocks', + 'wp-components', + 'wp-compose', + 'wp-core-data', + 'wp-data', + 'wp-element', + 'wp-i18n', + 'wp-notices', + 'wp-primitives' + ), + 'version' => '7064da49d4dd3848ba8a' + ), + 'wordcount.js' => array( + 'dependencies' => array( + + ), + 'version' => '3b928d5db8724a8614dd' + ) +); \ No newline at end of file diff --git a/src/wp-includes/assets/script-modules-packages.min.php b/src/wp-includes/assets/script-modules-packages.min.php new file mode 100644 index 0000000000000..ee92a8fae5e06 --- /dev/null +++ b/src/wp-includes/assets/script-modules-packages.min.php @@ -0,0 +1,313 @@ + array( + 'dependencies' => array( + + ), + 'version' => '1c371cb517a97cdbcb9f' + ), + 'abilities/index.min.js' => array( + 'dependencies' => array( + 'wp-data', + 'wp-i18n' + ), + 'version' => 'f3475bc77a30dcc5b38d' + ), + 'block-editor/utils/fit-text-frontend.min.js' => array( + 'dependencies' => array( + + ), + 'module_dependencies' => array( + array( + 'id' => '@wordpress/interactivity', + 'import' => 'static' + ) + ), + 'version' => '383c7a8bd24a1f2fd9b9' + ), + 'block-library/accordion/view.min.js' => array( + 'dependencies' => array( + + ), + 'module_dependencies' => array( + array( + 'id' => '@wordpress/interactivity', + 'import' => 'static' + ) + ), + 'version' => '2af01b43d30739c3fb8d' + ), + 'block-library/file/view.min.js' => array( + 'dependencies' => array( + + ), + 'module_dependencies' => array( + array( + 'id' => '@wordpress/interactivity', + 'import' => 'static' + ) + ), + 'version' => '7d4d261d10dca47ebecb' + ), + 'block-library/form/view.min.js' => array( + 'dependencies' => array( + + ), + 'version' => '5542f8ad251fe43ef09e' + ), + 'block-library/image/view.min.js' => array( + 'dependencies' => array( + + ), + 'module_dependencies' => array( + array( + 'id' => '@wordpress/interactivity', + 'import' => 'static' + ) + ), + 'version' => '25ee935fd6c67371d0f3' + ), + 'block-library/navigation/view.min.js' => array( + 'dependencies' => array( + + ), + 'module_dependencies' => array( + array( + 'id' => '@wordpress/interactivity', + 'import' => 'static' + ) + ), + 'version' => '243a659f91c3dc9841c7' + ), + 'block-library/playlist/view.min.js' => array( + 'dependencies' => array( + + ), + 'module_dependencies' => array( + array( + 'id' => '@wordpress/interactivity', + 'import' => 'static' + ) + ), + 'version' => '99f747d731f80246db11' + ), + 'block-library/query/view.min.js' => array( + 'dependencies' => array( + + ), + 'module_dependencies' => array( + array( + 'id' => '@wordpress/interactivity', + 'import' => 'static' + ), + array( + 'id' => '@wordpress/interactivity-router', + 'import' => 'dynamic' + ) + ), + 'version' => '7a4ec5bfb61a7137cf4b' + ), + 'block-library/search/view.min.js' => array( + 'dependencies' => array( + + ), + 'module_dependencies' => array( + array( + 'id' => '@wordpress/interactivity', + 'import' => 'static' + ) + ), + 'version' => '38bd0e230eaffa354d2a' + ), + 'block-library/tabs/view.min.js' => array( + 'dependencies' => array( + + ), + 'module_dependencies' => array( + array( + 'id' => '@wordpress/interactivity', + 'import' => 'static' + ) + ), + 'version' => '1f60dd5e3fa56c6b2e2e' + ), + 'boot/index.min.js' => array( + 'dependencies' => array( + 'react-jsx-runtime', + 'wp-commands', + 'wp-components', + 'wp-compose', + 'wp-core-data', + 'wp-data', + 'wp-editor', + 'wp-element', + 'wp-html-entities', + 'wp-i18n', + 'wp-keyboard-shortcuts', + 'wp-keycodes', + 'wp-notices', + 'wp-primitives', + 'wp-private-apis', + 'wp-theme', + 'wp-url' + ), + 'module_dependencies' => array( + array( + 'id' => '@wordpress/a11y', + 'import' => 'static' + ), + array( + 'id' => '@wordpress/lazy-editor', + 'import' => 'dynamic' + ), + array( + 'id' => '@wordpress/route', + 'import' => 'static' + ) + ), + 'version' => 'ad3a7da37529a4a0086d' + ), + 'core-abilities/index.min.js' => array( + 'dependencies' => array( + 'wp-api-fetch', + 'wp-url' + ), + 'module_dependencies' => array( + array( + 'id' => '@wordpress/abilities', + 'import' => 'static' + ) + ), + 'version' => '7cd8fe3a80dded97579b' + ), + 'edit-site-init/index.min.js' => array( + 'dependencies' => array( + 'react-jsx-runtime', + 'wp-data', + 'wp-element', + 'wp-primitives' + ), + 'module_dependencies' => array( + array( + 'id' => '@wordpress/boot', + 'import' => 'static' + ) + ), + 'version' => 'c636e2e534fd52f7c77c' + ), + 'interactivity/index.min.js' => array( + 'dependencies' => array( + + ), + 'version' => '4d9d9330d767da3813cc' + ), + 'interactivity-router/full-page.min.js' => array( + 'dependencies' => array( + + ), + 'module_dependencies' => array( + array( + 'id' => '@wordpress/interactivity-router', + 'import' => 'dynamic' + ) + ), + 'version' => '5c07cd7a12ae073c5241' + ), + 'interactivity-router/index.min.js' => array( + 'dependencies' => array( + + ), + 'module_dependencies' => array( + array( + 'id' => '@wordpress/a11y', + 'import' => 'dynamic' + ), + array( + 'id' => '@wordpress/interactivity', + 'import' => 'static' + ) + ), + 'version' => '493dd3de12e3112b3130' + ), + 'latex-to-mathml/index.min.js' => array( + 'dependencies' => array( + + ), + 'version' => 'e5fd3ae6d2c3b6e669da' + ), + 'latex-to-mathml/loader.min.js' => array( + 'dependencies' => array( + + ), + 'module_dependencies' => array( + array( + 'id' => '@wordpress/latex-to-mathml', + 'import' => 'dynamic' + ) + ), + 'version' => '4f37456af539bd3d2351' + ), + 'lazy-editor/index.min.js' => array( + 'dependencies' => array( + 'react-jsx-runtime', + 'wp-block-editor', + 'wp-blocks', + 'wp-components', + 'wp-core-data', + 'wp-data', + 'wp-editor', + 'wp-element', + 'wp-i18n', + 'wp-private-apis', + 'wp-style-engine' + ), + 'version' => '8796d7f43055e444d936' + ), + 'route/index.min.js' => array( + 'dependencies' => array( + 'react', + 'react-dom', + 'react-jsx-runtime', + 'wp-private-apis' + ), + 'version' => 'c5843b6c5e84b352f43b' + ), + 'vips/loader.min.js' => array( + 'dependencies' => array( + + ), + 'module_dependencies' => array( + array( + 'id' => '@wordpress/vips/worker', + 'import' => 'dynamic' + ) + ), + 'version' => '07c9acb45d3e5d81829a' + ), + 'vips/worker.min.js' => array( + 'dependencies' => array( + + ), + 'version' => 'b6a4882788678d947b30' + ), + 'workflow/index.min.js' => array( + 'dependencies' => array( + 'react', + 'react-dom', + 'react-jsx-runtime', + 'wp-components', + 'wp-data', + 'wp-element', + 'wp-i18n', + 'wp-keyboard-shortcuts', + 'wp-primitives', + 'wp-private-apis' + ), + 'module_dependencies' => array( + array( + 'id' => '@wordpress/abilities', + 'import' => 'static' + ) + ), + 'version' => 'e1bfc2380b433037c545' + ) +); \ No newline at end of file diff --git a/src/wp-includes/assets/script-modules-packages.php b/src/wp-includes/assets/script-modules-packages.php new file mode 100644 index 0000000000000..792ebcb13b446 --- /dev/null +++ b/src/wp-includes/assets/script-modules-packages.php @@ -0,0 +1,313 @@ + array( + 'dependencies' => array( + + ), + 'version' => '1c371cb517a97cdbcb9f' + ), + 'abilities/index.js' => array( + 'dependencies' => array( + 'wp-data', + 'wp-i18n' + ), + 'version' => 'f3475bc77a30dcc5b38d' + ), + 'block-editor/utils/fit-text-frontend.js' => array( + 'dependencies' => array( + + ), + 'module_dependencies' => array( + array( + 'id' => '@wordpress/interactivity', + 'import' => 'static' + ) + ), + 'version' => '383c7a8bd24a1f2fd9b9' + ), + 'block-library/accordion/view.js' => array( + 'dependencies' => array( + + ), + 'module_dependencies' => array( + array( + 'id' => '@wordpress/interactivity', + 'import' => 'static' + ) + ), + 'version' => '2af01b43d30739c3fb8d' + ), + 'block-library/file/view.js' => array( + 'dependencies' => array( + + ), + 'module_dependencies' => array( + array( + 'id' => '@wordpress/interactivity', + 'import' => 'static' + ) + ), + 'version' => '7d4d261d10dca47ebecb' + ), + 'block-library/form/view.js' => array( + 'dependencies' => array( + + ), + 'version' => '5542f8ad251fe43ef09e' + ), + 'block-library/image/view.js' => array( + 'dependencies' => array( + + ), + 'module_dependencies' => array( + array( + 'id' => '@wordpress/interactivity', + 'import' => 'static' + ) + ), + 'version' => '25ee935fd6c67371d0f3' + ), + 'block-library/navigation/view.js' => array( + 'dependencies' => array( + + ), + 'module_dependencies' => array( + array( + 'id' => '@wordpress/interactivity', + 'import' => 'static' + ) + ), + 'version' => '243a659f91c3dc9841c7' + ), + 'block-library/playlist/view.js' => array( + 'dependencies' => array( + + ), + 'module_dependencies' => array( + array( + 'id' => '@wordpress/interactivity', + 'import' => 'static' + ) + ), + 'version' => '99f747d731f80246db11' + ), + 'block-library/query/view.js' => array( + 'dependencies' => array( + + ), + 'module_dependencies' => array( + array( + 'id' => '@wordpress/interactivity', + 'import' => 'static' + ), + array( + 'id' => '@wordpress/interactivity-router', + 'import' => 'dynamic' + ) + ), + 'version' => '7a4ec5bfb61a7137cf4b' + ), + 'block-library/search/view.js' => array( + 'dependencies' => array( + + ), + 'module_dependencies' => array( + array( + 'id' => '@wordpress/interactivity', + 'import' => 'static' + ) + ), + 'version' => '38bd0e230eaffa354d2a' + ), + 'block-library/tabs/view.js' => array( + 'dependencies' => array( + + ), + 'module_dependencies' => array( + array( + 'id' => '@wordpress/interactivity', + 'import' => 'static' + ) + ), + 'version' => '1f60dd5e3fa56c6b2e2e' + ), + 'boot/index.js' => array( + 'dependencies' => array( + 'react-jsx-runtime', + 'wp-commands', + 'wp-components', + 'wp-compose', + 'wp-core-data', + 'wp-data', + 'wp-editor', + 'wp-element', + 'wp-html-entities', + 'wp-i18n', + 'wp-keyboard-shortcuts', + 'wp-keycodes', + 'wp-notices', + 'wp-primitives', + 'wp-private-apis', + 'wp-theme', + 'wp-url' + ), + 'module_dependencies' => array( + array( + 'id' => '@wordpress/a11y', + 'import' => 'static' + ), + array( + 'id' => '@wordpress/lazy-editor', + 'import' => 'dynamic' + ), + array( + 'id' => '@wordpress/route', + 'import' => 'static' + ) + ), + 'version' => 'ad3a7da37529a4a0086d' + ), + 'core-abilities/index.js' => array( + 'dependencies' => array( + 'wp-api-fetch', + 'wp-url' + ), + 'module_dependencies' => array( + array( + 'id' => '@wordpress/abilities', + 'import' => 'static' + ) + ), + 'version' => '7cd8fe3a80dded97579b' + ), + 'edit-site-init/index.js' => array( + 'dependencies' => array( + 'react-jsx-runtime', + 'wp-data', + 'wp-element', + 'wp-primitives' + ), + 'module_dependencies' => array( + array( + 'id' => '@wordpress/boot', + 'import' => 'static' + ) + ), + 'version' => 'c636e2e534fd52f7c77c' + ), + 'interactivity/index.js' => array( + 'dependencies' => array( + + ), + 'version' => '4d9d9330d767da3813cc' + ), + 'interactivity-router/full-page.js' => array( + 'dependencies' => array( + + ), + 'module_dependencies' => array( + array( + 'id' => '@wordpress/interactivity-router', + 'import' => 'dynamic' + ) + ), + 'version' => '5c07cd7a12ae073c5241' + ), + 'interactivity-router/index.js' => array( + 'dependencies' => array( + + ), + 'module_dependencies' => array( + array( + 'id' => '@wordpress/a11y', + 'import' => 'dynamic' + ), + array( + 'id' => '@wordpress/interactivity', + 'import' => 'static' + ) + ), + 'version' => '493dd3de12e3112b3130' + ), + 'latex-to-mathml/index.js' => array( + 'dependencies' => array( + + ), + 'version' => 'e5fd3ae6d2c3b6e669da' + ), + 'latex-to-mathml/loader.js' => array( + 'dependencies' => array( + + ), + 'module_dependencies' => array( + array( + 'id' => '@wordpress/latex-to-mathml', + 'import' => 'dynamic' + ) + ), + 'version' => '4f37456af539bd3d2351' + ), + 'lazy-editor/index.js' => array( + 'dependencies' => array( + 'react-jsx-runtime', + 'wp-block-editor', + 'wp-blocks', + 'wp-components', + 'wp-core-data', + 'wp-data', + 'wp-editor', + 'wp-element', + 'wp-i18n', + 'wp-private-apis', + 'wp-style-engine' + ), + 'version' => '8796d7f43055e444d936' + ), + 'route/index.js' => array( + 'dependencies' => array( + 'react', + 'react-dom', + 'react-jsx-runtime', + 'wp-private-apis' + ), + 'version' => 'c5843b6c5e84b352f43b' + ), + 'vips/loader.js' => array( + 'dependencies' => array( + + ), + 'module_dependencies' => array( + array( + 'id' => '@wordpress/vips/worker', + 'import' => 'dynamic' + ) + ), + 'version' => '07c9acb45d3e5d81829a' + ), + 'vips/worker.js' => array( + 'dependencies' => array( + + ), + 'version' => 'b6a4882788678d947b30' + ), + 'workflow/index.js' => array( + 'dependencies' => array( + 'react', + 'react-dom', + 'react-jsx-runtime', + 'wp-components', + 'wp-data', + 'wp-element', + 'wp-i18n', + 'wp-keyboard-shortcuts', + 'wp-primitives', + 'wp-private-apis' + ), + 'module_dependencies' => array( + array( + 'id' => '@wordpress/abilities', + 'import' => 'static' + ) + ), + 'version' => 'e1bfc2380b433037c545' + ) +); \ No newline at end of file diff --git a/src/wp-includes/blocks/accordion-heading/block.json b/src/wp-includes/blocks/accordion-heading/block.json new file mode 100644 index 0000000000000..e1ccf83dd3c1b --- /dev/null +++ b/src/wp-includes/blocks/accordion-heading/block.json @@ -0,0 +1,94 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "core/accordion-heading", + "title": "Accordion Heading", + "category": "design", + "description": "Displays a heading that toggles the accordion panel.", + "parent": [ "core/accordion-item" ], + "usesContext": [ + "core/accordion-icon-position", + "core/accordion-show-icon", + "core/accordion-heading-level" + ], + "supports": { + "anchor": true, + "color": { + "background": true, + "gradients": true + }, + "align": false, + "interactivity": true, + "spacing": { + "padding": true, + "__experimentalDefaultControls": { + "padding": true + }, + "__experimentalSkipSerialization": true, + "__experimentalSelector": ".wp-block-accordion-heading__toggle" + }, + "__experimentalBorder": { + "color": true, + "radius": true, + "style": true, + "width": true, + "__experimentalDefaultControls": { + "color": true, + "radius": true, + "style": true, + "width": true + } + }, + "typography": { + "__experimentalSkipSerialization": [ + "textDecoration", + "letterSpacing" + ], + "fontSize": true, + "__experimentalFontFamily": true, + "__experimentalFontWeight": true, + "__experimentalFontStyle": true, + "__experimentalTextTransform": true, + "__experimentalTextDecoration": true, + "__experimentalLetterSpacing": true, + "__experimentalDefaultControls": { + "fontSize": true, + "fontFamily": true + } + }, + "shadow": true, + "visibility": false, + "lock": false + }, + "selectors": { + "typography": { + "letterSpacing": ".wp-block-accordion-heading .wp-block-accordion-heading__toggle-title", + "textDecoration": ".wp-block-accordion-heading .wp-block-accordion-heading__toggle-title" + } + }, + "attributes": { + "openByDefault": { + "type": "boolean", + "default": false + }, + "title": { + "type": "rich-text", + "source": "rich-text", + "selector": ".wp-block-accordion-heading__toggle-title", + "role": "content" + }, + "level": { + "type": "number" + }, + "iconPosition": { + "type": "string", + "enum": [ "left", "right" ], + "default": "right" + }, + "showIcon": { + "type": "boolean", + "default": true + } + }, + "textdomain": "default" +} diff --git a/src/wp-includes/blocks/accordion-item.php b/src/wp-includes/blocks/accordion-item.php new file mode 100644 index 0000000000000..37306c61fcb85 --- /dev/null +++ b/src/wp-includes/blocks/accordion-item.php @@ -0,0 +1,75 @@ + function () { + $context = wp_interactivity_get_context(); + return $context['openByDefault']; + }, + ) + ); + + if ( $p->next_tag( array( 'class_name' => 'wp-block-accordion-item' ) ) ) { + $open_by_default = $attributes['openByDefault'] ? 'true' : 'false'; + $p->set_attribute( 'data-wp-context', '{ "id": "' . $unique_id . '", "openByDefault": ' . $open_by_default . ' }' ); + $p->set_attribute( 'data-wp-class--is-open', 'state.isOpen' ); + $p->set_attribute( 'data-wp-init', 'callbacks.initAccordionItems' ); + $p->set_attribute( 'data-wp-on-window--hashchange', 'callbacks.hashChange' ); + + if ( $p->next_tag( array( 'class_name' => 'wp-block-accordion-heading__toggle' ) ) ) { + $p->set_attribute( 'data-wp-on--click', 'actions.toggle' ); + $p->set_attribute( 'data-wp-on--keydown', 'actions.handleKeyDown' ); + $p->set_attribute( 'id', $unique_id ); + $p->set_attribute( 'aria-controls', $unique_id . '-panel' ); + $p->set_attribute( 'data-wp-bind--aria-expanded', 'state.isOpen' ); + + if ( $p->next_tag( array( 'class_name' => 'wp-block-accordion-panel' ) ) ) { + $p->set_attribute( 'id', $unique_id . '-panel' ); + $p->set_attribute( 'aria-labelledby', $unique_id ); + $p->set_attribute( 'data-wp-bind--inert', '!state.isOpen' ); + + // Only modify content if all directives have been set. + $content = $p->get_updated_html(); + } + } + } + + return $content; +} + +/** + * Registers the `core/accordion-item` block on server. + * + * @since 6.9.0 + */ +function register_block_core_accordion_item() { + register_block_type_from_metadata( + __DIR__ . '/accordion-item', + array( + 'render_callback' => 'block_core_accordion_item_render', + ) + ); +} +add_action( 'init', 'register_block_core_accordion_item' ); diff --git a/src/wp-includes/blocks/accordion-item/block.json b/src/wp-includes/blocks/accordion-item/block.json new file mode 100644 index 0000000000000..74bfddde0e68b --- /dev/null +++ b/src/wp-includes/blocks/accordion-item/block.json @@ -0,0 +1,63 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "core/accordion-item", + "title": "Accordion Item", + "category": "design", + "description": "Wraps the heading and panel in one unit.", + "parent": [ "core/accordion" ], + "allowedBlocks": [ "core/accordion-heading", "core/accordion-panel" ], + "supports": { + "html": false, + "color": { + "background": true, + "gradients": true + }, + "interactivity": true, + "spacing": { + "margin": [ "top", "bottom" ], + "blockGap": true + }, + "__experimentalBorder": { + "color": true, + "radius": true, + "style": true, + "width": true, + "__experimentalDefaultControls": { + "color": true, + "radius": true, + "style": true, + "width": true + } + }, + "shadow": true, + "layout": { + "allowEditing": false + }, + "typography": { + "fontSize": true, + "lineHeight": true, + "__experimentalFontFamily": true, + "__experimentalFontWeight": true, + "__experimentalFontStyle": true, + "__experimentalTextTransform": true, + "__experimentalTextDecoration": true, + "__experimentalLetterSpacing": true, + "__experimentalDefaultControls": { + "fontSize": true + } + }, + "contentRole": true + }, + "attributes": { + "openByDefault": { + "type": "boolean", + "default": false + } + }, + "providesContext": { + "core/accordion-open-by-default": "openByDefault" + }, + "textdomain": "default", + "style": "wp-block-accordion-item" +} diff --git a/src/wp-includes/blocks/accordion-panel/block.json b/src/wp-includes/blocks/accordion-panel/block.json new file mode 100644 index 0000000000000..b868ac8019b0d --- /dev/null +++ b/src/wp-includes/blocks/accordion-panel/block.json @@ -0,0 +1,68 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "core/accordion-panel", + "title": "Accordion Panel", + "category": "design", + "description": "Contains the hidden or revealed content beneath the heading.", + "parent": [ "core/accordion-item" ], + "usesContext": [ "core/accordion-open-by-default" ], + "supports": { + "html": false, + "color": { + "background": true, + "gradients": true + }, + "interactivity": true, + "spacing": { + "padding": true, + "blockGap": true, + "__experimentalDefaultControls": { + "padding": true, + "blockGap": true + } + }, + "__experimentalBorder": { + "color": true, + "radius": true, + "style": true, + "width": true, + "__experimentalDefaultControls": { + "color": true, + "radius": true, + "style": true, + "width": true + } + }, + "typography": { + "fontSize": true, + "lineHeight": true, + "__experimentalFontFamily": true, + "__experimentalFontWeight": true, + "__experimentalFontStyle": true, + "__experimentalTextTransform": true, + "__experimentalTextDecoration": true, + "__experimentalLetterSpacing": true, + "__experimentalDefaultControls": { + "fontSize": true + } + }, + "shadow": true, + "layout": { + "allowEditing": false + }, + "visibility": false, + "contentRole": true, + "allowedBlocks": true, + "lock": false + }, + "attributes": { + "templateLock": { + "type": [ "string", "boolean" ], + "enum": [ "all", "insert", "contentOnly", false ], + "default": false + } + }, + "textdomain": "default", + "style": "wp-block-accordion-panel" +} diff --git a/src/wp-includes/blocks/accordion.php b/src/wp-includes/blocks/accordion.php new file mode 100644 index 0000000000000..537904a6e402d --- /dev/null +++ b/src/wp-includes/blocks/accordion.php @@ -0,0 +1,45 @@ +next_tag( array( 'class_name' => 'wp-block-accordion' ) ) ) { + $p->set_attribute( 'data-wp-interactive', 'core/accordion' ); + $p->set_attribute( 'data-wp-context', '{ "autoclose": ' . $autoclose . ', "accordionItems": [] }' ); + + // Only modify content if directives have been set. + $content = $p->get_updated_html(); + } + + return $content; +} + +/** + * Registers the `core/accordion` block on server. + * + * @since 6.9.0 + */ +function register_block_core_accordion() { + register_block_type_from_metadata( + __DIR__ . '/accordion', + array( + 'render_callback' => 'render_block_core_accordion', + ) + ); +} +add_action( 'init', 'register_block_core_accordion' ); diff --git a/src/wp-includes/blocks/accordion/block.json b/src/wp-includes/blocks/accordion/block.json new file mode 100644 index 0000000000000..69923748a553f --- /dev/null +++ b/src/wp-includes/blocks/accordion/block.json @@ -0,0 +1,90 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "core/accordion", + "title": "Accordion", + "category": "design", + "description": "Displays a foldable layout that groups content in collapsible sections.", + "example": {}, + "supports": { + "anchor": true, + "html": false, + "align": [ "wide", "full" ], + "background": { + "backgroundImage": true, + "backgroundSize": true, + "__experimentalDefaultControls": { + "backgroundImage": true + } + }, + "color": { + "background": true, + "gradients": true + }, + "__experimentalBorder": { + "color": true, + "radius": true, + "style": true, + "width": true, + "__experimentalDefaultControls": { + "color": true, + "radius": true, + "style": true, + "width": true + } + }, + "spacing": { + "padding": true, + "margin": [ "top", "bottom" ], + "blockGap": true + }, + "shadow": true, + "layout": true, + "ariaLabel": true, + "interactivity": true, + "typography": { + "fontSize": true, + "lineHeight": true, + "__experimentalFontFamily": true, + "__experimentalFontWeight": true, + "__experimentalFontStyle": true, + "__experimentalTextTransform": true, + "__experimentalTextDecoration": true, + "__experimentalLetterSpacing": true, + "__experimentalDefaultControls": { + "fontSize": true + } + }, + "contentRole": true, + "listView": true + }, + "attributes": { + "iconPosition": { + "type": "string", + "default": "right" + }, + "showIcon": { + "type": "boolean", + "default": true + }, + "autoclose": { + "type": "boolean", + "default": false + }, + "headingLevel": { + "type": "number", + "default": 3 + }, + "levelOptions": { + "type": "array" + } + }, + "providesContext": { + "core/accordion-icon-position": "iconPosition", + "core/accordion-show-icon": "showIcon", + "core/accordion-heading-level": "headingLevel" + }, + "allowedBlocks": [ "core/accordion-item" ], + "textdomain": "default", + "viewScriptModule": "@wordpress/block-library/accordion/view" +} diff --git a/src/wp-includes/blocks/archives.php b/src/wp-includes/blocks/archives.php new file mode 100644 index 0000000000000..cead720f7fb80 --- /dev/null +++ b/src/wp-includes/blocks/archives.php @@ -0,0 +1,174 @@ + $type, + 'format' => 'option', + 'show_post_count' => $show_post_count, + ) + ); + + $dropdown_args['echo'] = 0; + + $archives = wp_get_archives( $dropdown_args ); + + $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $class ) ); + + switch ( $dropdown_args['type'] ) { + case 'yearly': + $label = __( 'Select Year' ); + break; + case 'monthly': + $label = __( 'Select Month' ); + break; + case 'daily': + $label = __( 'Select Day' ); + break; + case 'weekly': + $label = __( 'Select Week' ); + break; + default: + $label = __( 'Select Post' ); + break; + } + + $show_label = empty( $attributes['showLabel'] ) ? ' screen-reader-text' : ''; + + $block_content = ' + '; + + // Inject the dropdown script immediately after the select dropdown. + $block_content .= block_core_archives_build_dropdown_script( $dropdown_id ); + + return sprintf( + '
%2$s
', + $wrapper_attributes, + $block_content + ); + } + + /** This filter is documented in wp-includes/widgets/class-wp-widget-archives.php */ + $archives_args = apply_filters( + 'widget_archives_args', + array( + 'type' => $type, + 'show_post_count' => $show_post_count, + ) + ); + + $archives_args['echo'] = 0; + + $archives = wp_get_archives( $archives_args ); + + $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $class ) ); + + if ( empty( $archives ) ) { + return sprintf( + '
%2$s
', + $wrapper_attributes, + __( 'No archives to show.' ) + ); + } + + return sprintf( + '', + $wrapper_attributes, + $archives + ); +} + +/** + * Generates the inline script for an archives dropdown field. + * + * @since 6.9.0 + * + * @param string $dropdown_id ID of the dropdown field. + * + * @return string Returns the dropdown onChange redirection script. + */ +function block_core_archives_build_dropdown_script( $dropdown_id ) { + ob_start(); + + $exports = array( $dropdown_id, home_url() ); + ?> + + ', '' ), '', ob_get_clean() ) ) . + "\n//# sourceURL=" . rawurlencode( __FUNCTION__ ) + ); +} + +/** + * Register archives block. + * + * @since 5.0.0 + */ +function register_block_core_archives() { + register_block_type_from_metadata( + __DIR__ . '/archives', + array( + 'render_callback' => 'render_block_core_archives', + ) + ); +} +add_action( 'init', 'register_block_core_archives' ); diff --git a/src/wp-includes/blocks/archives/block.json b/src/wp-includes/blocks/archives/block.json new file mode 100644 index 0000000000000..c689b34ba9d24 --- /dev/null +++ b/src/wp-includes/blocks/archives/block.json @@ -0,0 +1,71 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "core/archives", + "title": "Archives", + "category": "widgets", + "description": "Display a date archive of your posts.", + "textdomain": "default", + "attributes": { + "displayAsDropdown": { + "type": "boolean", + "default": false + }, + "showLabel": { + "type": "boolean", + "default": true + }, + "showPostCounts": { + "type": "boolean", + "default": false + }, + "type": { + "type": "string", + "default": "monthly" + } + }, + "supports": { + "anchor": true, + "align": true, + "__experimentalBorder": { + "radius": true, + "color": true, + "width": true, + "style": true + }, + "html": false, + "spacing": { + "margin": true, + "padding": true, + "__experimentalDefaultControls": { + "margin": false, + "padding": false + } + }, + "typography": { + "fontSize": true, + "lineHeight": true, + "__experimentalFontFamily": true, + "__experimentalFontWeight": true, + "__experimentalFontStyle": true, + "__experimentalTextTransform": true, + "__experimentalTextDecoration": true, + "__experimentalLetterSpacing": true, + "__experimentalDefaultControls": { + "fontSize": true + } + }, + "color": { + "gradients": true, + "link": true, + "__experimentalDefaultControls": { + "background": true, + "text": true, + "link": true + } + }, + "interactivity": { + "clientNavigation": true + } + } +} diff --git a/src/wp-includes/blocks/audio/block.json b/src/wp-includes/blocks/audio/block.json new file mode 100644 index 0000000000000..9b77efee23cce --- /dev/null +++ b/src/wp-includes/blocks/audio/block.json @@ -0,0 +1,68 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "core/audio", + "title": "Audio", + "category": "media", + "description": "Embed a simple audio player.", + "keywords": [ "music", "sound", "podcast", "recording" ], + "textdomain": "default", + "attributes": { + "blob": { + "type": "string", + "role": "local" + }, + "src": { + "type": "string", + "source": "attribute", + "selector": "audio", + "attribute": "src", + "role": "content" + }, + "caption": { + "type": "rich-text", + "source": "rich-text", + "selector": "figcaption", + "role": "content" + }, + "id": { + "type": "number", + "role": "content" + }, + "autoplay": { + "type": "boolean", + "source": "attribute", + "selector": "audio", + "attribute": "autoplay" + }, + "loop": { + "type": "boolean", + "source": "attribute", + "selector": "audio", + "attribute": "loop" + }, + "preload": { + "type": "string", + "source": "attribute", + "selector": "audio", + "attribute": "preload" + } + }, + "supports": { + "anchor": true, + "align": true, + "spacing": { + "margin": true, + "padding": true, + "__experimentalDefaultControls": { + "margin": false, + "padding": false + } + }, + "interactivity": { + "clientNavigation": true + } + }, + "editorStyle": "wp-block-audio-editor", + "style": "wp-block-audio" +} diff --git a/src/wp-includes/blocks/avatar.php b/src/wp-includes/blocks/avatar.php new file mode 100644 index 0000000000000..7f73370973d42 --- /dev/null +++ b/src/wp-includes/blocks/avatar.php @@ -0,0 +1,166 @@ +context['commentId'] ) ) { + if ( isset( $attributes['userId'] ) ) { + $author_id = $attributes['userId']; + } elseif ( isset( $block->context['postId'] ) ) { + $author_id = get_post_field( 'post_author', $block->context['postId'] ); + } else { + $author_id = get_query_var( 'author' ); + } + + if ( empty( $author_id ) ) { + return ''; + } + + $author_name = get_the_author_meta( 'display_name', $author_id ); + // translators: %s: Author name. + $alt = sprintf( __( '%s Avatar' ), $author_name ); + $avatar_block = get_avatar( + $author_id, + $size, + '', + $alt, + array( + 'extra_attr' => $image_styles, + 'class' => $image_classes, + ) + ); + if ( isset( $attributes['isLink'] ) && $attributes['isLink'] ) { + $label = ''; + if ( '_blank' === $attributes['linkTarget'] ) { + // translators: %s is the Author name. + $label = 'aria-label="' . esc_attr( sprintf( __( '(%s author archive, opens in a new tab)' ), $author_name ) ) . '"'; + } + // translators: 1: Author archive link. 2: Link target. %3$s Aria label. %4$s Avatar image. + $avatar_block = sprintf( '%4$s', esc_url( get_author_posts_url( $author_id ) ), esc_attr( $attributes['linkTarget'] ), $label, $avatar_block ); + } + return sprintf( '
%2s
', $wrapper_attributes, $avatar_block ); + } + $comment = get_comment( $block->context['commentId'] ); + if ( ! $comment ) { + return ''; + } + /* translators: %s: Author name. */ + $alt = sprintf( __( '%s Avatar' ), $comment->comment_author ); + $avatar_block = get_avatar( + $comment, + $size, + '', + $alt, + array( + 'extra_attr' => $image_styles, + 'class' => $image_classes, + ) + ); + if ( isset( $attributes['isLink'] ) && $attributes['isLink'] && isset( $comment->comment_author_url ) && '' !== $comment->comment_author_url ) { + $label = ''; + if ( '_blank' === $attributes['linkTarget'] ) { + // translators: %s: Comment author name. + $label = 'aria-label="' . esc_attr( sprintf( __( '(%s website link, opens in a new tab)' ), $comment->comment_author ) ) . '"'; + } + $avatar_block = sprintf( '%4$s', esc_url( $comment->comment_author_url ), esc_attr( $attributes['linkTarget'] ), $label, $avatar_block ); + } + return sprintf( '
%2s
', $wrapper_attributes, $avatar_block ); +} + +/** + * Generates class names and styles to apply the border support styles for + * the Avatar block. + * + * @since 6.3.0 + * + * @param array $attributes The block attributes. + * @return array The border-related classnames and styles for the block. + */ +function get_block_core_avatar_border_attributes( $attributes ) { + $border_styles = array(); + $sides = array( 'top', 'right', 'bottom', 'left' ); + + // Border radius. + if ( isset( $attributes['style']['border']['radius'] ) ) { + $border_styles['radius'] = $attributes['style']['border']['radius']; + } + + // Border style. + if ( isset( $attributes['style']['border']['style'] ) ) { + $border_styles['style'] = $attributes['style']['border']['style']; + } + + // Border width. + if ( isset( $attributes['style']['border']['width'] ) ) { + $border_styles['width'] = $attributes['style']['border']['width']; + } + + // Border color. + $preset_color = array_key_exists( 'borderColor', $attributes ) ? "var:preset|color|{$attributes['borderColor']}" : null; + $custom_color = $attributes['style']['border']['color'] ?? null; + $border_styles['color'] = $preset_color ? $preset_color : $custom_color; + + // Individual border styles e.g. top, left etc. + foreach ( $sides as $side ) { + $border = $attributes['style']['border'][ $side ] ?? null; + $border_styles[ $side ] = array( + 'color' => $border['color'] ?? null, + 'style' => $border['style'] ?? null, + 'width' => $border['width'] ?? null, + ); + } + + $styles = wp_style_engine_get_styles( array( 'border' => $border_styles ) ); + $attributes = array(); + if ( ! empty( $styles['classnames'] ) ) { + $attributes['class'] = $styles['classnames']; + } + if ( ! empty( $styles['css'] ) ) { + $attributes['style'] = $styles['css']; + } + return $attributes; +} + +/** + * Registers the `core/avatar` block on the server. + * + * @since 6.0.0 + */ +function register_block_core_avatar() { + register_block_type_from_metadata( + __DIR__ . '/avatar', + array( + 'render_callback' => 'render_block_core_avatar', + ) + ); +} +add_action( 'init', 'register_block_core_avatar' ); diff --git a/src/wp-includes/blocks/avatar/block.json b/src/wp-includes/blocks/avatar/block.json new file mode 100644 index 0000000000000..0cb92d81865c7 --- /dev/null +++ b/src/wp-includes/blocks/avatar/block.json @@ -0,0 +1,69 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "core/avatar", + "title": "Avatar", + "category": "theme", + "description": "Add a user’s avatar.", + "textdomain": "default", + "attributes": { + "userId": { + "type": "number" + }, + "size": { + "type": "number", + "default": 96 + }, + "isLink": { + "type": "boolean", + "default": false + }, + "linkTarget": { + "type": "string", + "default": "_self" + } + }, + "usesContext": [ "postType", "postId", "commentId" ], + "supports": { + "anchor": true, + "html": false, + "align": true, + "alignWide": false, + "spacing": { + "margin": true, + "padding": true, + "__experimentalDefaultControls": { + "margin": false, + "padding": false + } + }, + "__experimentalBorder": { + "__experimentalSkipSerialization": true, + "radius": true, + "width": true, + "color": true, + "style": true, + "__experimentalDefaultControls": { + "radius": true + } + }, + "color": { + "text": false, + "background": false + }, + "filter": { + "duotone": true + }, + "interactivity": { + "clientNavigation": true + } + }, + "selectors": { + "border": ".wp-block-avatar img", + "filter": { + "duotone": ".wp-block-avatar img" + } + }, + "editorStyle": "wp-block-avatar-editor", + "style": "wp-block-avatar" +} diff --git a/src/wp-includes/blocks/block.php b/src/wp-includes/blocks/block.php new file mode 100644 index 0000000000000..f09d5367a9c89 --- /dev/null +++ b/src/wp-includes/blocks/block.php @@ -0,0 +1,131 @@ +post_type ) { + return ''; + } + + if ( isset( $seen_refs[ $attributes['ref'] ] ) ) { + // WP_DEBUG_DISPLAY must only be honored when WP_DEBUG. This precedent + // is set in `wp_debug_mode()`. + $is_debug = WP_DEBUG && WP_DEBUG_DISPLAY; + + return $is_debug ? + // translators: Visible only in the front end, this warning takes the place of a faulty block. + __( '[block rendering halted]' ) : + ''; + } + + if ( 'publish' !== $reusable_block->post_status || ! empty( $reusable_block->post_password ) ) { + return ''; + } + + $seen_refs[ $attributes['ref'] ] = true; + + // Handle embeds for reusable blocks. + global $wp_embed; + $content = $wp_embed->run_shortcode( $reusable_block->post_content ); + $content = $wp_embed->autoembed( $content ); + + // Back compat. + // For blocks that have not been migrated in the editor, add some back compat + // so that front-end rendering continues to work. + + // This matches the `v2` deprecation. Removes the inner `values` property + // from every item. + if ( isset( $attributes['content'] ) ) { + foreach ( $attributes['content'] as &$content_data ) { + if ( isset( $content_data['values'] ) ) { + $is_assoc_array = is_array( $content_data['values'] ) && ! wp_is_numeric_array( $content_data['values'] ); + + if ( $is_assoc_array ) { + $content_data = $content_data['values']; + } + } + } + } + + // This matches the `v1` deprecation. Rename `overrides` to `content`. + if ( isset( $attributes['overrides'] ) && ! isset( $attributes['content'] ) ) { + $attributes['content'] = $attributes['overrides']; + } + + // Apply Block Hooks. + $content = apply_block_hooks_to_content_from_post_object( $content, $reusable_block ); + + /** + * We attach the blocks from $content as inner blocks to the Synced Pattern block instance. + * This ensures that block context available to the Synced Pattern block instance is provided to + * those blocks. + */ + $block_instance->parsed_block['innerBlocks'] = parse_blocks( $content ); + $block_instance->parsed_block['innerContent'] = array_fill( 0, count( $block_instance->parsed_block['innerBlocks'] ), null ); + if ( method_exists( $block_instance, 'refresh_context_dependents' ) ) { + // WP_Block::refresh_context_dependents() was introduced in WordPress 6.8. + $block_instance->refresh_context_dependents(); + } else { + // This branch can be removed once Gutenberg requires WordPress 6.8 or later. + if ( ! class_exists( 'WP_Block_Cloner' ) ) { + // phpcs:ignore Gutenberg.Commenting.SinceTag.MissingClassSinceTag + class WP_Block_Cloner extends WP_Block { + /** + * Static methods of subclasses have access to protected properties + * of instances of the parent class. + * In this case, this gives us access to `available_context` and `registry`. + */ + // phpcs:ignore Gutenberg.Commenting.SinceTag.MissingMethodSinceTag + public static function clone_instance( $instance ) { + return new WP_Block( + $instance->parsed_block, + $instance->available_context, + $instance->registry + ); + } + } + } + $block_instance = WP_Block_Cloner::clone_instance( $block_instance ); + } + + $content = $block_instance->render( array( 'dynamic' => false ) ); + unset( $seen_refs[ $attributes['ref'] ] ); + + return $content; +} + +/** + * Registers the `core/block` block. + * + * @since 5.3.0 + */ +function register_block_core_block() { + register_block_type_from_metadata( + __DIR__ . '/block', + array( + 'render_callback' => 'render_block_core_block', + ) + ); +} +add_action( 'init', 'register_block_core_block' ); diff --git a/src/wp-includes/blocks/block/block.json b/src/wp-includes/blocks/block/block.json new file mode 100644 index 0000000000000..8d2b8f6f3b1bc --- /dev/null +++ b/src/wp-includes/blocks/block/block.json @@ -0,0 +1,32 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "core/block", + "title": "Pattern", + "category": "reusable", + "description": "Reuse this design across your site.", + "keywords": [ "reusable" ], + "textdomain": "default", + "attributes": { + "ref": { + "type": "number" + }, + "content": { + "type": "object", + "default": {} + } + }, + "providesContext": { + "pattern/overrides": "content" + }, + "supports": { + "customClassName": false, + "html": false, + "inserter": false, + "renaming": false, + "interactivity": { + "clientNavigation": true + }, + "customCSS": false + } +} diff --git a/src/wp-includes/blocks/blocks-json.php b/src/wp-includes/blocks/blocks-json.php new file mode 100644 index 0000000000000..b486c83dfb2ca --- /dev/null +++ b/src/wp-includes/blocks/blocks-json.php @@ -0,0 +1,8553 @@ + array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/accordion', + 'title' => 'Accordion', + 'category' => 'design', + 'description' => 'Displays a foldable layout that groups content in collapsible sections.', + 'example' => array( + + ), + 'supports' => array( + 'anchor' => true, + 'html' => false, + 'align' => array( + 'wide', + 'full' + ), + 'background' => array( + 'backgroundImage' => true, + 'backgroundSize' => true, + '__experimentalDefaultControls' => array( + 'backgroundImage' => true + ) + ), + 'color' => array( + 'background' => true, + 'gradients' => true + ), + '__experimentalBorder' => array( + 'color' => true, + 'radius' => true, + 'style' => true, + 'width' => true, + '__experimentalDefaultControls' => array( + 'color' => true, + 'radius' => true, + 'style' => true, + 'width' => true + ) + ), + 'spacing' => array( + 'padding' => true, + 'margin' => array( + 'top', + 'bottom' + ), + 'blockGap' => true + ), + 'shadow' => true, + 'layout' => true, + 'ariaLabel' => true, + 'interactivity' => true, + 'typography' => array( + 'fontSize' => true, + 'lineHeight' => true, + '__experimentalFontFamily' => true, + '__experimentalFontWeight' => true, + '__experimentalFontStyle' => true, + '__experimentalTextTransform' => true, + '__experimentalTextDecoration' => true, + '__experimentalLetterSpacing' => true, + '__experimentalDefaultControls' => array( + 'fontSize' => true + ) + ), + 'contentRole' => true, + 'listView' => true + ), + 'attributes' => array( + 'iconPosition' => array( + 'type' => 'string', + 'default' => 'right' + ), + 'showIcon' => array( + 'type' => 'boolean', + 'default' => true + ), + 'autoclose' => array( + 'type' => 'boolean', + 'default' => false + ), + 'headingLevel' => array( + 'type' => 'number', + 'default' => 3 + ), + 'levelOptions' => array( + 'type' => 'array' + ) + ), + 'providesContext' => array( + 'core/accordion-icon-position' => 'iconPosition', + 'core/accordion-show-icon' => 'showIcon', + 'core/accordion-heading-level' => 'headingLevel' + ), + 'allowedBlocks' => array( + 'core/accordion-item' + ), + 'textdomain' => 'default', + 'viewScriptModule' => '@wordpress/block-library/accordion/view' + ), + 'accordion-heading' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/accordion-heading', + 'title' => 'Accordion Heading', + 'category' => 'design', + 'description' => 'Displays a heading that toggles the accordion panel.', + 'parent' => array( + 'core/accordion-item' + ), + 'usesContext' => array( + 'core/accordion-icon-position', + 'core/accordion-show-icon', + 'core/accordion-heading-level' + ), + 'supports' => array( + 'anchor' => true, + 'color' => array( + 'background' => true, + 'gradients' => true + ), + 'align' => false, + 'interactivity' => true, + 'spacing' => array( + 'padding' => true, + '__experimentalDefaultControls' => array( + 'padding' => true + ), + '__experimentalSkipSerialization' => true, + '__experimentalSelector' => '.wp-block-accordion-heading__toggle' + ), + '__experimentalBorder' => array( + 'color' => true, + 'radius' => true, + 'style' => true, + 'width' => true, + '__experimentalDefaultControls' => array( + 'color' => true, + 'radius' => true, + 'style' => true, + 'width' => true + ) + ), + 'typography' => array( + '__experimentalSkipSerialization' => array( + 'textDecoration', + 'letterSpacing' + ), + 'fontSize' => true, + '__experimentalFontFamily' => true, + '__experimentalFontWeight' => true, + '__experimentalFontStyle' => true, + '__experimentalTextTransform' => true, + '__experimentalTextDecoration' => true, + '__experimentalLetterSpacing' => true, + '__experimentalDefaultControls' => array( + 'fontSize' => true, + 'fontFamily' => true + ) + ), + 'shadow' => true, + 'visibility' => false, + 'lock' => false + ), + 'selectors' => array( + 'typography' => array( + 'letterSpacing' => '.wp-block-accordion-heading .wp-block-accordion-heading__toggle-title', + 'textDecoration' => '.wp-block-accordion-heading .wp-block-accordion-heading__toggle-title' + ) + ), + 'attributes' => array( + 'openByDefault' => array( + 'type' => 'boolean', + 'default' => false + ), + 'title' => array( + 'type' => 'rich-text', + 'source' => 'rich-text', + 'selector' => '.wp-block-accordion-heading__toggle-title', + 'role' => 'content' + ), + 'level' => array( + 'type' => 'number' + ), + 'iconPosition' => array( + 'type' => 'string', + 'enum' => array( + 'left', + 'right' + ), + 'default' => 'right' + ), + 'showIcon' => array( + 'type' => 'boolean', + 'default' => true + ) + ), + 'textdomain' => 'default' + ), + 'accordion-item' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/accordion-item', + 'title' => 'Accordion Item', + 'category' => 'design', + 'description' => 'Wraps the heading and panel in one unit.', + 'parent' => array( + 'core/accordion' + ), + 'allowedBlocks' => array( + 'core/accordion-heading', + 'core/accordion-panel' + ), + 'supports' => array( + 'html' => false, + 'color' => array( + 'background' => true, + 'gradients' => true + ), + 'interactivity' => true, + 'spacing' => array( + 'margin' => array( + 'top', + 'bottom' + ), + 'blockGap' => true + ), + '__experimentalBorder' => array( + 'color' => true, + 'radius' => true, + 'style' => true, + 'width' => true, + '__experimentalDefaultControls' => array( + 'color' => true, + 'radius' => true, + 'style' => true, + 'width' => true + ) + ), + 'shadow' => true, + 'layout' => array( + 'allowEditing' => false + ), + 'typography' => array( + 'fontSize' => true, + 'lineHeight' => true, + '__experimentalFontFamily' => true, + '__experimentalFontWeight' => true, + '__experimentalFontStyle' => true, + '__experimentalTextTransform' => true, + '__experimentalTextDecoration' => true, + '__experimentalLetterSpacing' => true, + '__experimentalDefaultControls' => array( + 'fontSize' => true + ) + ), + 'contentRole' => true + ), + 'attributes' => array( + 'openByDefault' => array( + 'type' => 'boolean', + 'default' => false + ) + ), + 'providesContext' => array( + 'core/accordion-open-by-default' => 'openByDefault' + ), + 'textdomain' => 'default', + 'style' => 'wp-block-accordion-item' + ), + 'accordion-panel' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/accordion-panel', + 'title' => 'Accordion Panel', + 'category' => 'design', + 'description' => 'Contains the hidden or revealed content beneath the heading.', + 'parent' => array( + 'core/accordion-item' + ), + 'usesContext' => array( + 'core/accordion-open-by-default' + ), + 'supports' => array( + 'html' => false, + 'color' => array( + 'background' => true, + 'gradients' => true + ), + 'interactivity' => true, + 'spacing' => array( + 'padding' => true, + 'blockGap' => true, + '__experimentalDefaultControls' => array( + 'padding' => true, + 'blockGap' => true + ) + ), + '__experimentalBorder' => array( + 'color' => true, + 'radius' => true, + 'style' => true, + 'width' => true, + '__experimentalDefaultControls' => array( + 'color' => true, + 'radius' => true, + 'style' => true, + 'width' => true + ) + ), + 'typography' => array( + 'fontSize' => true, + 'lineHeight' => true, + '__experimentalFontFamily' => true, + '__experimentalFontWeight' => true, + '__experimentalFontStyle' => true, + '__experimentalTextTransform' => true, + '__experimentalTextDecoration' => true, + '__experimentalLetterSpacing' => true, + '__experimentalDefaultControls' => array( + 'fontSize' => true + ) + ), + 'shadow' => true, + 'layout' => array( + 'allowEditing' => false + ), + 'visibility' => false, + 'contentRole' => true, + 'allowedBlocks' => true, + 'lock' => false + ), + 'attributes' => array( + 'templateLock' => array( + 'type' => array( + 'string', + 'boolean' + ), + 'enum' => array( + 'all', + 'insert', + 'contentOnly', + false + ), + 'default' => false + ) + ), + 'textdomain' => 'default', + 'style' => 'wp-block-accordion-panel' + ), + 'archives' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/archives', + 'title' => 'Archives', + 'category' => 'widgets', + 'description' => 'Display a date archive of your posts.', + 'textdomain' => 'default', + 'attributes' => array( + 'displayAsDropdown' => array( + 'type' => 'boolean', + 'default' => false + ), + 'showLabel' => array( + 'type' => 'boolean', + 'default' => true + ), + 'showPostCounts' => array( + 'type' => 'boolean', + 'default' => false + ), + 'type' => array( + 'type' => 'string', + 'default' => 'monthly' + ) + ), + 'supports' => array( + 'anchor' => true, + 'align' => true, + '__experimentalBorder' => array( + 'radius' => true, + 'color' => true, + 'width' => true, + 'style' => true + ), + 'html' => false, + 'spacing' => array( + 'margin' => true, + 'padding' => true, + '__experimentalDefaultControls' => array( + 'margin' => false, + 'padding' => false + ) + ), + 'typography' => array( + 'fontSize' => true, + 'lineHeight' => true, + '__experimentalFontFamily' => true, + '__experimentalFontWeight' => true, + '__experimentalFontStyle' => true, + '__experimentalTextTransform' => true, + '__experimentalTextDecoration' => true, + '__experimentalLetterSpacing' => true, + '__experimentalDefaultControls' => array( + 'fontSize' => true + ) + ), + 'color' => array( + 'gradients' => true, + 'link' => true, + '__experimentalDefaultControls' => array( + 'background' => true, + 'text' => true, + 'link' => true + ) + ), + 'interactivity' => array( + 'clientNavigation' => true + ) + ) + ), + 'audio' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/audio', + 'title' => 'Audio', + 'category' => 'media', + 'description' => 'Embed a simple audio player.', + 'keywords' => array( + 'music', + 'sound', + 'podcast', + 'recording' + ), + 'textdomain' => 'default', + 'attributes' => array( + 'blob' => array( + 'type' => 'string', + 'role' => 'local' + ), + 'src' => array( + 'type' => 'string', + 'source' => 'attribute', + 'selector' => 'audio', + 'attribute' => 'src', + 'role' => 'content' + ), + 'caption' => array( + 'type' => 'rich-text', + 'source' => 'rich-text', + 'selector' => 'figcaption', + 'role' => 'content' + ), + 'id' => array( + 'type' => 'number', + 'role' => 'content' + ), + 'autoplay' => array( + 'type' => 'boolean', + 'source' => 'attribute', + 'selector' => 'audio', + 'attribute' => 'autoplay' + ), + 'loop' => array( + 'type' => 'boolean', + 'source' => 'attribute', + 'selector' => 'audio', + 'attribute' => 'loop' + ), + 'preload' => array( + 'type' => 'string', + 'source' => 'attribute', + 'selector' => 'audio', + 'attribute' => 'preload' + ) + ), + 'supports' => array( + 'anchor' => true, + 'align' => true, + 'spacing' => array( + 'margin' => true, + 'padding' => true, + '__experimentalDefaultControls' => array( + 'margin' => false, + 'padding' => false + ) + ), + 'interactivity' => array( + 'clientNavigation' => true + ) + ), + 'editorStyle' => 'wp-block-audio-editor', + 'style' => 'wp-block-audio' + ), + 'avatar' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/avatar', + 'title' => 'Avatar', + 'category' => 'theme', + 'description' => 'Add a user’s avatar.', + 'textdomain' => 'default', + 'attributes' => array( + 'userId' => array( + 'type' => 'number' + ), + 'size' => array( + 'type' => 'number', + 'default' => 96 + ), + 'isLink' => array( + 'type' => 'boolean', + 'default' => false + ), + 'linkTarget' => array( + 'type' => 'string', + 'default' => '_self' + ) + ), + 'usesContext' => array( + 'postType', + 'postId', + 'commentId' + ), + 'supports' => array( + 'anchor' => true, + 'html' => false, + 'align' => true, + 'alignWide' => false, + 'spacing' => array( + 'margin' => true, + 'padding' => true, + '__experimentalDefaultControls' => array( + 'margin' => false, + 'padding' => false + ) + ), + '__experimentalBorder' => array( + '__experimentalSkipSerialization' => true, + 'radius' => true, + 'width' => true, + 'color' => true, + 'style' => true, + '__experimentalDefaultControls' => array( + 'radius' => true + ) + ), + 'color' => array( + 'text' => false, + 'background' => false + ), + 'filter' => array( + 'duotone' => true + ), + 'interactivity' => array( + 'clientNavigation' => true + ) + ), + 'selectors' => array( + 'border' => '.wp-block-avatar img', + 'filter' => array( + 'duotone' => '.wp-block-avatar img' + ) + ), + 'editorStyle' => 'wp-block-avatar-editor', + 'style' => 'wp-block-avatar' + ), + 'block' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/block', + 'title' => 'Pattern', + 'category' => 'reusable', + 'description' => 'Reuse this design across your site.', + 'keywords' => array( + 'reusable' + ), + 'textdomain' => 'default', + 'attributes' => array( + 'ref' => array( + 'type' => 'number' + ), + 'content' => array( + 'type' => 'object', + 'default' => array( + + ) + ) + ), + 'providesContext' => array( + 'pattern/overrides' => 'content' + ), + 'supports' => array( + 'customClassName' => false, + 'html' => false, + 'inserter' => false, + 'renaming' => false, + 'interactivity' => array( + 'clientNavigation' => true + ), + 'customCSS' => false + ) + ), + 'breadcrumbs' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/breadcrumbs', + 'title' => 'Breadcrumbs', + 'category' => 'theme', + 'description' => 'Display a breadcrumb trail showing the path to the current page.', + 'textdomain' => 'default', + 'attributes' => array( + 'prefersTaxonomy' => array( + 'type' => 'boolean', + 'default' => false + ), + 'separator' => array( + 'type' => 'string', + 'default' => '/' + ), + 'showHomeItem' => array( + 'type' => 'boolean', + 'default' => true + ), + 'showCurrentItem' => array( + 'type' => 'boolean', + 'default' => true + ), + 'showOnHomePage' => array( + 'type' => 'boolean', + 'default' => false + ) + ), + 'usesContext' => array( + 'postId', + 'postType', + 'templateSlug' + ), + 'supports' => array( + 'anchor' => true, + 'html' => false, + 'align' => array( + 'wide', + 'full' + ), + 'spacing' => array( + 'margin' => true, + 'padding' => true + ), + 'color' => array( + 'gradients' => true, + 'link' => true, + '__experimentalDefaultControls' => array( + 'background' => true, + 'text' => true + ) + ), + '__experimentalBorder' => array( + 'radius' => true, + 'color' => true, + 'width' => true, + 'style' => true, + '__experimentalDefaultControls' => array( + 'radius' => false, + 'color' => true, + 'width' => true, + 'style' => true + ) + ), + 'typography' => array( + 'fontSize' => true, + 'lineHeight' => true, + '__experimentalFontFamily' => true, + '__experimentalFontWeight' => true, + '__experimentalFontStyle' => true, + '__experimentalTextTransform' => true, + '__experimentalTextDecoration' => true, + '__experimentalLetterSpacing' => true, + '__experimentalDefaultControls' => array( + 'fontSize' => true + ) + ), + 'interactivity' => array( + 'clientNavigation' => true + ) + ), + 'style' => 'wp-block-breadcrumbs' + ), + 'button' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/button', + 'title' => 'Button', + 'category' => 'design', + 'parent' => array( + 'core/buttons' + ), + 'description' => 'Prompt visitors to take action with a button-style link.', + 'keywords' => array( + 'link' + ), + 'textdomain' => 'default', + 'attributes' => array( + 'tagName' => array( + 'type' => 'string', + 'enum' => array( + 'a', + 'button' + ), + 'default' => 'a' + ), + 'type' => array( + 'type' => 'string', + 'default' => 'button' + ), + 'url' => array( + 'type' => 'string', + 'source' => 'attribute', + 'selector' => 'a', + 'attribute' => 'href', + 'role' => 'content' + ), + 'title' => array( + 'type' => 'string', + 'source' => 'attribute', + 'selector' => 'a,button', + 'attribute' => 'title', + 'role' => 'content' + ), + 'text' => array( + 'type' => 'rich-text', + 'source' => 'rich-text', + 'selector' => 'a,button', + 'role' => 'content' + ), + 'linkTarget' => array( + 'type' => 'string', + 'source' => 'attribute', + 'selector' => 'a', + 'attribute' => 'target', + 'role' => 'content' + ), + 'rel' => array( + 'type' => 'string', + 'source' => 'attribute', + 'selector' => 'a', + 'attribute' => 'rel', + 'role' => 'content' + ), + 'placeholder' => array( + 'type' => 'string' + ), + 'backgroundColor' => array( + 'type' => 'string' + ), + 'textColor' => array( + 'type' => 'string' + ), + 'gradient' => array( + 'type' => 'string' + ), + 'width' => array( + 'type' => 'number' + ) + ), + 'supports' => array( + 'anchor' => true, + 'splitting' => true, + 'align' => false, + 'alignWide' => false, + 'color' => array( + '__experimentalSkipSerialization' => true, + 'gradients' => true, + '__experimentalDefaultControls' => array( + 'background' => true, + 'text' => true + ) + ), + 'typography' => array( + '__experimentalSkipSerialization' => array( + 'fontSize', + 'lineHeight', + 'textAlign', + 'fontFamily', + 'fontWeight', + 'fontStyle', + 'textTransform', + 'textDecoration', + 'letterSpacing' + ), + 'fontSize' => true, + 'lineHeight' => true, + 'textAlign' => true, + '__experimentalFontFamily' => true, + '__experimentalFontWeight' => true, + '__experimentalFontStyle' => true, + '__experimentalTextTransform' => true, + '__experimentalTextDecoration' => true, + '__experimentalLetterSpacing' => true, + '__experimentalWritingMode' => true, + '__experimentalDefaultControls' => array( + 'fontSize' => true + ) + ), + 'reusable' => false, + 'shadow' => array( + '__experimentalSkipSerialization' => true + ), + 'spacing' => array( + '__experimentalSkipSerialization' => true, + 'padding' => array( + 'horizontal', + 'vertical' + ), + '__experimentalDefaultControls' => array( + 'padding' => true + ) + ), + '__experimentalBorder' => array( + 'color' => true, + 'radius' => true, + 'style' => true, + 'width' => true, + '__experimentalSkipSerialization' => true, + '__experimentalDefaultControls' => array( + 'color' => true, + 'radius' => true, + 'style' => true, + 'width' => true + ) + ), + 'interactivity' => array( + 'clientNavigation' => true + ) + ), + 'styles' => array( + array( + 'name' => 'fill', + 'label' => 'Fill', + 'isDefault' => true + ), + array( + 'name' => 'outline', + 'label' => 'Outline' + ) + ), + 'editorStyle' => 'wp-block-button-editor', + 'style' => 'wp-block-button', + 'selectors' => array( + 'root' => '.wp-block-button .wp-block-button__link', + 'typography' => array( + 'writingMode' => '.wp-block-button' + ) + ) + ), + 'buttons' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/buttons', + 'title' => 'Buttons', + 'category' => 'design', + 'allowedBlocks' => array( + 'core/button' + ), + 'description' => 'Prompt visitors to take action with a group of button-style links.', + 'keywords' => array( + 'link' + ), + 'textdomain' => 'default', + 'supports' => array( + 'anchor' => true, + 'align' => array( + 'wide', + 'full' + ), + 'html' => false, + '__experimentalExposeControlsToChildren' => true, + 'color' => array( + 'gradients' => true, + 'text' => false, + '__experimentalDefaultControls' => array( + 'background' => true + ) + ), + 'spacing' => array( + 'blockGap' => array( + 'horizontal', + 'vertical' + ), + 'padding' => true, + 'margin' => array( + 'top', + 'bottom' + ), + '__experimentalDefaultControls' => array( + 'blockGap' => true + ) + ), + 'typography' => array( + 'fontSize' => true, + 'lineHeight' => true, + '__experimentalFontFamily' => true, + '__experimentalFontWeight' => true, + '__experimentalFontStyle' => true, + '__experimentalTextTransform' => true, + '__experimentalTextDecoration' => true, + '__experimentalLetterSpacing' => true, + '__experimentalDefaultControls' => array( + 'fontSize' => true + ) + ), + '__experimentalBorder' => array( + 'color' => true, + 'radius' => true, + 'style' => true, + 'width' => true, + '__experimentalDefaultControls' => array( + 'color' => true, + 'radius' => true, + 'style' => true, + 'width' => true + ) + ), + 'layout' => array( + 'allowSwitching' => false, + 'allowInheriting' => false, + 'default' => array( + 'type' => 'flex' + ) + ), + 'interactivity' => array( + 'clientNavigation' => true + ), + 'listView' => true, + 'contentRole' => true + ), + 'editorStyle' => 'wp-block-buttons-editor', + 'style' => 'wp-block-buttons' + ), + 'calendar' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/calendar', + 'title' => 'Calendar', + 'category' => 'widgets', + 'description' => 'A calendar of your site’s posts.', + 'keywords' => array( + 'posts', + 'archive' + ), + 'textdomain' => 'default', + 'attributes' => array( + 'month' => array( + 'type' => 'integer' + ), + 'year' => array( + 'type' => 'integer' + ) + ), + 'supports' => array( + 'anchor' => true, + 'align' => true, + 'html' => false, + 'color' => array( + 'link' => true, + '__experimentalSkipSerialization' => array( + 'text', + 'background' + ), + '__experimentalDefaultControls' => array( + 'background' => true, + 'text' => true + ), + '__experimentalSelector' => 'table, th' + ), + 'typography' => array( + 'fontSize' => true, + 'lineHeight' => true, + '__experimentalFontFamily' => true, + '__experimentalFontWeight' => true, + '__experimentalFontStyle' => true, + '__experimentalTextTransform' => true, + '__experimentalLetterSpacing' => true, + '__experimentalDefaultControls' => array( + 'fontSize' => true + ) + ), + 'interactivity' => array( + 'clientNavigation' => true + ) + ), + 'style' => 'wp-block-calendar' + ), + 'categories' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/categories', + 'title' => 'Terms List', + 'category' => 'widgets', + 'description' => 'Display a list of all terms of a given taxonomy.', + 'keywords' => array( + 'categories' + ), + 'textdomain' => 'default', + 'attributes' => array( + 'taxonomy' => array( + 'type' => 'string', + 'default' => 'category' + ), + 'displayAsDropdown' => array( + 'type' => 'boolean', + 'default' => false + ), + 'showHierarchy' => array( + 'type' => 'boolean', + 'default' => false + ), + 'showPostCounts' => array( + 'type' => 'boolean', + 'default' => false + ), + 'showOnlyTopLevel' => array( + 'type' => 'boolean', + 'default' => false + ), + 'showEmpty' => array( + 'type' => 'boolean', + 'default' => false + ), + 'label' => array( + 'type' => 'string', + 'role' => 'content' + ), + 'showLabel' => array( + 'type' => 'boolean', + 'default' => true + ) + ), + 'usesContext' => array( + 'enhancedPagination' + ), + 'supports' => array( + 'anchor' => true, + 'align' => true, + 'html' => false, + 'spacing' => array( + 'margin' => true, + 'padding' => true, + '__experimentalDefaultControls' => array( + 'margin' => false, + 'padding' => false + ) + ), + 'typography' => array( + 'fontSize' => true, + 'lineHeight' => true, + '__experimentalFontFamily' => true, + '__experimentalFontWeight' => true, + '__experimentalFontStyle' => true, + '__experimentalTextTransform' => true, + '__experimentalTextDecoration' => true, + '__experimentalLetterSpacing' => true, + '__experimentalDefaultControls' => array( + 'fontSize' => true + ) + ), + 'color' => array( + 'gradients' => true, + 'link' => true, + '__experimentalDefaultControls' => array( + 'background' => true, + 'text' => true, + 'link' => true + ) + ), + 'interactivity' => array( + 'clientNavigation' => true + ), + '__experimentalBorder' => array( + 'radius' => true, + 'color' => true, + 'width' => true, + 'style' => true, + '__experimentalDefaultControls' => array( + 'radius' => true, + 'color' => true, + 'width' => true, + 'style' => true + ) + ) + ), + 'editorStyle' => 'wp-block-categories-editor', + 'style' => 'wp-block-categories' + ), + 'code' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/code', + 'title' => 'Code', + 'category' => 'text', + 'description' => 'Display code snippets that respect your spacing and tabs.', + 'textdomain' => 'default', + 'attributes' => array( + 'content' => array( + 'type' => 'rich-text', + 'source' => 'rich-text', + 'selector' => 'code', + '__unstablePreserveWhiteSpace' => true, + 'role' => 'content' + ) + ), + 'supports' => array( + 'align' => array( + 'wide' + ), + 'anchor' => true, + 'typography' => array( + 'fontSize' => true, + 'lineHeight' => true, + '__experimentalFontFamily' => true, + '__experimentalFontWeight' => true, + '__experimentalFontStyle' => true, + '__experimentalTextTransform' => true, + '__experimentalTextDecoration' => true, + '__experimentalLetterSpacing' => true, + '__experimentalDefaultControls' => array( + 'fontSize' => true + ) + ), + 'spacing' => array( + 'margin' => array( + 'top', + 'bottom' + ), + 'padding' => true, + '__experimentalDefaultControls' => array( + 'margin' => false, + 'padding' => false + ) + ), + '__experimentalBorder' => array( + 'radius' => true, + 'color' => true, + 'width' => true, + 'style' => true, + '__experimentalDefaultControls' => array( + 'width' => true, + 'color' => true + ) + ), + 'color' => array( + 'text' => true, + 'background' => true, + 'gradients' => true, + '__experimentalDefaultControls' => array( + 'background' => true, + 'text' => true + ) + ), + 'interactivity' => array( + 'clientNavigation' => true + ) + ), + 'style' => 'wp-block-code' + ), + 'column' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/column', + 'title' => 'Column', + 'category' => 'design', + 'parent' => array( + 'core/columns' + ), + 'description' => 'A single column within a columns block.', + 'textdomain' => 'default', + 'attributes' => array( + 'verticalAlignment' => array( + 'type' => 'string' + ), + 'width' => array( + 'type' => 'string' + ), + 'templateLock' => array( + 'type' => array( + 'string', + 'boolean' + ), + 'enum' => array( + 'all', + 'insert', + 'contentOnly', + false + ) + ) + ), + 'supports' => array( + '__experimentalOnEnter' => true, + 'anchor' => true, + 'reusable' => false, + 'html' => false, + 'color' => array( + 'gradients' => true, + 'heading' => true, + 'button' => true, + 'link' => true, + '__experimentalDefaultControls' => array( + 'background' => true, + 'text' => true + ) + ), + 'shadow' => true, + 'spacing' => array( + 'blockGap' => true, + 'padding' => true, + '__experimentalDefaultControls' => array( + 'padding' => true, + 'blockGap' => true + ) + ), + '__experimentalBorder' => array( + 'color' => true, + 'radius' => true, + 'style' => true, + 'width' => true, + '__experimentalDefaultControls' => array( + 'color' => true, + 'radius' => true, + 'style' => true, + 'width' => true + ) + ), + 'typography' => array( + 'fontSize' => true, + 'lineHeight' => true, + '__experimentalFontFamily' => true, + '__experimentalFontWeight' => true, + '__experimentalFontStyle' => true, + '__experimentalTextTransform' => true, + '__experimentalTextDecoration' => true, + '__experimentalLetterSpacing' => true, + '__experimentalDefaultControls' => array( + 'fontSize' => true + ) + ), + 'layout' => true, + 'interactivity' => array( + 'clientNavigation' => true + ), + 'allowedBlocks' => true + ) + ), + 'columns' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/columns', + 'title' => 'Columns', + 'category' => 'design', + 'allowedBlocks' => array( + 'core/column' + ), + 'description' => 'Display content in multiple columns, with blocks added to each column.', + 'textdomain' => 'default', + 'attributes' => array( + 'verticalAlignment' => array( + 'type' => 'string' + ), + 'isStackedOnMobile' => array( + 'type' => 'boolean', + 'default' => true + ), + 'templateLock' => array( + 'type' => array( + 'string', + 'boolean' + ), + 'enum' => array( + 'all', + 'insert', + 'contentOnly', + false + ) + ) + ), + 'supports' => array( + 'anchor' => true, + 'align' => array( + 'wide', + 'full' + ), + 'html' => false, + 'color' => array( + 'gradients' => true, + 'link' => true, + 'heading' => true, + 'button' => true, + '__experimentalDefaultControls' => array( + 'background' => true, + 'text' => true + ) + ), + 'spacing' => array( + 'blockGap' => array( + '__experimentalDefault' => '2em', + 'sides' => array( + 'horizontal', + 'vertical' + ) + ), + 'margin' => array( + 'top', + 'bottom' + ), + 'padding' => true, + '__experimentalDefaultControls' => array( + 'padding' => true, + 'blockGap' => true + ) + ), + 'layout' => array( + 'allowSwitching' => false, + 'allowInheriting' => false, + 'allowEditing' => false, + 'default' => array( + 'type' => 'flex', + 'flexWrap' => 'nowrap' + ) + ), + '__experimentalBorder' => array( + 'color' => true, + 'radius' => true, + 'style' => true, + 'width' => true, + '__experimentalDefaultControls' => array( + 'color' => true, + 'radius' => true, + 'style' => true, + 'width' => true + ) + ), + 'typography' => array( + 'fontSize' => true, + 'lineHeight' => true, + '__experimentalFontFamily' => true, + '__experimentalFontWeight' => true, + '__experimentalFontStyle' => true, + '__experimentalTextTransform' => true, + '__experimentalTextDecoration' => true, + '__experimentalLetterSpacing' => true, + '__experimentalDefaultControls' => array( + 'fontSize' => true + ) + ), + 'interactivity' => array( + 'clientNavigation' => true + ), + 'shadow' => true + ), + 'editorStyle' => 'wp-block-columns-editor', + 'style' => 'wp-block-columns' + ), + 'comment-author-name' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/comment-author-name', + 'title' => 'Comment Author Name', + 'category' => 'theme', + 'ancestor' => array( + 'core/comment-template' + ), + 'description' => 'Displays the name of the author of the comment.', + 'textdomain' => 'default', + 'attributes' => array( + 'isLink' => array( + 'type' => 'boolean', + 'default' => true + ), + 'linkTarget' => array( + 'type' => 'string', + 'default' => '_self' + ) + ), + 'usesContext' => array( + 'commentId' + ), + 'supports' => array( + 'anchor' => true, + 'html' => false, + 'spacing' => array( + 'margin' => true, + 'padding' => true + ), + 'color' => array( + 'gradients' => true, + 'link' => true, + '__experimentalDefaultControls' => array( + 'background' => true, + 'text' => true, + 'link' => true + ) + ), + 'typography' => array( + 'fontSize' => true, + 'lineHeight' => true, + 'textAlign' => true, + '__experimentalFontFamily' => true, + '__experimentalFontWeight' => true, + '__experimentalFontStyle' => true, + '__experimentalTextTransform' => true, + '__experimentalTextDecoration' => true, + '__experimentalLetterSpacing' => true, + '__experimentalDefaultControls' => array( + 'fontSize' => true + ) + ), + 'interactivity' => array( + 'clientNavigation' => true + ), + '__experimentalBorder' => array( + 'radius' => true, + 'color' => true, + 'width' => true, + 'style' => true, + '__experimentalDefaultControls' => array( + 'radius' => true, + 'color' => true, + 'width' => true, + 'style' => true + ) + ) + ), + 'style' => 'wp-block-comment-author-name' + ), + 'comment-content' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/comment-content', + 'title' => 'Comment Content', + 'category' => 'theme', + 'ancestor' => array( + 'core/comment-template' + ), + 'description' => 'Displays the contents of a comment.', + 'textdomain' => 'default', + 'usesContext' => array( + 'commentId' + ), + 'supports' => array( + 'anchor' => true, + 'color' => array( + 'gradients' => true, + 'link' => true, + '__experimentalDefaultControls' => array( + 'background' => true, + 'text' => true + ) + ), + 'typography' => array( + 'fontSize' => true, + 'lineHeight' => true, + 'textAlign' => true, + '__experimentalFontFamily' => true, + '__experimentalFontWeight' => true, + '__experimentalFontStyle' => true, + '__experimentalTextTransform' => true, + '__experimentalTextDecoration' => true, + '__experimentalLetterSpacing' => true, + '__experimentalDefaultControls' => array( + 'fontSize' => true + ) + ), + '__experimentalBorder' => array( + 'radius' => true, + 'color' => true, + 'width' => true, + 'style' => true, + '__experimentalDefaultControls' => array( + 'radius' => true, + 'color' => true, + 'width' => true, + 'style' => true + ) + ), + 'spacing' => array( + 'padding' => array( + 'horizontal', + 'vertical' + ), + '__experimentalDefaultControls' => array( + 'padding' => true + ) + ), + 'html' => false + ), + 'style' => 'wp-block-comment-content' + ), + 'comment-date' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/comment-date', + 'title' => 'Comment Date', + 'category' => 'theme', + 'ancestor' => array( + 'core/comment-template' + ), + 'description' => 'Displays the date on which the comment was posted.', + 'textdomain' => 'default', + 'attributes' => array( + 'format' => array( + 'type' => 'string' + ), + 'isLink' => array( + 'type' => 'boolean', + 'default' => true + ) + ), + 'usesContext' => array( + 'commentId' + ), + 'supports' => array( + 'anchor' => true, + 'html' => false, + 'color' => array( + 'gradients' => true, + 'link' => true, + '__experimentalDefaultControls' => array( + 'background' => true, + 'text' => true, + 'link' => true + ) + ), + 'spacing' => array( + 'margin' => true, + 'padding' => true + ), + 'typography' => array( + 'fontSize' => true, + 'lineHeight' => true, + 'textAlign' => true, + '__experimentalFontFamily' => true, + '__experimentalFontWeight' => true, + '__experimentalFontStyle' => true, + '__experimentalTextTransform' => true, + '__experimentalTextDecoration' => true, + '__experimentalLetterSpacing' => true, + '__experimentalDefaultControls' => array( + 'fontSize' => true + ) + ), + 'interactivity' => array( + 'clientNavigation' => true + ), + '__experimentalBorder' => array( + 'radius' => true, + 'color' => true, + 'width' => true, + 'style' => true, + '__experimentalDefaultControls' => array( + 'radius' => true, + 'color' => true, + 'width' => true, + 'style' => true + ) + ) + ), + 'style' => 'wp-block-comment-date' + ), + 'comment-edit-link' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/comment-edit-link', + 'title' => 'Comment Edit Link', + 'category' => 'theme', + 'ancestor' => array( + 'core/comment-template' + ), + 'description' => 'Displays a link to edit the comment in the WordPress Dashboard. This link is only visible to users with the edit comment capability.', + 'textdomain' => 'default', + 'usesContext' => array( + 'commentId' + ), + 'attributes' => array( + 'linkTarget' => array( + 'type' => 'string', + 'default' => '_self' + ) + ), + 'supports' => array( + 'anchor' => true, + 'html' => false, + 'color' => array( + 'link' => true, + 'gradients' => true, + 'text' => false, + '__experimentalDefaultControls' => array( + 'background' => true, + 'link' => true + ) + ), + 'spacing' => array( + 'margin' => true, + 'padding' => true, + '__experimentalDefaultControls' => array( + 'margin' => false, + 'padding' => false + ) + ), + 'typography' => array( + 'fontSize' => true, + 'lineHeight' => true, + 'textAlign' => true, + '__experimentalFontFamily' => true, + '__experimentalFontWeight' => true, + '__experimentalFontStyle' => true, + '__experimentalTextTransform' => true, + '__experimentalTextDecoration' => true, + '__experimentalLetterSpacing' => true, + '__experimentalDefaultControls' => array( + 'fontSize' => true + ) + ), + 'interactivity' => array( + 'clientNavigation' => true + ), + '__experimentalBorder' => array( + 'radius' => true, + 'color' => true, + 'width' => true, + 'style' => true + ) + ), + 'style' => 'wp-block-comment-edit-link' + ), + 'comment-reply-link' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/comment-reply-link', + 'title' => 'Comment Reply Link', + 'category' => 'theme', + 'ancestor' => array( + 'core/comment-template' + ), + 'description' => 'Displays a link to reply to a comment.', + 'textdomain' => 'default', + 'usesContext' => array( + 'commentId' + ), + 'supports' => array( + 'anchor' => true, + 'color' => array( + 'gradients' => true, + 'link' => true, + 'text' => false, + '__experimentalDefaultControls' => array( + 'background' => true, + 'link' => true + ) + ), + 'spacing' => array( + 'margin' => true, + 'padding' => true, + '__experimentalDefaultControls' => array( + 'margin' => false, + 'padding' => false + ) + ), + 'typography' => array( + 'fontSize' => true, + 'lineHeight' => true, + 'textAlign' => true, + '__experimentalFontFamily' => true, + '__experimentalFontWeight' => true, + '__experimentalFontStyle' => true, + '__experimentalTextTransform' => true, + '__experimentalTextDecoration' => true, + '__experimentalLetterSpacing' => true, + '__experimentalDefaultControls' => array( + 'fontSize' => true + ) + ), + '__experimentalBorder' => array( + 'radius' => true, + 'color' => true, + 'width' => true, + 'style' => true + ), + 'html' => false + ), + 'style' => 'wp-block-comment-reply-link' + ), + 'comment-template' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/comment-template', + 'title' => 'Comment Template', + 'category' => 'design', + 'parent' => array( + 'core/comments' + ), + 'description' => 'Contains the block elements used to display a comment, like the title, date, author, avatar and more.', + 'textdomain' => 'default', + 'usesContext' => array( + 'postId' + ), + 'supports' => array( + 'anchor' => true, + 'align' => true, + 'html' => false, + 'reusable' => false, + 'spacing' => array( + 'margin' => true, + 'padding' => true + ), + 'typography' => array( + 'fontSize' => true, + 'lineHeight' => true, + '__experimentalFontFamily' => true, + '__experimentalFontWeight' => true, + '__experimentalFontStyle' => true, + '__experimentalTextTransform' => true, + '__experimentalTextDecoration' => true, + '__experimentalLetterSpacing' => true, + '__experimentalDefaultControls' => array( + 'fontSize' => true + ) + ), + 'interactivity' => array( + 'clientNavigation' => true + ), + '__experimentalBorder' => array( + 'radius' => true, + 'color' => true, + 'width' => true, + 'style' => true, + '__experimentalDefaultControls' => array( + 'radius' => true, + 'color' => true, + 'width' => true, + 'style' => true + ) + ) + ), + 'style' => 'wp-block-comment-template' + ), + 'comments' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/comments', + 'title' => 'Comments', + 'category' => 'theme', + 'description' => 'An advanced block that allows displaying post comments using different visual configurations.', + 'textdomain' => 'default', + 'attributes' => array( + 'tagName' => array( + 'type' => 'string', + 'default' => 'div' + ), + 'legacy' => array( + 'type' => 'boolean', + 'default' => false + ) + ), + 'supports' => array( + 'anchor' => true, + 'align' => array( + 'wide', + 'full' + ), + 'html' => false, + 'color' => array( + 'gradients' => true, + 'heading' => true, + 'link' => true, + '__experimentalDefaultControls' => array( + 'background' => true, + 'text' => true, + 'link' => true + ) + ), + 'spacing' => array( + 'margin' => true, + 'padding' => true + ), + 'typography' => array( + 'fontSize' => true, + 'lineHeight' => true, + '__experimentalFontFamily' => true, + '__experimentalFontWeight' => true, + '__experimentalFontStyle' => true, + '__experimentalTextTransform' => true, + '__experimentalTextDecoration' => true, + '__experimentalLetterSpacing' => true, + '__experimentalDefaultControls' => array( + 'fontSize' => true + ) + ), + '__experimentalBorder' => array( + 'radius' => true, + 'color' => true, + 'width' => true, + 'style' => true, + '__experimentalDefaultControls' => array( + 'radius' => true, + 'color' => true, + 'width' => true, + 'style' => true + ) + ) + ), + 'editorStyle' => 'wp-block-comments-editor', + 'usesContext' => array( + 'postId', + 'postType' + ) + ), + 'comments-pagination' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/comments-pagination', + 'title' => 'Comments Pagination', + 'category' => 'theme', + 'parent' => array( + 'core/comments' + ), + 'allowedBlocks' => array( + 'core/comments-pagination-previous', + 'core/comments-pagination-numbers', + 'core/comments-pagination-next' + ), + 'description' => 'Displays a paginated navigation to next/previous set of comments, when applicable.', + 'textdomain' => 'default', + 'attributes' => array( + 'paginationArrow' => array( + 'type' => 'string', + 'default' => 'none' + ) + ), + 'example' => array( + 'attributes' => array( + 'paginationArrow' => 'none' + ) + ), + 'providesContext' => array( + 'comments/paginationArrow' => 'paginationArrow' + ), + 'supports' => array( + 'anchor' => true, + 'align' => true, + 'reusable' => false, + 'html' => false, + 'color' => array( + 'gradients' => true, + 'link' => true, + '__experimentalDefaultControls' => array( + 'background' => true, + 'text' => true, + 'link' => true + ) + ), + 'layout' => array( + 'allowSwitching' => false, + 'allowInheriting' => false, + 'default' => array( + 'type' => 'flex' + ) + ), + 'typography' => array( + 'fontSize' => true, + 'lineHeight' => true, + '__experimentalFontFamily' => true, + '__experimentalFontWeight' => true, + '__experimentalFontStyle' => true, + '__experimentalTextTransform' => true, + '__experimentalTextDecoration' => true, + '__experimentalLetterSpacing' => true, + '__experimentalDefaultControls' => array( + 'fontSize' => true + ) + ), + 'interactivity' => array( + 'clientNavigation' => true + ) + ), + 'editorStyle' => 'wp-block-comments-pagination-editor', + 'style' => 'wp-block-comments-pagination' + ), + 'comments-pagination-next' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/comments-pagination-next', + 'title' => 'Comments Next Page', + 'category' => 'theme', + 'parent' => array( + 'core/comments-pagination' + ), + 'description' => 'Displays the next comment\'s page link.', + 'textdomain' => 'default', + 'attributes' => array( + 'label' => array( + 'type' => 'string' + ) + ), + 'usesContext' => array( + 'postId', + 'comments/paginationArrow' + ), + 'supports' => array( + 'anchor' => true, + 'reusable' => false, + 'html' => false, + 'color' => array( + 'gradients' => true, + 'text' => false, + '__experimentalDefaultControls' => array( + 'background' => true + ) + ), + 'typography' => array( + 'fontSize' => true, + 'lineHeight' => true, + '__experimentalFontFamily' => true, + '__experimentalFontWeight' => true, + '__experimentalFontStyle' => true, + '__experimentalTextTransform' => true, + '__experimentalTextDecoration' => true, + '__experimentalLetterSpacing' => true, + '__experimentalDefaultControls' => array( + 'fontSize' => true + ) + ), + 'interactivity' => array( + 'clientNavigation' => true + ) + ) + ), + 'comments-pagination-numbers' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/comments-pagination-numbers', + 'title' => 'Comments Page Numbers', + 'category' => 'theme', + 'parent' => array( + 'core/comments-pagination' + ), + 'description' => 'Displays a list of page numbers for comments pagination.', + 'textdomain' => 'default', + 'usesContext' => array( + 'postId' + ), + 'supports' => array( + 'anchor' => true, + 'reusable' => false, + 'html' => false, + 'color' => array( + 'gradients' => true, + 'text' => false, + '__experimentalDefaultControls' => array( + 'background' => true + ) + ), + 'typography' => array( + 'fontSize' => true, + 'lineHeight' => true, + '__experimentalFontFamily' => true, + '__experimentalFontWeight' => true, + '__experimentalFontStyle' => true, + '__experimentalTextTransform' => true, + '__experimentalTextDecoration' => true, + '__experimentalLetterSpacing' => true, + '__experimentalDefaultControls' => array( + 'fontSize' => true + ) + ), + 'interactivity' => array( + 'clientNavigation' => true + ), + 'spacing' => array( + 'margin' => true, + 'padding' => true, + '__experimentalDefaultControls' => array( + 'padding' => true + ) + ) + ) + ), + 'comments-pagination-previous' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/comments-pagination-previous', + 'title' => 'Comments Previous Page', + 'category' => 'theme', + 'parent' => array( + 'core/comments-pagination' + ), + 'description' => 'Displays the previous comment\'s page link.', + 'textdomain' => 'default', + 'attributes' => array( + 'label' => array( + 'type' => 'string' + ) + ), + 'usesContext' => array( + 'postId', + 'comments/paginationArrow' + ), + 'supports' => array( + 'anchor' => true, + 'reusable' => false, + 'html' => false, + 'color' => array( + 'gradients' => true, + 'text' => false, + '__experimentalDefaultControls' => array( + 'background' => true + ) + ), + 'typography' => array( + 'fontSize' => true, + 'lineHeight' => true, + '__experimentalFontFamily' => true, + '__experimentalFontWeight' => true, + '__experimentalFontStyle' => true, + '__experimentalTextTransform' => true, + '__experimentalTextDecoration' => true, + '__experimentalLetterSpacing' => true, + '__experimentalDefaultControls' => array( + 'fontSize' => true + ) + ), + 'interactivity' => array( + 'clientNavigation' => true + ) + ) + ), + 'comments-title' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/comments-title', + 'title' => 'Comments Title', + 'category' => 'theme', + 'ancestor' => array( + 'core/comments' + ), + 'description' => 'Displays a title with the number of comments.', + 'textdomain' => 'default', + 'usesContext' => array( + 'postId', + 'postType' + ), + 'attributes' => array( + 'showPostTitle' => array( + 'type' => 'boolean', + 'default' => true + ), + 'showCommentsCount' => array( + 'type' => 'boolean', + 'default' => true + ), + 'level' => array( + 'type' => 'number', + 'default' => 2 + ), + 'levelOptions' => array( + 'type' => 'array' + ) + ), + 'supports' => array( + 'anchor' => true, + 'align' => true, + 'html' => false, + '__experimentalBorder' => array( + 'radius' => true, + 'color' => true, + 'width' => true, + 'style' => true + ), + 'color' => array( + 'gradients' => true, + '__experimentalDefaultControls' => array( + 'background' => true, + 'text' => true + ) + ), + 'spacing' => array( + 'margin' => true, + 'padding' => true + ), + 'typography' => array( + 'fontSize' => true, + 'lineHeight' => true, + 'textAlign' => true, + '__experimentalFontFamily' => true, + '__experimentalFontWeight' => true, + '__experimentalFontStyle' => true, + '__experimentalTextTransform' => true, + '__experimentalTextDecoration' => true, + '__experimentalLetterSpacing' => true, + '__experimentalDefaultControls' => array( + 'fontSize' => true, + '__experimentalFontFamily' => true, + '__experimentalFontStyle' => true, + '__experimentalFontWeight' => true + ) + ), + 'interactivity' => array( + 'clientNavigation' => true + ) + ) + ), + 'cover' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/cover', + 'title' => 'Cover', + 'category' => 'media', + 'description' => 'Add an image or video with a text overlay.', + 'textdomain' => 'default', + 'attributes' => array( + 'url' => array( + 'type' => 'string', + 'role' => 'content' + ), + 'useFeaturedImage' => array( + 'type' => 'boolean', + 'default' => false + ), + 'id' => array( + 'type' => 'number' + ), + 'alt' => array( + 'type' => 'string', + 'default' => '' + ), + 'hasParallax' => array( + 'type' => 'boolean', + 'default' => false + ), + 'isRepeated' => array( + 'type' => 'boolean', + 'default' => false + ), + 'dimRatio' => array( + 'type' => 'number', + 'default' => 100 + ), + 'overlayColor' => array( + 'type' => 'string' + ), + 'customOverlayColor' => array( + 'type' => 'string' + ), + 'isUserOverlayColor' => array( + 'type' => 'boolean' + ), + 'backgroundType' => array( + 'type' => 'string', + 'default' => 'image' + ), + 'focalPoint' => array( + 'type' => 'object' + ), + 'minHeight' => array( + 'type' => 'number' + ), + 'minHeightUnit' => array( + 'type' => 'string' + ), + 'gradient' => array( + 'type' => 'string' + ), + 'customGradient' => array( + 'type' => 'string' + ), + 'contentPosition' => array( + 'type' => 'string' + ), + 'isDark' => array( + 'type' => 'boolean', + 'default' => true + ), + 'templateLock' => array( + 'type' => array( + 'string', + 'boolean' + ), + 'enum' => array( + 'all', + 'insert', + 'contentOnly', + false + ) + ), + 'tagName' => array( + 'type' => 'string', + 'default' => 'div' + ), + 'sizeSlug' => array( + 'type' => 'string' + ), + 'poster' => array( + 'type' => 'string', + 'source' => 'attribute', + 'selector' => 'video', + 'attribute' => 'poster' + ) + ), + 'usesContext' => array( + 'postId', + 'postType' + ), + 'supports' => array( + 'anchor' => true, + 'align' => true, + 'html' => false, + 'shadow' => true, + 'spacing' => array( + 'padding' => true, + 'margin' => array( + 'top', + 'bottom' + ), + 'blockGap' => true, + '__experimentalDefaultControls' => array( + 'padding' => true, + 'blockGap' => true + ) + ), + '__experimentalBorder' => array( + 'color' => true, + 'radius' => true, + 'style' => true, + 'width' => true, + '__experimentalDefaultControls' => array( + 'color' => true, + 'radius' => true, + 'style' => true, + 'width' => true + ) + ), + 'color' => array( + 'heading' => true, + 'text' => true, + 'background' => false, + '__experimentalSkipSerialization' => array( + 'gradients' + ), + 'enableContrastChecker' => false + ), + 'dimensions' => array( + 'aspectRatio' => true + ), + 'typography' => array( + 'fontSize' => true, + 'lineHeight' => true, + '__experimentalFontFamily' => true, + '__experimentalFontWeight' => true, + '__experimentalFontStyle' => true, + '__experimentalTextTransform' => true, + '__experimentalTextDecoration' => true, + '__experimentalLetterSpacing' => true, + '__experimentalDefaultControls' => array( + 'fontSize' => true + ) + ), + 'layout' => array( + 'allowJustification' => false + ), + 'interactivity' => array( + 'clientNavigation' => true + ), + 'filter' => array( + 'duotone' => true + ), + 'allowedBlocks' => true + ), + 'selectors' => array( + 'filter' => array( + 'duotone' => '.wp-block-cover > .wp-block-cover__image-background, .wp-block-cover > .wp-block-cover__video-background' + ) + ), + 'editorStyle' => 'wp-block-cover-editor', + 'style' => 'wp-block-cover' + ), + 'details' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/details', + 'title' => 'Details', + 'category' => 'text', + 'description' => 'Hide and show additional content.', + 'keywords' => array( + 'summary', + 'toggle', + 'disclosure' + ), + 'textdomain' => 'default', + 'attributes' => array( + 'showContent' => array( + 'type' => 'boolean', + 'default' => false + ), + 'summary' => array( + 'type' => 'rich-text', + 'source' => 'rich-text', + 'selector' => 'summary', + 'role' => 'content' + ), + 'name' => array( + 'type' => 'string', + 'source' => 'attribute', + 'attribute' => 'name', + 'selector' => '.wp-block-details' + ), + 'placeholder' => array( + 'type' => 'string' + ) + ), + 'supports' => array( + '__experimentalOnEnter' => true, + 'align' => array( + 'wide', + 'full' + ), + 'anchor' => true, + 'color' => array( + 'gradients' => true, + 'link' => true, + '__experimentalDefaultControls' => array( + 'background' => true, + 'text' => true + ) + ), + '__experimentalBorder' => array( + 'color' => true, + 'width' => true, + 'style' => true + ), + 'html' => false, + 'spacing' => array( + 'margin' => true, + 'padding' => true, + 'blockGap' => true, + '__experimentalDefaultControls' => array( + 'margin' => false, + 'padding' => false + ) + ), + 'typography' => array( + 'fontSize' => true, + 'lineHeight' => true, + '__experimentalFontFamily' => true, + '__experimentalFontWeight' => true, + '__experimentalFontStyle' => true, + '__experimentalTextTransform' => true, + '__experimentalTextDecoration' => true, + '__experimentalLetterSpacing' => true, + '__experimentalDefaultControls' => array( + 'fontSize' => true + ) + ), + 'layout' => array( + 'allowEditing' => false + ), + 'interactivity' => array( + 'clientNavigation' => true + ), + 'allowedBlocks' => true + ), + 'editorStyle' => 'wp-block-details-editor', + 'style' => 'wp-block-details' + ), + 'embed' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/embed', + 'title' => 'Embed', + 'category' => 'embed', + 'description' => 'Add a block that displays content pulled from other sites, like Twitter or YouTube.', + 'textdomain' => 'default', + 'attributes' => array( + 'url' => array( + 'type' => 'string', + 'role' => 'content' + ), + 'caption' => array( + 'type' => 'rich-text', + 'source' => 'rich-text', + 'selector' => 'figcaption', + 'role' => 'content' + ), + 'type' => array( + 'type' => 'string', + 'role' => 'content' + ), + 'providerNameSlug' => array( + 'type' => 'string', + 'role' => 'content' + ), + 'allowResponsive' => array( + 'type' => 'boolean', + 'default' => true + ), + 'responsive' => array( + 'type' => 'boolean', + 'default' => false, + 'role' => 'content' + ), + 'previewable' => array( + 'type' => 'boolean', + 'default' => true, + 'role' => 'content' + ) + ), + 'supports' => array( + 'anchor' => true, + 'align' => true, + 'spacing' => array( + 'margin' => true + ), + 'interactivity' => array( + 'clientNavigation' => true + ) + ), + 'editorStyle' => 'wp-block-embed-editor', + 'style' => 'wp-block-embed' + ), + 'file' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/file', + 'title' => 'File', + 'category' => 'media', + 'description' => 'Add a link to a downloadable file.', + 'keywords' => array( + 'document', + 'pdf', + 'download' + ), + 'textdomain' => 'default', + 'attributes' => array( + 'id' => array( + 'type' => 'number' + ), + 'blob' => array( + 'type' => 'string', + 'role' => 'local' + ), + 'href' => array( + 'type' => 'string', + 'role' => 'content' + ), + 'fileId' => array( + 'type' => 'string', + 'source' => 'attribute', + 'selector' => 'a:not([download])', + 'attribute' => 'id' + ), + 'fileName' => array( + 'type' => 'rich-text', + 'source' => 'rich-text', + 'selector' => 'a:not([download])', + 'role' => 'content' + ), + 'textLinkHref' => array( + 'type' => 'string', + 'source' => 'attribute', + 'selector' => 'a:not([download])', + 'attribute' => 'href', + 'role' => 'content' + ), + 'textLinkTarget' => array( + 'type' => 'string', + 'source' => 'attribute', + 'selector' => 'a:not([download])', + 'attribute' => 'target' + ), + 'showDownloadButton' => array( + 'type' => 'boolean', + 'default' => true + ), + 'downloadButtonText' => array( + 'type' => 'rich-text', + 'source' => 'rich-text', + 'selector' => 'a[download]', + 'role' => 'content' + ), + 'displayPreview' => array( + 'type' => 'boolean' + ), + 'previewHeight' => array( + 'type' => 'number', + 'default' => 600 + ) + ), + 'supports' => array( + 'anchor' => true, + 'align' => true, + 'spacing' => array( + 'margin' => true, + 'padding' => true + ), + 'color' => array( + 'gradients' => true, + 'link' => true, + 'text' => false, + '__experimentalDefaultControls' => array( + 'background' => true, + 'link' => true + ) + ), + '__experimentalBorder' => array( + 'radius' => true, + 'color' => true, + 'width' => true, + 'style' => true, + '__experimentalDefaultControls' => array( + 'radius' => true, + 'color' => true, + 'width' => true, + 'style' => true + ) + ), + 'interactivity' => true + ), + 'editorStyle' => 'wp-block-file-editor', + 'style' => 'wp-block-file' + ), + 'footnotes' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/footnotes', + 'title' => 'Footnotes', + 'category' => 'text', + 'description' => 'Display footnotes added to the page.', + 'keywords' => array( + 'references' + ), + 'textdomain' => 'default', + 'usesContext' => array( + 'postId', + 'postType' + ), + 'supports' => array( + 'anchor' => true, + '__experimentalBorder' => array( + 'radius' => true, + 'color' => true, + 'width' => true, + 'style' => true, + '__experimentalDefaultControls' => array( + 'radius' => false, + 'color' => false, + 'width' => false, + 'style' => false + ) + ), + 'color' => array( + 'background' => true, + 'link' => true, + 'text' => true, + '__experimentalDefaultControls' => array( + 'link' => true, + 'text' => true + ) + ), + 'html' => false, + 'multiple' => false, + 'reusable' => false, + 'inserter' => false, + 'spacing' => array( + 'margin' => true, + 'padding' => true, + '__experimentalDefaultControls' => array( + 'margin' => false, + 'padding' => false + ) + ), + 'typography' => array( + 'fontSize' => true, + 'lineHeight' => true, + '__experimentalFontFamily' => true, + '__experimentalTextDecoration' => true, + '__experimentalFontStyle' => true, + '__experimentalFontWeight' => true, + '__experimentalLetterSpacing' => true, + '__experimentalTextTransform' => true, + '__experimentalWritingMode' => true, + '__experimentalDefaultControls' => array( + 'fontSize' => true + ) + ), + 'interactivity' => array( + 'clientNavigation' => true + ) + ), + 'style' => 'wp-block-footnotes' + ), + 'freeform' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/freeform', + 'title' => 'Classic', + 'category' => 'text', + 'description' => 'Use the classic WordPress editor.', + 'textdomain' => 'default', + 'attributes' => array( + 'content' => array( + 'type' => 'string', + 'source' => 'raw' + ) + ), + 'supports' => array( + 'className' => false, + 'customClassName' => false, + 'lock' => false, + 'reusable' => false, + 'renaming' => false, + 'visibility' => false, + 'customCSS' => false + ), + 'editorStyle' => 'wp-block-freeform-editor' + ), + 'gallery' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/gallery', + 'title' => 'Gallery', + 'category' => 'media', + 'usesContext' => array( + 'galleryId' + ), + 'allowedBlocks' => array( + 'core/image' + ), + 'description' => 'Display multiple images in a rich gallery.', + 'keywords' => array( + 'images', + 'photos' + ), + 'textdomain' => 'default', + 'attributes' => array( + 'images' => array( + 'type' => 'array', + 'default' => array( + + ), + 'source' => 'query', + 'selector' => '.blocks-gallery-item', + 'query' => array( + 'url' => array( + 'type' => 'string', + 'source' => 'attribute', + 'selector' => 'img', + 'attribute' => 'src' + ), + 'fullUrl' => array( + 'type' => 'string', + 'source' => 'attribute', + 'selector' => 'img', + 'attribute' => 'data-full-url' + ), + 'link' => array( + 'type' => 'string', + 'source' => 'attribute', + 'selector' => 'img', + 'attribute' => 'data-link' + ), + 'alt' => array( + 'type' => 'string', + 'source' => 'attribute', + 'selector' => 'img', + 'attribute' => 'alt', + 'default' => '' + ), + 'id' => array( + 'type' => 'string', + 'source' => 'attribute', + 'selector' => 'img', + 'attribute' => 'data-id' + ), + 'caption' => array( + 'type' => 'rich-text', + 'source' => 'rich-text', + 'selector' => '.blocks-gallery-item__caption' + ) + ) + ), + 'ids' => array( + 'type' => 'array', + 'items' => array( + 'type' => 'number' + ), + 'default' => array( + + ) + ), + 'navigationButtonType' => array( + 'type' => 'string', + 'default' => 'icon', + 'enum' => array( + 'icon', + 'text', + 'both' + ) + ), + 'shortCodeTransforms' => array( + 'type' => 'array', + 'items' => array( + 'type' => 'object' + ), + 'default' => array( + + ) + ), + 'columns' => array( + 'type' => 'number', + 'minimum' => 1, + 'maximum' => 8 + ), + 'caption' => array( + 'type' => 'rich-text', + 'source' => 'rich-text', + 'selector' => '.blocks-gallery-caption', + 'role' => 'content' + ), + 'imageCrop' => array( + 'type' => 'boolean', + 'default' => true + ), + 'randomOrder' => array( + 'type' => 'boolean', + 'default' => false + ), + 'fixedHeight' => array( + 'type' => 'boolean', + 'default' => true + ), + 'linkTarget' => array( + 'type' => 'string' + ), + 'linkTo' => array( + 'type' => 'string' + ), + 'sizeSlug' => array( + 'type' => 'string', + 'default' => 'large' + ), + 'allowResize' => array( + 'type' => 'boolean', + 'default' => false + ), + 'aspectRatio' => array( + 'type' => 'string', + 'default' => 'auto' + ) + ), + 'providesContext' => array( + 'allowResize' => 'allowResize', + 'imageCrop' => 'imageCrop', + 'fixedHeight' => 'fixedHeight', + 'navigationButtonType' => 'navigationButtonType' + ), + 'supports' => array( + 'anchor' => true, + 'align' => true, + '__experimentalBorder' => array( + 'radius' => true, + 'color' => true, + 'width' => true, + 'style' => true, + '__experimentalDefaultControls' => array( + 'color' => true, + 'radius' => true + ) + ), + 'html' => false, + 'units' => array( + 'px', + 'em', + 'rem', + 'vh', + 'vw' + ), + 'spacing' => array( + 'margin' => true, + 'padding' => true, + 'blockGap' => array( + 'horizontal', + 'vertical' + ), + '__experimentalSkipSerialization' => array( + 'blockGap' + ), + '__experimentalDefaultControls' => array( + 'blockGap' => true, + 'margin' => false, + 'padding' => false + ) + ), + 'color' => array( + 'text' => false, + 'background' => true, + 'gradients' => true + ), + 'layout' => array( + 'allowSwitching' => false, + 'allowInheriting' => false, + 'allowEditing' => false, + 'default' => array( + 'type' => 'flex' + ) + ), + 'interactivity' => array( + 'clientNavigation' => true + ), + 'listView' => true + ), + 'editorStyle' => 'wp-block-gallery-editor', + 'style' => 'wp-block-gallery' + ), + 'group' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/group', + 'title' => 'Group', + 'category' => 'design', + 'description' => 'Gather blocks in a layout container.', + 'keywords' => array( + 'container', + 'wrapper', + 'row', + 'section' + ), + 'textdomain' => 'default', + 'attributes' => array( + 'tagName' => array( + 'type' => 'string', + 'default' => 'div' + ), + 'templateLock' => array( + 'type' => array( + 'string', + 'boolean' + ), + 'enum' => array( + 'all', + 'insert', + 'contentOnly', + false + ) + ) + ), + 'supports' => array( + '__experimentalOnEnter' => true, + '__experimentalOnMerge' => true, + '__experimentalSettings' => true, + 'align' => array( + 'wide', + 'full' + ), + 'anchor' => true, + 'ariaLabel' => true, + 'html' => false, + 'background' => array( + 'backgroundImage' => true, + 'backgroundSize' => true, + '__experimentalDefaultControls' => array( + 'backgroundImage' => true + ) + ), + 'color' => array( + 'gradients' => true, + 'heading' => true, + 'button' => true, + 'link' => true, + '__experimentalDefaultControls' => array( + 'background' => true, + 'text' => true + ) + ), + 'shadow' => true, + 'spacing' => array( + 'margin' => array( + 'top', + 'bottom' + ), + 'padding' => true, + 'blockGap' => true, + '__experimentalDefaultControls' => array( + 'padding' => true, + 'blockGap' => true + ) + ), + 'dimensions' => array( + 'minHeight' => true + ), + '__experimentalBorder' => array( + 'color' => true, + 'radius' => true, + 'style' => true, + 'width' => true, + '__experimentalDefaultControls' => array( + 'color' => true, + 'radius' => true, + 'style' => true, + 'width' => true + ) + ), + 'position' => array( + 'sticky' => true + ), + 'typography' => array( + 'fontSize' => true, + 'lineHeight' => true, + '__experimentalFontFamily' => true, + '__experimentalFontWeight' => true, + '__experimentalFontStyle' => true, + '__experimentalTextTransform' => true, + '__experimentalTextDecoration' => true, + '__experimentalLetterSpacing' => true, + '__experimentalDefaultControls' => array( + 'fontSize' => true + ) + ), + 'layout' => array( + 'allowSizingOnChildren' => true + ), + 'interactivity' => array( + 'clientNavigation' => true + ), + 'allowedBlocks' => true + ), + 'editorStyle' => 'wp-block-group-editor', + 'style' => 'wp-block-group' + ), + 'heading' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/heading', + 'title' => 'Heading', + 'category' => 'text', + 'description' => 'Introduce new sections and organize content to help visitors (and search engines) understand the structure of your content.', + 'keywords' => array( + 'title', + 'subtitle' + ), + 'textdomain' => 'default', + 'attributes' => array( + 'content' => array( + 'type' => 'rich-text', + 'source' => 'rich-text', + 'selector' => 'h1,h2,h3,h4,h5,h6', + 'role' => 'content' + ), + 'level' => array( + 'type' => 'number', + 'default' => 2 + ), + 'levelOptions' => array( + 'type' => 'array' + ), + 'placeholder' => array( + 'type' => 'string' + ) + ), + 'supports' => array( + 'align' => array( + 'wide', + 'full' + ), + 'anchor' => true, + 'className' => true, + 'splitting' => true, + '__experimentalBorder' => array( + 'color' => true, + 'radius' => true, + 'style' => true, + 'width' => true + ), + 'color' => array( + 'gradients' => true, + 'link' => true, + '__experimentalDefaultControls' => array( + 'background' => true, + 'text' => true + ) + ), + 'spacing' => array( + 'margin' => true, + 'padding' => true, + '__experimentalDefaultControls' => array( + 'margin' => false, + 'padding' => false + ) + ), + 'typography' => array( + 'fontSize' => true, + 'lineHeight' => true, + 'textAlign' => true, + '__experimentalFontFamily' => true, + '__experimentalFontStyle' => true, + '__experimentalFontWeight' => true, + '__experimentalLetterSpacing' => true, + '__experimentalTextTransform' => true, + '__experimentalTextDecoration' => true, + '__experimentalWritingMode' => true, + 'fitText' => true, + '__experimentalDefaultControls' => array( + 'fontSize' => true + ) + ), + '__unstablePasteTextInline' => true, + '__experimentalSlashInserter' => true, + 'interactivity' => array( + 'clientNavigation' => true + ) + ), + 'editorStyle' => 'wp-block-heading-editor', + 'style' => 'wp-block-heading' + ), + 'home-link' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/home-link', + 'category' => 'design', + 'parent' => array( + 'core/navigation' + ), + 'title' => 'Home Link', + 'description' => 'Create a link that always points to the homepage of the site. Usually not necessary if there is already a site title link present in the header.', + 'textdomain' => 'default', + 'attributes' => array( + 'label' => array( + 'type' => 'string', + 'role' => 'content' + ) + ), + 'usesContext' => array( + 'textColor', + 'customTextColor', + 'backgroundColor', + 'customBackgroundColor', + 'fontSize', + 'customFontSize', + 'style' + ), + 'supports' => array( + 'anchor' => true, + 'reusable' => false, + 'html' => false, + 'typography' => array( + 'fontSize' => true, + 'lineHeight' => true, + '__experimentalFontFamily' => true, + '__experimentalFontWeight' => true, + '__experimentalFontStyle' => true, + '__experimentalTextTransform' => true, + '__experimentalTextDecoration' => true, + '__experimentalLetterSpacing' => true, + '__experimentalDefaultControls' => array( + 'fontSize' => true + ) + ), + 'interactivity' => array( + 'clientNavigation' => true + ) + ), + 'editorStyle' => 'wp-block-home-link-editor', + 'style' => 'wp-block-home-link' + ), + 'html' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/html', + 'title' => 'Custom HTML', + 'category' => 'widgets', + 'description' => 'Add custom HTML code and preview it as you edit.', + 'keywords' => array( + 'embed' + ), + 'textdomain' => 'default', + 'attributes' => array( + 'content' => array( + 'type' => 'string', + 'source' => 'raw', + 'role' => 'content' + ) + ), + 'supports' => array( + 'customClassName' => false, + 'className' => false, + 'html' => false, + 'interactivity' => array( + 'clientNavigation' => true + ), + 'customCSS' => false + ), + 'editorStyle' => 'wp-block-html-editor' + ), + 'icon' => array( + 'apiVersion' => 3, + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'name' => 'core/icon', + 'title' => 'Icon', + 'category' => 'media', + 'description' => 'Insert an SVG icon.', + 'keywords' => array( + 'icon', + 'svg' + ), + 'textdomain' => 'default', + 'attributes' => array( + 'icon' => array( + 'type' => 'string', + 'role' => 'content' + ) + ), + 'supports' => array( + 'anchor' => true, + 'ariaLabel' => array( + '__experimentalSkipSerialization' => true + ), + 'align' => array( + 'left', + 'center', + 'right' + ), + 'html' => false, + 'color' => array( + 'background' => true, + 'text' => true, + '__experimentalSkipSerialization' => true + ), + 'interactivity' => array( + 'clientNavigation' => true + ), + '__experimentalBorder' => array( + 'color' => true, + 'radius' => true, + 'style' => true, + 'width' => true, + '__experimentalSkipSerialization' => true, + '__experimentalDefaultControls' => array( + 'color' => false, + 'radius' => false, + 'style' => false, + 'width' => false + ) + ), + 'spacing' => array( + 'padding' => true, + 'margin' => true, + '__experimentalSkipSerialization' => array( + 'padding' + ), + '__experimentalDefaultControls' => array( + 'margin' => false, + 'padding' => false + ) + ), + 'dimensions' => array( + 'width' => true, + '__experimentalSkipSerialization' => array( + 'width' + ), + '__experimentalDefaultControls' => array( + 'width' => true + ) + ) + ), + 'selectors' => array( + 'root' => '.wp-block-icon', + 'color' => array( + 'root' => '.wp-block-icon svg' + ), + 'border' => array( + 'root' => '.wp-block-icon svg' + ), + 'spacing' => array( + 'padding' => '.wp-block-icon svg' + ), + 'dimensions' => array( + 'root' => '.wp-block-icon svg', + 'width' => '.wp-block-icon svg' + ) + ), + 'style' => 'wp-block-icon', + 'editorStyle' => 'wp-block-icon-editor' + ), + 'image' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/image', + 'title' => 'Image', + 'category' => 'media', + 'usesContext' => array( + 'allowResize', + 'imageCrop', + 'fixedHeight', + 'navigationButtonType', + 'postId', + 'postType', + 'queryId', + 'galleryId' + ), + 'description' => 'Insert an image to make a visual statement.', + 'keywords' => array( + 'img', + 'photo', + 'picture' + ), + 'textdomain' => 'default', + 'attributes' => array( + 'blob' => array( + 'type' => 'string', + 'role' => 'local' + ), + 'url' => array( + 'type' => 'string', + 'source' => 'attribute', + 'selector' => 'img', + 'attribute' => 'src', + 'role' => 'content' + ), + 'alt' => array( + 'type' => 'string', + 'source' => 'attribute', + 'selector' => 'img', + 'attribute' => 'alt', + 'default' => '', + 'role' => 'content' + ), + 'caption' => array( + 'type' => 'rich-text', + 'source' => 'rich-text', + 'selector' => 'figcaption', + 'role' => 'content' + ), + 'lightbox' => array( + 'type' => 'object', + 'enabled' => array( + 'type' => 'boolean' + ) + ), + 'title' => array( + 'type' => 'string', + 'source' => 'attribute', + 'selector' => 'img', + 'attribute' => 'title', + 'role' => 'content' + ), + 'href' => array( + 'type' => 'string', + 'source' => 'attribute', + 'selector' => 'figure > a', + 'attribute' => 'href', + 'role' => 'content' + ), + 'rel' => array( + 'type' => 'string', + 'source' => 'attribute', + 'selector' => 'figure > a', + 'attribute' => 'rel' + ), + 'linkClass' => array( + 'type' => 'string', + 'source' => 'attribute', + 'selector' => 'figure > a', + 'attribute' => 'class' + ), + 'id' => array( + 'type' => 'number', + 'role' => 'content' + ), + 'width' => array( + 'type' => 'string' + ), + 'height' => array( + 'type' => 'string' + ), + 'aspectRatio' => array( + 'type' => 'string' + ), + 'scale' => array( + 'type' => 'string' + ), + 'focalPoint' => array( + 'type' => 'object' + ), + 'sizeSlug' => array( + 'type' => 'string' + ), + 'linkDestination' => array( + 'type' => 'string' + ), + 'linkTarget' => array( + 'type' => 'string', + 'source' => 'attribute', + 'selector' => 'figure > a', + 'attribute' => 'target' + ) + ), + 'supports' => array( + 'interactivity' => true, + 'align' => array( + 'left', + 'center', + 'right', + 'wide', + 'full' + ), + 'anchor' => true, + 'color' => array( + 'text' => false, + 'background' => false + ), + 'filter' => array( + 'duotone' => true + ), + 'spacing' => array( + 'margin' => true + ), + '__experimentalBorder' => array( + 'color' => true, + 'radius' => true, + 'width' => true, + '__experimentalSkipSerialization' => true, + '__experimentalDefaultControls' => array( + 'color' => true, + 'radius' => true, + 'width' => true + ) + ), + 'shadow' => array( + '__experimentalSkipSerialization' => true + ) + ), + 'selectors' => array( + 'border' => '.wp-block-image img, .wp-block-image .wp-block-image__crop-area, .wp-block-image .components-placeholder', + 'shadow' => '.wp-block-image img, .wp-block-image .wp-block-image__crop-area, .wp-block-image .components-placeholder', + 'filter' => array( + 'duotone' => '.wp-block-image img, .wp-block-image .components-placeholder' + ) + ), + 'styles' => array( + array( + 'name' => 'default', + 'label' => 'Default', + 'isDefault' => true + ), + array( + 'name' => 'rounded', + 'label' => 'Rounded' + ) + ), + 'editorStyle' => 'wp-block-image-editor', + 'style' => 'wp-block-image' + ), + 'latest-comments' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/latest-comments', + 'title' => 'Latest Comments', + 'category' => 'widgets', + 'description' => 'Display a list of your most recent comments.', + 'keywords' => array( + 'recent comments' + ), + 'textdomain' => 'default', + 'attributes' => array( + 'commentsToShow' => array( + 'type' => 'number', + 'default' => 5, + 'minimum' => 1, + 'maximum' => 100 + ), + 'displayAvatar' => array( + 'type' => 'boolean', + 'default' => true + ), + 'displayDate' => array( + 'type' => 'boolean', + 'default' => true + ), + 'displayContent' => array( + 'type' => 'string', + 'default' => 'excerpt', + 'enum' => array( + 'none', + 'excerpt', + 'full' + ) + ) + ), + 'supports' => array( + 'anchor' => true, + 'align' => true, + 'color' => array( + 'gradients' => true, + 'link' => true, + '__experimentalDefaultControls' => array( + 'background' => true, + 'text' => true, + 'link' => true + ) + ), + 'html' => false, + 'spacing' => array( + 'margin' => true, + 'padding' => true + ), + 'typography' => array( + 'fontSize' => true, + 'lineHeight' => true, + '__experimentalFontFamily' => true, + '__experimentalFontWeight' => true, + '__experimentalFontStyle' => true, + '__experimentalTextTransform' => true, + '__experimentalTextDecoration' => true, + '__experimentalLetterSpacing' => true, + '__experimentalDefaultControls' => array( + 'fontSize' => true + ) + ), + 'interactivity' => array( + 'clientNavigation' => true + ) + ), + 'style' => 'wp-block-latest-comments' + ), + 'latest-posts' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/latest-posts', + 'title' => 'Latest Posts', + 'category' => 'widgets', + 'description' => 'Display a list of your most recent posts.', + 'keywords' => array( + 'recent posts' + ), + 'textdomain' => 'default', + 'attributes' => array( + 'categories' => array( + 'type' => 'array', + 'items' => array( + 'type' => 'object' + ) + ), + 'selectedAuthor' => array( + 'type' => 'number' + ), + 'postsToShow' => array( + 'type' => 'number', + 'default' => 5 + ), + 'displayPostContent' => array( + 'type' => 'boolean', + 'default' => false + ), + 'displayPostContentRadio' => array( + 'type' => 'string', + 'default' => 'excerpt' + ), + 'excerptLength' => array( + 'type' => 'number', + 'default' => 55 + ), + 'displayAuthor' => array( + 'type' => 'boolean', + 'default' => false + ), + 'displayPostDate' => array( + 'type' => 'boolean', + 'default' => false + ), + 'postLayout' => array( + 'type' => 'string', + 'default' => 'list' + ), + 'columns' => array( + 'type' => 'number', + 'default' => 3 + ), + 'order' => array( + 'type' => 'string', + 'default' => 'desc' + ), + 'orderBy' => array( + 'type' => 'string', + 'default' => 'date' + ), + 'displayFeaturedImage' => array( + 'type' => 'boolean', + 'default' => false + ), + 'featuredImageAlign' => array( + 'type' => 'string', + 'enum' => array( + 'left', + 'center', + 'right' + ) + ), + 'featuredImageSizeSlug' => array( + 'type' => 'string', + 'default' => 'thumbnail' + ), + 'featuredImageSizeWidth' => array( + 'type' => 'number', + 'default' => null + ), + 'featuredImageSizeHeight' => array( + 'type' => 'number', + 'default' => null + ), + 'addLinkToFeaturedImage' => array( + 'type' => 'boolean', + 'default' => false + ) + ), + 'supports' => array( + 'anchor' => true, + 'align' => true, + 'html' => false, + 'color' => array( + 'gradients' => true, + 'link' => true, + '__experimentalDefaultControls' => array( + 'background' => true, + 'text' => true, + 'link' => true + ) + ), + 'spacing' => array( + 'margin' => true, + 'padding' => true + ), + 'typography' => array( + 'fontSize' => true, + 'lineHeight' => true, + '__experimentalFontFamily' => true, + '__experimentalFontWeight' => true, + '__experimentalFontStyle' => true, + '__experimentalTextTransform' => true, + '__experimentalTextDecoration' => true, + '__experimentalLetterSpacing' => true, + '__experimentalDefaultControls' => array( + 'fontSize' => true + ) + ), + '__experimentalBorder' => array( + 'radius' => true, + 'color' => true, + 'width' => true, + 'style' => true, + '__experimentalDefaultControls' => array( + 'radius' => true, + 'color' => true, + 'width' => true, + 'style' => true + ) + ), + 'interactivity' => array( + 'clientNavigation' => true + ) + ), + 'editorStyle' => 'wp-block-latest-posts-editor', + 'style' => 'wp-block-latest-posts' + ), + 'legacy-widget' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/legacy-widget', + 'title' => 'Legacy Widget', + 'category' => 'widgets', + 'description' => 'Display a legacy widget.', + 'textdomain' => 'default', + 'attributes' => array( + 'id' => array( + 'type' => 'string', + 'default' => null + ), + 'idBase' => array( + 'type' => 'string', + 'default' => null + ), + 'instance' => array( + 'type' => 'object', + 'default' => null + ) + ), + 'supports' => array( + 'html' => false, + 'customClassName' => false, + 'reusable' => false + ), + 'editorStyle' => 'wp-block-legacy-widget-editor' + ), + 'list' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/list', + 'title' => 'List', + 'category' => 'text', + 'allowedBlocks' => array( + 'core/list-item' + ), + 'description' => 'An organized collection of items displayed in a specific order.', + 'keywords' => array( + 'bullet list', + 'ordered list', + 'numbered list' + ), + 'textdomain' => 'default', + 'attributes' => array( + 'ordered' => array( + 'type' => 'boolean', + 'default' => false, + 'role' => 'content' + ), + 'values' => array( + 'type' => 'string', + 'source' => 'html', + 'selector' => 'ol,ul', + 'multiline' => 'li', + 'default' => '', + 'role' => 'content' + ), + 'type' => array( + 'type' => 'string' + ), + 'start' => array( + 'type' => 'number' + ), + 'reversed' => array( + 'type' => 'boolean' + ), + 'placeholder' => array( + 'type' => 'string' + ) + ), + 'supports' => array( + 'anchor' => true, + 'html' => false, + '__experimentalBorder' => array( + 'color' => true, + 'radius' => true, + 'style' => true, + 'width' => true + ), + 'typography' => array( + 'fontSize' => true, + 'lineHeight' => true, + '__experimentalFontFamily' => true, + '__experimentalFontWeight' => true, + '__experimentalFontStyle' => true, + '__experimentalTextTransform' => true, + '__experimentalTextDecoration' => true, + '__experimentalLetterSpacing' => true, + '__experimentalDefaultControls' => array( + 'fontSize' => true + ) + ), + 'color' => array( + 'gradients' => true, + 'link' => true, + '__experimentalDefaultControls' => array( + 'background' => true, + 'text' => true + ) + ), + 'spacing' => array( + 'margin' => true, + 'padding' => true, + '__experimentalDefaultControls' => array( + 'margin' => false, + 'padding' => false + ) + ), + '__unstablePasteTextInline' => true, + '__experimentalOnMerge' => true, + '__experimentalSlashInserter' => true, + 'interactivity' => array( + 'clientNavigation' => true + ), + 'listView' => true + ), + 'selectors' => array( + 'border' => '.wp-block-list:not(.wp-block-list .wp-block-list)' + ), + 'editorStyle' => 'wp-block-list-editor', + 'style' => 'wp-block-list' + ), + 'list-item' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/list-item', + 'title' => 'List Item', + 'category' => 'text', + 'parent' => array( + 'core/list' + ), + 'allowedBlocks' => array( + 'core/list' + ), + 'description' => 'An individual item within a list.', + 'textdomain' => 'default', + 'attributes' => array( + 'placeholder' => array( + 'type' => 'string' + ), + 'content' => array( + 'type' => 'rich-text', + 'source' => 'rich-text', + 'selector' => 'li', + 'role' => 'content' + ) + ), + 'supports' => array( + 'anchor' => true, + 'className' => false, + 'splitting' => true, + '__experimentalBorder' => array( + 'color' => true, + 'radius' => true, + 'style' => true, + 'width' => true + ), + 'color' => array( + 'gradients' => true, + 'link' => true, + 'background' => true, + '__experimentalDefaultControls' => array( + 'text' => true + ) + ), + 'spacing' => array( + 'margin' => true, + 'padding' => true, + '__experimentalDefaultControls' => array( + 'margin' => false, + 'padding' => false + ) + ), + 'typography' => array( + 'fontSize' => true, + 'lineHeight' => true, + '__experimentalFontFamily' => true, + '__experimentalFontWeight' => true, + '__experimentalFontStyle' => true, + '__experimentalTextTransform' => true, + '__experimentalTextDecoration' => true, + '__experimentalLetterSpacing' => true, + '__experimentalDefaultControls' => array( + 'fontSize' => true + ) + ), + 'interactivity' => array( + 'clientNavigation' => true + ) + ), + 'selectors' => array( + 'root' => '.wp-block-list > li', + 'border' => '.wp-block-list:not(.wp-block-list .wp-block-list) > li' + ) + ), + 'loginout' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/loginout', + 'title' => 'Login/out', + 'category' => 'theme', + 'description' => 'Show login & logout links.', + 'keywords' => array( + 'login', + 'logout', + 'form' + ), + 'textdomain' => 'default', + 'attributes' => array( + 'displayLoginAsForm' => array( + 'type' => 'boolean', + 'default' => false + ), + 'redirectToCurrent' => array( + 'type' => 'boolean', + 'default' => true + ) + ), + 'example' => array( + 'viewportWidth' => 350 + ), + 'supports' => array( + 'anchor' => true, + 'className' => true, + 'color' => array( + 'background' => true, + 'text' => false, + 'gradients' => true, + 'link' => true + ), + 'spacing' => array( + 'margin' => true, + 'padding' => true, + '__experimentalDefaultControls' => array( + 'margin' => false, + 'padding' => false + ) + ), + 'typography' => array( + 'fontSize' => true, + 'lineHeight' => true, + '__experimentalFontFamily' => true, + '__experimentalFontWeight' => true, + '__experimentalFontStyle' => true, + '__experimentalTextTransform' => true, + '__experimentalTextDecoration' => true, + '__experimentalLetterSpacing' => true, + '__experimentalDefaultControls' => array( + 'fontSize' => true + ) + ), + '__experimentalBorder' => array( + 'radius' => true, + 'color' => true, + 'width' => true, + 'style' => true + ), + 'interactivity' => array( + 'clientNavigation' => true + ) + ), + 'style' => 'wp-block-loginout' + ), + 'math' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/math', + 'title' => 'Math', + 'category' => 'text', + 'description' => 'Display mathematical notation using LaTeX.', + 'keywords' => array( + 'equation', + 'formula', + 'latex', + 'mathematics' + ), + 'textdomain' => 'default', + 'supports' => array( + 'anchor' => true, + 'html' => false, + '__experimentalBorder' => array( + 'color' => true, + 'radius' => true, + 'style' => true, + 'width' => true + ), + 'color' => array( + 'gradients' => true, + '__experimentalDefaultControls' => array( + 'background' => true, + 'text' => true + ) + ), + 'spacing' => array( + 'margin' => true, + 'padding' => true, + '__experimentalDefaultControls' => array( + 'margin' => false, + 'padding' => false + ) + ), + 'typography' => array( + 'fontSize' => true, + '__experimentalDefaultControls' => array( + 'fontSize' => true + ) + ) + ), + 'attributes' => array( + 'latex' => array( + 'type' => 'string', + 'role' => 'content' + ), + 'mathML' => array( + 'type' => 'string', + 'source' => 'html', + 'selector' => 'math' + ) + ) + ), + 'media-text' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/media-text', + 'title' => 'Media & Text', + 'category' => 'media', + 'description' => 'Set media and words side-by-side for a richer layout.', + 'keywords' => array( + 'image', + 'video' + ), + 'textdomain' => 'default', + 'attributes' => array( + 'align' => array( + 'type' => 'string', + 'default' => 'none' + ), + 'mediaAlt' => array( + 'type' => 'string', + 'source' => 'attribute', + 'selector' => 'figure img', + 'attribute' => 'alt', + 'default' => '', + 'role' => 'content' + ), + 'mediaPosition' => array( + 'type' => 'string', + 'default' => 'left' + ), + 'mediaId' => array( + 'type' => 'number', + 'role' => 'content' + ), + 'mediaUrl' => array( + 'type' => 'string', + 'source' => 'attribute', + 'selector' => 'figure video,figure img', + 'attribute' => 'src', + 'role' => 'content' + ), + 'mediaLink' => array( + 'type' => 'string' + ), + 'linkDestination' => array( + 'type' => 'string' + ), + 'linkTarget' => array( + 'type' => 'string', + 'source' => 'attribute', + 'selector' => 'figure a', + 'attribute' => 'target' + ), + 'href' => array( + 'type' => 'string', + 'source' => 'attribute', + 'selector' => 'figure a', + 'attribute' => 'href', + 'role' => 'content' + ), + 'rel' => array( + 'type' => 'string', + 'source' => 'attribute', + 'selector' => 'figure a', + 'attribute' => 'rel' + ), + 'linkClass' => array( + 'type' => 'string', + 'source' => 'attribute', + 'selector' => 'figure a', + 'attribute' => 'class' + ), + 'mediaType' => array( + 'type' => 'string', + 'role' => 'content' + ), + 'mediaWidth' => array( + 'type' => 'number', + 'default' => 50 + ), + 'mediaSizeSlug' => array( + 'type' => 'string' + ), + 'isStackedOnMobile' => array( + 'type' => 'boolean', + 'default' => true + ), + 'verticalAlignment' => array( + 'type' => 'string' + ), + 'imageFill' => array( + 'type' => 'boolean' + ), + 'focalPoint' => array( + 'type' => 'object' + ), + 'useFeaturedImage' => array( + 'type' => 'boolean', + 'default' => false + ) + ), + 'usesContext' => array( + 'postId', + 'postType' + ), + 'supports' => array( + 'anchor' => true, + 'align' => array( + 'wide', + 'full' + ), + 'html' => false, + '__experimentalBorder' => array( + 'color' => true, + 'radius' => true, + 'style' => true, + 'width' => true, + '__experimentalDefaultControls' => array( + 'color' => true, + 'radius' => true, + 'style' => true, + 'width' => true + ) + ), + 'color' => array( + 'gradients' => true, + 'heading' => true, + 'link' => true, + '__experimentalDefaultControls' => array( + 'background' => true, + 'text' => true + ) + ), + 'spacing' => array( + 'margin' => true, + 'padding' => true + ), + 'typography' => array( + 'fontSize' => true, + 'lineHeight' => true, + '__experimentalFontFamily' => true, + '__experimentalFontWeight' => true, + '__experimentalFontStyle' => true, + '__experimentalTextTransform' => true, + '__experimentalTextDecoration' => true, + '__experimentalLetterSpacing' => true, + '__experimentalDefaultControls' => array( + 'fontSize' => true + ) + ), + 'interactivity' => array( + 'clientNavigation' => true + ), + 'allowedBlocks' => true + ), + 'editorStyle' => 'wp-block-media-text-editor', + 'style' => 'wp-block-media-text' + ), + 'missing' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/missing', + 'title' => 'Unsupported', + 'category' => 'text', + 'description' => 'Your site doesn’t include support for this block.', + 'textdomain' => 'default', + 'attributes' => array( + 'originalName' => array( + 'type' => 'string' + ), + 'originalUndelimitedContent' => array( + 'type' => 'string' + ), + 'originalContent' => array( + 'type' => 'string', + 'source' => 'raw' + ) + ), + 'supports' => array( + 'className' => false, + 'customClassName' => false, + 'inserter' => false, + 'html' => false, + 'lock' => false, + 'reusable' => false, + 'renaming' => false, + 'visibility' => false, + 'interactivity' => array( + 'clientNavigation' => true + ), + 'customCSS' => false + ) + ), + 'more' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/more', + 'title' => 'More', + 'category' => 'design', + 'description' => 'Content before this block will be shown in the excerpt on your archives page.', + 'keywords' => array( + 'read more' + ), + 'textdomain' => 'default', + 'attributes' => array( + 'customText' => array( + 'type' => 'string', + 'default' => '', + 'role' => 'content' + ), + 'noTeaser' => array( + 'type' => 'boolean', + 'default' => false + ) + ), + 'supports' => array( + 'customClassName' => false, + 'className' => false, + 'html' => false, + 'multiple' => false, + 'visibility' => false, + 'interactivity' => array( + 'clientNavigation' => true + ), + 'customCSS' => false + ), + 'editorStyle' => 'wp-block-more-editor' + ), + 'navigation' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/navigation', + 'title' => 'Navigation', + 'category' => 'theme', + 'allowedBlocks' => array( + 'core/navigation-link', + 'core/search', + 'core/social-links', + 'core/page-list', + 'core/spacer', + 'core/home-link', + 'core/icon', + 'core/site-title', + 'core/site-logo', + 'core/navigation-submenu', + 'core/loginout', + 'core/buttons' + ), + 'description' => 'A collection of blocks that allow visitors to get around your site.', + 'keywords' => array( + 'menu', + 'navigation', + 'links' + ), + 'textdomain' => 'default', + 'attributes' => array( + 'ref' => array( + 'type' => 'number' + ), + 'textColor' => array( + 'type' => 'string' + ), + 'customTextColor' => array( + 'type' => 'string' + ), + 'rgbTextColor' => array( + 'type' => 'string' + ), + 'backgroundColor' => array( + 'type' => 'string' + ), + 'customBackgroundColor' => array( + 'type' => 'string' + ), + 'rgbBackgroundColor' => array( + 'type' => 'string' + ), + 'showSubmenuIcon' => array( + 'type' => 'boolean', + 'default' => true + ), + 'submenuVisibility' => array( + 'type' => 'string', + 'enum' => array( + 'hover', + 'click', + 'always' + ), + 'default' => 'hover' + ), + 'overlayMenu' => array( + 'type' => 'string', + 'default' => 'mobile' + ), + 'overlay' => array( + 'type' => 'string' + ), + 'icon' => array( + 'type' => 'string', + 'default' => 'handle' + ), + 'hasIcon' => array( + 'type' => 'boolean', + 'default' => true + ), + '__unstableLocation' => array( + 'type' => 'string' + ), + 'overlayBackgroundColor' => array( + 'type' => 'string' + ), + 'customOverlayBackgroundColor' => array( + 'type' => 'string' + ), + 'overlayTextColor' => array( + 'type' => 'string' + ), + 'customOverlayTextColor' => array( + 'type' => 'string' + ), + 'maxNestingLevel' => array( + 'type' => 'number', + 'default' => 5 + ), + 'templateLock' => array( + 'type' => array( + 'string', + 'boolean' + ), + 'enum' => array( + 'all', + 'insert', + 'contentOnly', + false + ) + ) + ), + 'providesContext' => array( + 'textColor' => 'textColor', + 'customTextColor' => 'customTextColor', + 'backgroundColor' => 'backgroundColor', + 'customBackgroundColor' => 'customBackgroundColor', + 'overlayTextColor' => 'overlayTextColor', + 'customOverlayTextColor' => 'customOverlayTextColor', + 'overlayBackgroundColor' => 'overlayBackgroundColor', + 'customOverlayBackgroundColor' => 'customOverlayBackgroundColor', + 'fontSize' => 'fontSize', + 'customFontSize' => 'customFontSize', + 'showSubmenuIcon' => 'showSubmenuIcon', + 'submenuVisibility' => 'submenuVisibility', + 'openSubmenusOnClick' => 'openSubmenusOnClick', + 'style' => 'style', + 'maxNestingLevel' => 'maxNestingLevel' + ), + 'supports' => array( + 'anchor' => true, + 'align' => array( + 'wide', + 'full' + ), + 'ariaLabel' => true, + 'contentRole' => true, + 'html' => false, + 'inserter' => true, + 'typography' => array( + 'fontSize' => true, + 'lineHeight' => true, + '__experimentalFontStyle' => true, + '__experimentalFontWeight' => true, + '__experimentalTextTransform' => true, + '__experimentalFontFamily' => true, + '__experimentalLetterSpacing' => true, + '__experimentalTextDecoration' => true, + '__experimentalSkipSerialization' => array( + 'textDecoration' + ), + '__experimentalDefaultControls' => array( + 'fontSize' => true + ) + ), + 'spacing' => array( + 'blockGap' => true, + 'units' => array( + 'px', + 'em', + 'rem', + 'vh', + 'vw' + ), + '__experimentalDefaultControls' => array( + 'blockGap' => true + ) + ), + 'layout' => array( + 'allowSwitching' => false, + 'allowInheriting' => false, + 'allowVerticalAlignment' => false, + 'allowSizingOnChildren' => true, + 'default' => array( + 'type' => 'flex' + ) + ), + 'interactivity' => true, + 'renaming' => false + ), + 'editorStyle' => 'wp-block-navigation-editor', + 'style' => 'wp-block-navigation' + ), + 'navigation-link' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/navigation-link', + 'title' => 'Custom Link', + 'category' => 'design', + 'parent' => array( + 'core/navigation' + ), + 'allowedBlocks' => array( + 'core/navigation-link', + 'core/navigation-submenu', + 'core/page-list' + ), + 'description' => 'Add a page, link, or another item to your navigation.', + 'textdomain' => 'default', + 'attributes' => array( + 'label' => array( + 'type' => 'string', + 'role' => 'content' + ), + 'type' => array( + 'type' => 'string' + ), + 'description' => array( + 'type' => 'string' + ), + 'rel' => array( + 'type' => 'string' + ), + 'id' => array( + 'type' => 'number' + ), + 'opensInNewTab' => array( + 'type' => 'boolean', + 'default' => false + ), + 'url' => array( + 'type' => 'string', + 'role' => 'content' + ), + 'title' => array( + 'type' => 'string' + ), + 'kind' => array( + 'type' => 'string' + ), + 'isTopLevelLink' => array( + 'type' => 'boolean' + ) + ), + 'usesContext' => array( + 'textColor', + 'customTextColor', + 'backgroundColor', + 'customBackgroundColor', + 'overlayTextColor', + 'customOverlayTextColor', + 'overlayBackgroundColor', + 'customOverlayBackgroundColor', + 'fontSize', + 'customFontSize', + 'showSubmenuIcon', + 'maxNestingLevel', + 'style' + ), + 'supports' => array( + 'anchor' => true, + 'reusable' => false, + 'html' => false, + '__experimentalSlashInserter' => true, + 'typography' => array( + 'fontSize' => true, + 'lineHeight' => true, + '__experimentalFontFamily' => true, + '__experimentalFontWeight' => true, + '__experimentalFontStyle' => true, + '__experimentalTextTransform' => true, + '__experimentalTextDecoration' => true, + '__experimentalLetterSpacing' => true, + '__experimentalDefaultControls' => array( + 'fontSize' => true + ) + ), + 'renaming' => false, + 'interactivity' => array( + 'clientNavigation' => true + ) + ), + 'editorStyle' => 'wp-block-navigation-link-editor', + 'style' => 'wp-block-navigation-link' + ), + 'navigation-overlay-close' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/navigation-overlay-close', + 'title' => 'Navigation Overlay Close', + 'category' => 'design', + 'description' => 'A customizable button to close overlays.', + 'keywords' => array( + 'close', + 'overlay', + 'navigation', + 'menu' + ), + 'textdomain' => 'default', + 'attributes' => array( + 'displayMode' => array( + 'type' => 'string', + 'enum' => array( + 'icon', + 'text', + 'both' + ), + 'default' => 'icon' + ), + 'text' => array( + 'type' => 'string' + ) + ), + 'supports' => array( + 'color' => array( + 'gradients' => false, + '__experimentalDefaultControls' => array( + 'background' => true, + 'text' => true + ) + ), + 'spacing' => array( + 'padding' => true, + '__experimentalDefaultControls' => array( + 'padding' => true + ) + ), + 'typography' => array( + 'fontSize' => true, + 'lineHeight' => true, + '__experimentalFontFamily' => true, + '__experimentalFontWeight' => true, + '__experimentalFontStyle' => true, + '__experimentalTextTransform' => true, + '__experimentalTextDecoration' => true, + '__experimentalLetterSpacing' => true, + '__experimentalDefaultControls' => array( + 'fontSize' => true + ) + ) + ), + 'style' => 'wp-block-navigation-overlay-close' + ), + 'navigation-submenu' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/navigation-submenu', + 'title' => 'Submenu', + 'category' => 'design', + 'parent' => array( + 'core/navigation' + ), + 'description' => 'Add a submenu to your navigation.', + 'textdomain' => 'default', + 'attributes' => array( + 'label' => array( + 'type' => 'string', + 'role' => 'content' + ), + 'type' => array( + 'type' => 'string' + ), + 'description' => array( + 'type' => 'string' + ), + 'rel' => array( + 'type' => 'string' + ), + 'id' => array( + 'type' => 'number' + ), + 'opensInNewTab' => array( + 'type' => 'boolean', + 'default' => false + ), + 'url' => array( + 'type' => 'string', + 'role' => 'content' + ), + 'title' => array( + 'type' => 'string' + ), + 'kind' => array( + 'type' => 'string' + ), + 'isTopLevelItem' => array( + 'type' => 'boolean' + ) + ), + 'usesContext' => array( + 'textColor', + 'customTextColor', + 'backgroundColor', + 'customBackgroundColor', + 'overlayTextColor', + 'customOverlayTextColor', + 'overlayBackgroundColor', + 'customOverlayBackgroundColor', + 'fontSize', + 'customFontSize', + 'showSubmenuIcon', + 'maxNestingLevel', + 'openSubmenusOnClick', + 'submenuVisibility', + 'style' + ), + 'supports' => array( + 'anchor' => true, + 'reusable' => false, + 'html' => false, + 'typography' => array( + 'fontSize' => true, + 'lineHeight' => true, + '__experimentalFontFamily' => true, + '__experimentalFontWeight' => true, + '__experimentalFontStyle' => true, + '__experimentalTextTransform' => true, + '__experimentalTextDecoration' => true, + '__experimentalLetterSpacing' => true, + '__experimentalDefaultControls' => array( + 'fontSize' => true + ) + ), + 'interactivity' => array( + 'clientNavigation' => true + ) + ), + 'editorStyle' => 'wp-block-navigation-submenu-editor', + 'style' => 'wp-block-navigation-submenu' + ), + 'nextpage' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/nextpage', + 'title' => 'Page Break', + 'category' => 'design', + 'description' => 'Separate your content into a multi-page experience.', + 'keywords' => array( + 'next page', + 'pagination' + ), + 'parent' => array( + 'core/post-content' + ), + 'textdomain' => 'default', + 'supports' => array( + 'anchor' => true, + 'customClassName' => false, + 'className' => false, + 'html' => false, + 'visibility' => false, + 'interactivity' => array( + 'clientNavigation' => true + ), + 'customCSS' => false + ), + 'editorStyle' => 'wp-block-nextpage-editor' + ), + 'page-list' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/page-list', + 'title' => 'Page List', + 'category' => 'widgets', + 'allowedBlocks' => array( + 'core/page-list-item' + ), + 'description' => 'Display a list of all pages.', + 'keywords' => array( + 'menu', + 'navigation' + ), + 'textdomain' => 'default', + 'attributes' => array( + 'parentPageID' => array( + 'type' => 'integer', + 'default' => 0 + ), + 'isNested' => array( + 'type' => 'boolean', + 'default' => false + ) + ), + 'usesContext' => array( + 'textColor', + 'customTextColor', + 'backgroundColor', + 'customBackgroundColor', + 'overlayTextColor', + 'customOverlayTextColor', + 'overlayBackgroundColor', + 'customOverlayBackgroundColor', + 'fontSize', + 'customFontSize', + 'showSubmenuIcon', + 'style', + 'openSubmenusOnClick', + 'submenuVisibility' + ), + 'supports' => array( + 'anchor' => true, + 'reusable' => false, + 'html' => false, + 'typography' => array( + 'fontSize' => true, + 'lineHeight' => true, + '__experimentalFontFamily' => true, + '__experimentalFontWeight' => true, + '__experimentalFontStyle' => true, + '__experimentalTextTransform' => true, + '__experimentalTextDecoration' => true, + '__experimentalLetterSpacing' => true, + '__experimentalDefaultControls' => array( + 'fontSize' => true + ) + ), + 'interactivity' => array( + 'clientNavigation' => true + ), + 'color' => array( + 'text' => true, + 'background' => true, + 'link' => true, + 'gradients' => true, + '__experimentalDefaultControls' => array( + 'background' => true, + 'text' => true, + 'link' => true + ) + ), + '__experimentalBorder' => array( + 'radius' => true, + 'color' => true, + 'width' => true, + 'style' => true + ), + 'spacing' => array( + 'padding' => true, + 'margin' => true, + '__experimentalDefaultControls' => array( + 'padding' => false, + 'margin' => false + ) + ), + 'contentRole' => true + ), + 'editorStyle' => 'wp-block-page-list-editor', + 'style' => 'wp-block-page-list' + ), + 'page-list-item' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/page-list-item', + 'title' => 'Page List Item', + 'category' => 'widgets', + 'parent' => array( + 'core/page-list' + ), + 'description' => 'Displays a page inside a list of all pages.', + 'keywords' => array( + 'page', + 'menu', + 'navigation' + ), + 'textdomain' => 'default', + 'attributes' => array( + 'id' => array( + 'type' => 'number' + ), + 'label' => array( + 'type' => 'string' + ), + 'title' => array( + 'type' => 'string' + ), + 'link' => array( + 'type' => 'string' + ), + 'hasChildren' => array( + 'type' => 'boolean' + ) + ), + 'usesContext' => array( + 'textColor', + 'customTextColor', + 'backgroundColor', + 'customBackgroundColor', + 'overlayTextColor', + 'customOverlayTextColor', + 'overlayBackgroundColor', + 'customOverlayBackgroundColor', + 'fontSize', + 'customFontSize', + 'showSubmenuIcon', + 'style', + 'openSubmenusOnClick', + 'submenuVisibility' + ), + 'supports' => array( + 'anchor' => true, + 'reusable' => false, + 'html' => false, + 'lock' => false, + 'inserter' => false, + '__experimentalToolbar' => false, + 'interactivity' => array( + 'clientNavigation' => true + ) + ), + 'editorStyle' => 'wp-block-page-list-editor', + 'style' => 'wp-block-page-list' + ), + 'paragraph' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/paragraph', + 'title' => 'Paragraph', + 'category' => 'text', + 'description' => 'Start with the basic building block of all narrative.', + 'keywords' => array( + 'text' + ), + 'textdomain' => 'default', + 'attributes' => array( + 'content' => array( + 'type' => 'rich-text', + 'source' => 'rich-text', + 'selector' => 'p', + 'role' => 'content' + ), + 'dropCap' => array( + 'type' => 'boolean', + 'default' => false + ), + 'placeholder' => array( + 'type' => 'string' + ), + 'direction' => array( + 'type' => 'string', + 'enum' => array( + 'ltr', + 'rtl' + ) + ) + ), + 'supports' => array( + 'align' => array( + 'wide', + 'full' + ), + 'splitting' => true, + 'anchor' => true, + 'className' => false, + '__experimentalBorder' => array( + 'color' => true, + 'radius' => true, + 'style' => true, + 'width' => true + ), + 'color' => array( + 'gradients' => true, + 'link' => true, + '__experimentalDefaultControls' => array( + 'background' => true, + 'text' => true + ) + ), + 'spacing' => array( + 'margin' => true, + 'padding' => true, + '__experimentalDefaultControls' => array( + 'margin' => false, + 'padding' => false + ) + ), + 'typography' => array( + 'fontSize' => true, + 'lineHeight' => true, + 'textAlign' => true, + 'textColumns' => true, + 'textIndent' => true, + '__experimentalFontFamily' => true, + '__experimentalTextDecoration' => true, + '__experimentalFontStyle' => true, + '__experimentalFontWeight' => true, + '__experimentalLetterSpacing' => true, + '__experimentalTextTransform' => true, + '__experimentalWritingMode' => true, + 'fitText' => true, + '__experimentalDefaultControls' => array( + 'fontSize' => true + ) + ), + '__experimentalSelector' => 'p', + '__unstablePasteTextInline' => true, + 'interactivity' => array( + 'clientNavigation' => true + ) + ), + 'selectors' => array( + 'root' => 'p', + 'typography' => array( + 'textIndent' => '.wp-block-paragraph + .wp-block-paragraph' + ) + ), + 'editorStyle' => 'wp-block-paragraph-editor', + 'style' => 'wp-block-paragraph' + ), + 'pattern' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/pattern', + 'title' => 'Pattern Placeholder', + 'category' => 'theme', + 'description' => 'Show a block pattern.', + 'supports' => array( + 'html' => false, + 'inserter' => false, + 'renaming' => false, + 'visibility' => false, + 'interactivity' => array( + 'clientNavigation' => true + ) + ), + 'textdomain' => 'default', + 'attributes' => array( + 'slug' => array( + 'type' => 'string' + ) + ) + ), + 'post-author' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/post-author', + 'title' => 'Author (deprecated)', + 'category' => 'theme', + 'description' => 'This block is deprecated. Please use the Avatar block, the Author Name block, and the Author Biography block instead.', + 'textdomain' => 'default', + 'attributes' => array( + 'textAlign' => array( + 'type' => 'string' + ), + 'avatarSize' => array( + 'type' => 'number', + 'default' => 48 + ), + 'showAvatar' => array( + 'type' => 'boolean', + 'default' => true + ), + 'showBio' => array( + 'type' => 'boolean' + ), + 'byline' => array( + 'type' => 'string' + ), + 'isLink' => array( + 'type' => 'boolean', + 'default' => false, + 'role' => 'content' + ), + 'linkTarget' => array( + 'type' => 'string', + 'default' => '_self', + 'role' => 'content' + ) + ), + 'usesContext' => array( + 'postType', + 'postId', + 'queryId' + ), + 'supports' => array( + 'inserter' => false, + 'anchor' => true, + 'html' => false, + 'spacing' => array( + 'margin' => true, + 'padding' => true + ), + 'typography' => array( + 'fontSize' => true, + 'lineHeight' => true, + '__experimentalFontFamily' => true, + '__experimentalFontWeight' => true, + '__experimentalFontStyle' => true, + '__experimentalTextTransform' => true, + '__experimentalTextDecoration' => true, + '__experimentalLetterSpacing' => true, + '__experimentalDefaultControls' => array( + 'fontSize' => true + ) + ), + 'color' => array( + 'gradients' => true, + 'link' => true, + '__experimentalDefaultControls' => array( + 'background' => true, + 'text' => true + ) + ), + 'interactivity' => array( + 'clientNavigation' => true + ), + '__experimentalBorder' => array( + 'radius' => true, + 'color' => true, + 'width' => true, + 'style' => true, + '__experimentalDefaultControls' => array( + 'radius' => true, + 'color' => true, + 'width' => true, + 'style' => true + ) + ), + 'filter' => array( + 'duotone' => true + ) + ), + 'selectors' => array( + 'filter' => array( + 'duotone' => '.wp-block-post-author .wp-block-post-author__avatar img' + ) + ), + 'editorStyle' => 'wp-block-post-author-editor', + 'style' => 'wp-block-post-author' + ), + 'post-author-biography' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/post-author-biography', + 'title' => 'Author Biography', + 'category' => 'theme', + 'description' => 'The author biography.', + 'textdomain' => 'default', + 'usesContext' => array( + 'postType', + 'postId' + ), + 'example' => array( + 'viewportWidth' => 350 + ), + 'supports' => array( + 'anchor' => true, + 'spacing' => array( + 'margin' => true, + 'padding' => true + ), + 'color' => array( + 'gradients' => true, + 'link' => true, + '__experimentalDefaultControls' => array( + 'background' => true, + 'text' => true + ) + ), + 'typography' => array( + 'fontSize' => true, + 'lineHeight' => true, + 'textAlign' => true, + '__experimentalFontFamily' => true, + '__experimentalFontWeight' => true, + '__experimentalFontStyle' => true, + '__experimentalTextTransform' => true, + '__experimentalTextDecoration' => true, + '__experimentalLetterSpacing' => true, + '__experimentalDefaultControls' => array( + 'fontSize' => true + ) + ), + 'interactivity' => array( + 'clientNavigation' => true + ), + '__experimentalBorder' => array( + 'radius' => true, + 'color' => true, + 'width' => true, + 'style' => true, + '__experimentalDefaultControls' => array( + 'radius' => true, + 'color' => true, + 'width' => true, + 'style' => true + ) + ) + ), + 'style' => 'wp-block-post-author-biography' + ), + 'post-author-name' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/post-author-name', + 'title' => 'Author Name', + 'category' => 'theme', + 'description' => 'The author name.', + 'textdomain' => 'default', + 'attributes' => array( + 'isLink' => array( + 'type' => 'boolean', + 'default' => false, + 'role' => 'content' + ), + 'linkTarget' => array( + 'type' => 'string', + 'default' => '_self', + 'role' => 'content' + ) + ), + 'usesContext' => array( + 'postType', + 'postId' + ), + 'example' => array( + 'viewportWidth' => 350 + ), + 'supports' => array( + 'anchor' => true, + 'html' => false, + 'spacing' => array( + 'margin' => true, + 'padding' => true + ), + 'color' => array( + 'gradients' => true, + 'link' => true, + '__experimentalDefaultControls' => array( + 'background' => true, + 'text' => true, + 'link' => true + ) + ), + 'typography' => array( + 'fontSize' => true, + 'lineHeight' => true, + 'textAlign' => true, + '__experimentalFontFamily' => true, + '__experimentalFontWeight' => true, + '__experimentalFontStyle' => true, + '__experimentalTextTransform' => true, + '__experimentalTextDecoration' => true, + '__experimentalLetterSpacing' => true, + '__experimentalDefaultControls' => array( + 'fontSize' => true + ) + ), + 'interactivity' => array( + 'clientNavigation' => true + ), + '__experimentalBorder' => array( + 'radius' => true, + 'color' => true, + 'width' => true, + 'style' => true, + '__experimentalDefaultControls' => array( + 'radius' => true, + 'color' => true, + 'width' => true, + 'style' => true + ) + ) + ), + 'style' => 'wp-block-post-author-name' + ), + 'post-comments-count' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/post-comments-count', + 'title' => 'Comments Count', + 'category' => 'theme', + 'description' => 'Display a post\'s comments count.', + 'textdomain' => 'default', + 'usesContext' => array( + 'postId' + ), + 'example' => array( + 'viewportWidth' => 350 + ), + 'supports' => array( + 'anchor' => true, + 'html' => false, + 'color' => array( + 'gradients' => true, + '__experimentalDefaultControls' => array( + 'background' => true, + 'text' => true + ) + ), + 'spacing' => array( + 'margin' => true, + 'padding' => true + ), + 'typography' => array( + 'fontSize' => true, + 'lineHeight' => true, + 'textAlign' => true, + '__experimentalFontFamily' => true, + '__experimentalFontWeight' => true, + '__experimentalFontStyle' => true, + '__experimentalTextTransform' => true, + '__experimentalTextDecoration' => true, + '__experimentalLetterSpacing' => true, + '__experimentalDefaultControls' => array( + 'fontSize' => true + ) + ), + '__experimentalBorder' => array( + 'radius' => true, + 'color' => true, + 'width' => true, + 'style' => true + ), + 'interactivity' => array( + 'clientNavigation' => true + ) + ), + 'style' => 'wp-block-post-comments-count' + ), + 'post-comments-form' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/post-comments-form', + 'title' => 'Comments Form', + 'category' => 'theme', + 'description' => 'Display a post\'s comments form.', + 'textdomain' => 'default', + 'usesContext' => array( + 'postId', + 'postType' + ), + 'supports' => array( + 'anchor' => true, + 'html' => false, + 'color' => array( + 'gradients' => true, + 'heading' => true, + 'link' => true, + '__experimentalDefaultControls' => array( + 'background' => true, + 'text' => true + ) + ), + 'spacing' => array( + 'margin' => true, + 'padding' => true + ), + 'typography' => array( + 'fontSize' => true, + 'lineHeight' => true, + 'textAlign' => true, + '__experimentalFontStyle' => true, + '__experimentalFontWeight' => true, + '__experimentalLetterSpacing' => true, + '__experimentalTextTransform' => true, + '__experimentalDefaultControls' => array( + 'fontSize' => true + ) + ), + '__experimentalBorder' => array( + 'radius' => true, + 'color' => true, + 'width' => true, + 'style' => true, + '__experimentalDefaultControls' => array( + 'radius' => true, + 'color' => true, + 'width' => true, + 'style' => true + ) + ) + ), + 'editorStyle' => 'wp-block-post-comments-form-editor', + 'style' => array( + 'wp-block-post-comments-form', + 'wp-block-buttons', + 'wp-block-button' + ), + 'example' => array( + 'attributes' => array( + 'style' => array( + 'typography' => array( + 'textAlign' => 'center' + ) + ) + ) + ) + ), + 'post-comments-link' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/post-comments-link', + 'title' => 'Comments Link', + 'category' => 'theme', + 'description' => 'Displays the link to the current post comments.', + 'textdomain' => 'default', + 'usesContext' => array( + 'postType', + 'postId' + ), + 'example' => array( + 'viewportWidth' => 350 + ), + 'supports' => array( + 'anchor' => true, + 'html' => false, + 'color' => array( + 'link' => true, + 'text' => false, + '__experimentalDefaultControls' => array( + 'background' => true, + 'link' => true + ) + ), + 'spacing' => array( + 'margin' => true, + 'padding' => true + ), + 'typography' => array( + 'fontSize' => true, + 'lineHeight' => true, + 'textAlign' => true, + '__experimentalFontFamily' => true, + '__experimentalFontWeight' => true, + '__experimentalFontStyle' => true, + '__experimentalTextTransform' => true, + '__experimentalTextDecoration' => true, + '__experimentalLetterSpacing' => true, + '__experimentalDefaultControls' => array( + 'fontSize' => true + ) + ), + 'interactivity' => array( + 'clientNavigation' => true + ), + '__experimentalBorder' => array( + 'radius' => true, + 'color' => true, + 'width' => true, + 'style' => true, + '__experimentalDefaultControls' => array( + 'radius' => true, + 'color' => true, + 'width' => true, + 'style' => true + ) + ) + ), + 'style' => 'wp-block-post-comments-link' + ), + 'post-content' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/post-content', + 'title' => 'Content', + 'category' => 'theme', + 'description' => 'Displays the contents of a post or page.', + 'textdomain' => 'default', + 'usesContext' => array( + 'postId', + 'postType', + 'queryId' + ), + 'attributes' => array( + 'tagName' => array( + 'type' => 'string', + 'default' => 'div' + ) + ), + 'example' => array( + 'viewportWidth' => 350 + ), + 'supports' => array( + 'anchor' => true, + 'align' => array( + 'wide', + 'full' + ), + 'html' => false, + 'layout' => true, + 'background' => array( + 'backgroundImage' => true, + 'backgroundSize' => true, + '__experimentalDefaultControls' => array( + 'backgroundImage' => true + ) + ), + 'dimensions' => array( + 'minHeight' => true + ), + 'spacing' => array( + 'blockGap' => true, + 'padding' => true, + 'margin' => true, + '__experimentalDefaultControls' => array( + 'margin' => false, + 'padding' => false + ) + ), + 'color' => array( + 'gradients' => true, + 'heading' => true, + 'link' => true, + '__experimentalDefaultControls' => array( + 'background' => false, + 'text' => false + ) + ), + 'typography' => array( + 'fontSize' => true, + 'lineHeight' => true, + '__experimentalFontFamily' => true, + '__experimentalFontWeight' => true, + '__experimentalFontStyle' => true, + '__experimentalTextTransform' => true, + '__experimentalTextDecoration' => true, + '__experimentalLetterSpacing' => true, + '__experimentalDefaultControls' => array( + 'fontSize' => true + ) + ), + 'interactivity' => array( + 'clientNavigation' => true + ), + '__experimentalBorder' => array( + 'radius' => true, + 'color' => true, + 'width' => true, + 'style' => true, + '__experimentalDefaultControls' => array( + 'radius' => true, + 'color' => true, + 'width' => true, + 'style' => true + ) + ) + ), + 'style' => 'wp-block-post-content', + 'editorStyle' => 'wp-block-post-content-editor' + ), + 'post-date' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/post-date', + 'title' => 'Date', + 'category' => 'theme', + 'description' => 'Display a custom date.', + 'textdomain' => 'default', + 'attributes' => array( + 'datetime' => array( + 'type' => 'string', + 'role' => 'content' + ), + 'textAlign' => array( + 'type' => 'string' + ), + 'format' => array( + 'type' => 'string' + ), + 'isLink' => array( + 'type' => 'boolean', + 'default' => false, + 'role' => 'content' + ) + ), + 'usesContext' => array( + 'postId', + 'postType', + 'queryId' + ), + 'example' => array( + 'viewportWidth' => 350 + ), + 'supports' => array( + 'anchor' => true, + 'html' => false, + 'color' => array( + 'gradients' => true, + 'link' => true, + '__experimentalDefaultControls' => array( + 'background' => true, + 'text' => true, + 'link' => true + ) + ), + 'spacing' => array( + 'margin' => true, + 'padding' => true + ), + 'typography' => array( + 'fontSize' => true, + 'lineHeight' => true, + '__experimentalFontFamily' => true, + '__experimentalFontWeight' => true, + '__experimentalFontStyle' => true, + '__experimentalTextTransform' => true, + '__experimentalTextDecoration' => true, + '__experimentalLetterSpacing' => true, + '__experimentalDefaultControls' => array( + 'fontSize' => true + ) + ), + 'interactivity' => array( + 'clientNavigation' => true + ), + '__experimentalBorder' => array( + 'radius' => true, + 'color' => true, + 'width' => true, + 'style' => true, + '__experimentalDefaultControls' => array( + 'radius' => true, + 'color' => true, + 'width' => true, + 'style' => true + ) + ) + ) + ), + 'post-excerpt' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/post-excerpt', + 'title' => 'Excerpt', + 'category' => 'theme', + 'description' => 'Display the excerpt.', + 'textdomain' => 'default', + 'attributes' => array( + 'textAlign' => array( + 'type' => 'string' + ), + 'moreText' => array( + 'type' => 'string', + 'role' => 'content' + ), + 'showMoreOnNewLine' => array( + 'type' => 'boolean', + 'default' => true + ), + 'excerptLength' => array( + 'type' => 'number', + 'default' => 55 + ) + ), + 'usesContext' => array( + 'postId', + 'postType', + 'queryId' + ), + 'example' => array( + 'viewportWidth' => 350 + ), + 'supports' => array( + 'anchor' => true, + 'html' => false, + 'color' => array( + 'gradients' => true, + 'link' => true, + '__experimentalDefaultControls' => array( + 'background' => true, + 'text' => true, + 'link' => true + ) + ), + 'spacing' => array( + 'margin' => true, + 'padding' => true + ), + 'typography' => array( + 'fontSize' => true, + 'lineHeight' => true, + 'textColumns' => true, + '__experimentalFontFamily' => true, + '__experimentalFontWeight' => true, + '__experimentalFontStyle' => true, + '__experimentalTextTransform' => true, + '__experimentalTextDecoration' => true, + '__experimentalLetterSpacing' => true, + '__experimentalDefaultControls' => array( + 'fontSize' => true + ) + ), + 'interactivity' => array( + 'clientNavigation' => true + ), + '__experimentalBorder' => array( + 'radius' => true, + 'color' => true, + 'width' => true, + 'style' => true, + '__experimentalDefaultControls' => array( + 'radius' => true, + 'color' => true, + 'width' => true, + 'style' => true + ) + ) + ), + 'editorStyle' => 'wp-block-post-excerpt-editor', + 'style' => 'wp-block-post-excerpt' + ), + 'post-featured-image' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/post-featured-image', + 'title' => 'Featured Image', + 'category' => 'theme', + 'description' => 'Display a post\'s featured image.', + 'textdomain' => 'default', + 'attributes' => array( + 'isLink' => array( + 'type' => 'boolean', + 'default' => false, + 'role' => 'content' + ), + 'aspectRatio' => array( + 'type' => 'string' + ), + 'width' => array( + 'type' => 'string' + ), + 'height' => array( + 'type' => 'string' + ), + 'scale' => array( + 'type' => 'string', + 'default' => 'cover' + ), + 'sizeSlug' => array( + 'type' => 'string' + ), + 'rel' => array( + 'type' => 'string', + 'attribute' => 'rel', + 'default' => '', + 'role' => 'content' + ), + 'linkTarget' => array( + 'type' => 'string', + 'default' => '_self', + 'role' => 'content' + ), + 'overlayColor' => array( + 'type' => 'string' + ), + 'customOverlayColor' => array( + 'type' => 'string' + ), + 'dimRatio' => array( + 'type' => 'number', + 'default' => 0 + ), + 'gradient' => array( + 'type' => 'string' + ), + 'customGradient' => array( + 'type' => 'string' + ), + 'useFirstImageFromPost' => array( + 'type' => 'boolean', + 'default' => false + ) + ), + 'usesContext' => array( + 'postId', + 'postType', + 'queryId' + ), + 'example' => array( + 'viewportWidth' => 350 + ), + 'supports' => array( + 'anchor' => true, + 'align' => array( + 'left', + 'right', + 'center', + 'wide', + 'full' + ), + 'color' => array( + 'text' => false, + 'background' => false + ), + '__experimentalBorder' => array( + 'color' => true, + 'radius' => true, + 'width' => true, + '__experimentalSkipSerialization' => true, + '__experimentalDefaultControls' => array( + 'color' => true, + 'radius' => true, + 'width' => true + ) + ), + 'filter' => array( + 'duotone' => true + ), + 'shadow' => array( + '__experimentalSkipSerialization' => true + ), + 'html' => false, + 'spacing' => array( + 'margin' => true, + 'padding' => true + ), + 'interactivity' => array( + 'clientNavigation' => true + ) + ), + 'selectors' => array( + 'border' => '.wp-block-post-featured-image img, .wp-block-post-featured-image .block-editor-media-placeholder, .wp-block-post-featured-image .wp-block-post-featured-image__overlay', + 'shadow' => '.wp-block-post-featured-image img, .wp-block-post-featured-image .components-placeholder', + 'filter' => array( + 'duotone' => '.wp-block-post-featured-image img, .wp-block-post-featured-image .wp-block-post-featured-image__placeholder, .wp-block-post-featured-image .components-placeholder__illustration, .wp-block-post-featured-image .components-placeholder::before' + ) + ), + 'editorStyle' => 'wp-block-post-featured-image-editor', + 'style' => 'wp-block-post-featured-image' + ), + 'post-navigation-link' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/post-navigation-link', + 'title' => 'Post Navigation Link', + 'category' => 'theme', + 'description' => 'Displays the next or previous post link that is adjacent to the current post.', + 'textdomain' => 'default', + 'attributes' => array( + 'textAlign' => array( + 'type' => 'string' + ), + 'type' => array( + 'type' => 'string', + 'default' => 'next' + ), + 'label' => array( + 'type' => 'string', + 'role' => 'content' + ), + 'showTitle' => array( + 'type' => 'boolean', + 'default' => false + ), + 'linkLabel' => array( + 'type' => 'boolean', + 'default' => false + ), + 'arrow' => array( + 'type' => 'string', + 'default' => 'none' + ), + 'taxonomy' => array( + 'type' => 'string', + 'default' => '' + ) + ), + 'usesContext' => array( + 'postType' + ), + 'supports' => array( + 'anchor' => true, + 'reusable' => false, + 'html' => false, + 'color' => array( + 'link' => true + ), + 'typography' => array( + 'fontSize' => true, + 'lineHeight' => true, + '__experimentalFontFamily' => true, + '__experimentalFontWeight' => true, + '__experimentalFontStyle' => true, + '__experimentalTextTransform' => true, + '__experimentalTextDecoration' => true, + '__experimentalLetterSpacing' => true, + '__experimentalWritingMode' => true, + '__experimentalDefaultControls' => array( + 'fontSize' => true + ) + ), + 'interactivity' => array( + 'clientNavigation' => true + ) + ), + 'style' => 'wp-block-post-navigation-link' + ), + 'post-template' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/post-template', + 'title' => 'Post Template', + 'category' => 'theme', + 'ancestor' => array( + 'core/query' + ), + 'description' => 'Contains the block elements used to render a post, like the title, date, featured image, content or excerpt, and more.', + 'textdomain' => 'default', + 'usesContext' => array( + 'queryId', + 'query', + 'displayLayout', + 'templateSlug', + 'previewPostType', + 'enhancedPagination', + 'postType' + ), + 'supports' => array( + 'anchor' => true, + 'reusable' => false, + 'html' => false, + 'align' => array( + 'wide', + 'full' + ), + 'layout' => true, + 'color' => array( + 'gradients' => true, + 'link' => true, + '__experimentalDefaultControls' => array( + 'background' => true, + 'text' => true + ) + ), + 'typography' => array( + 'fontSize' => true, + 'lineHeight' => true, + '__experimentalFontFamily' => true, + '__experimentalFontWeight' => true, + '__experimentalFontStyle' => true, + '__experimentalTextTransform' => true, + '__experimentalTextDecoration' => true, + '__experimentalLetterSpacing' => true, + '__experimentalDefaultControls' => array( + 'fontSize' => true + ) + ), + 'spacing' => array( + 'margin' => true, + 'padding' => true, + 'blockGap' => array( + '__experimentalDefault' => '1.25em' + ), + '__experimentalDefaultControls' => array( + 'blockGap' => true, + 'padding' => false, + 'margin' => false + ) + ), + 'interactivity' => array( + 'clientNavigation' => true + ), + '__experimentalBorder' => array( + 'radius' => true, + 'color' => true, + 'width' => true, + 'style' => true + ) + ), + 'style' => 'wp-block-post-template', + 'editorStyle' => 'wp-block-post-template-editor' + ), + 'post-terms' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/post-terms', + 'title' => 'Post Terms', + 'category' => 'theme', + 'description' => 'Post terms.', + 'textdomain' => 'default', + 'attributes' => array( + 'term' => array( + 'type' => 'string' + ), + 'separator' => array( + 'type' => 'string', + 'default' => ', ' + ), + 'prefix' => array( + 'type' => 'string', + 'default' => '', + 'role' => 'content' + ), + 'suffix' => array( + 'type' => 'string', + 'default' => '', + 'role' => 'content' + ) + ), + 'usesContext' => array( + 'postId', + 'postType' + ), + 'example' => array( + 'viewportWidth' => 350 + ), + 'supports' => array( + 'anchor' => true, + 'html' => false, + 'color' => array( + 'gradients' => true, + 'link' => true, + '__experimentalDefaultControls' => array( + 'background' => true, + 'text' => true, + 'link' => true + ) + ), + 'spacing' => array( + 'margin' => true, + 'padding' => true + ), + 'typography' => array( + 'fontSize' => true, + 'lineHeight' => true, + 'textAlign' => true, + '__experimentalFontFamily' => true, + '__experimentalFontWeight' => true, + '__experimentalFontStyle' => true, + '__experimentalTextTransform' => true, + '__experimentalTextDecoration' => true, + '__experimentalLetterSpacing' => true, + '__experimentalDefaultControls' => array( + 'fontSize' => true + ) + ), + 'interactivity' => array( + 'clientNavigation' => true + ), + '__experimentalBorder' => array( + 'radius' => true, + 'color' => true, + 'width' => true, + 'style' => true, + '__experimentalDefaultControls' => array( + 'radius' => true, + 'color' => true, + 'width' => true, + 'style' => true + ) + ) + ), + 'style' => 'wp-block-post-terms' + ), + 'post-time-to-read' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/post-time-to-read', + 'title' => 'Time to Read', + 'category' => 'theme', + 'description' => 'Show minutes required to finish reading the post. Can also show a word count.', + 'textdomain' => 'default', + 'usesContext' => array( + 'postId', + 'postType' + ), + 'attributes' => array( + 'displayAsRange' => array( + 'type' => 'boolean', + 'default' => true + ), + 'displayMode' => array( + 'type' => 'string', + 'default' => 'time' + ), + 'averageReadingSpeed' => array( + 'type' => 'number', + 'default' => 189 + ) + ), + 'supports' => array( + 'anchor' => true, + 'color' => array( + 'gradients' => true, + '__experimentalDefaultControls' => array( + 'background' => true, + 'text' => true + ) + ), + 'html' => false, + 'spacing' => array( + 'margin' => true, + 'padding' => true, + '__experimentalDefaultControls' => array( + 'margin' => false, + 'padding' => false + ) + ), + 'typography' => array( + 'fontSize' => true, + 'lineHeight' => true, + 'textAlign' => true, + '__experimentalFontFamily' => true, + '__experimentalFontWeight' => true, + '__experimentalFontStyle' => true, + '__experimentalTextTransform' => true, + '__experimentalTextDecoration' => true, + '__experimentalLetterSpacing' => true, + '__experimentalDefaultControls' => array( + 'fontSize' => true + ) + ), + 'interactivity' => array( + 'clientNavigation' => true + ), + '__experimentalBorder' => array( + 'radius' => true, + 'color' => true, + 'width' => true, + 'style' => true + ) + ) + ), + 'post-title' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/post-title', + 'title' => 'Title', + 'category' => 'theme', + 'description' => 'Displays the title of a post, page, or any other content-type.', + 'textdomain' => 'default', + 'usesContext' => array( + 'postId', + 'postType', + 'queryId' + ), + 'attributes' => array( + 'textAlign' => array( + 'type' => 'string' + ), + 'level' => array( + 'type' => 'number', + 'default' => 2 + ), + 'levelOptions' => array( + 'type' => 'array' + ), + 'isLink' => array( + 'type' => 'boolean', + 'default' => false, + 'role' => 'content' + ), + 'rel' => array( + 'type' => 'string', + 'attribute' => 'rel', + 'default' => '', + 'role' => 'content' + ), + 'linkTarget' => array( + 'type' => 'string', + 'default' => '_self', + 'role' => 'content' + ) + ), + 'example' => array( + 'viewportWidth' => 350 + ), + 'supports' => array( + 'anchor' => true, + 'align' => array( + 'wide', + 'full' + ), + 'html' => false, + 'color' => array( + 'gradients' => true, + 'link' => true, + '__experimentalDefaultControls' => array( + 'background' => true, + 'text' => true, + 'link' => true + ) + ), + 'spacing' => array( + 'margin' => true, + 'padding' => true + ), + 'typography' => array( + 'fontSize' => true, + 'lineHeight' => true, + '__experimentalFontFamily' => true, + '__experimentalFontWeight' => true, + '__experimentalFontStyle' => true, + '__experimentalTextTransform' => true, + '__experimentalTextDecoration' => true, + '__experimentalLetterSpacing' => true, + '__experimentalDefaultControls' => array( + 'fontSize' => true + ) + ), + 'interactivity' => array( + 'clientNavigation' => true + ), + '__experimentalBorder' => array( + 'radius' => true, + 'color' => true, + 'width' => true, + 'style' => true, + '__experimentalDefaultControls' => array( + 'radius' => true, + 'color' => true, + 'width' => true, + 'style' => true + ) + ) + ), + 'style' => 'wp-block-post-title' + ), + 'preformatted' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/preformatted', + 'title' => 'Preformatted', + 'category' => 'text', + 'description' => 'Add text that respects your spacing and tabs, and also allows styling.', + 'textdomain' => 'default', + 'attributes' => array( + 'content' => array( + 'type' => 'rich-text', + 'source' => 'rich-text', + 'selector' => 'pre', + '__unstablePreserveWhiteSpace' => true, + 'role' => 'content' + ) + ), + 'supports' => array( + 'anchor' => true, + 'color' => array( + 'gradients' => true, + '__experimentalDefaultControls' => array( + 'background' => true, + 'text' => true + ) + ), + 'spacing' => array( + 'padding' => true, + 'margin' => true + ), + 'typography' => array( + 'fontSize' => true, + 'lineHeight' => true, + '__experimentalFontFamily' => true, + '__experimentalFontWeight' => true, + '__experimentalFontStyle' => true, + '__experimentalTextTransform' => true, + '__experimentalTextDecoration' => true, + '__experimentalLetterSpacing' => true, + '__experimentalDefaultControls' => array( + 'fontSize' => true + ) + ), + 'interactivity' => array( + 'clientNavigation' => true + ), + '__experimentalBorder' => array( + 'radius' => true, + 'color' => true, + 'width' => true, + 'style' => true, + '__experimentalDefaultControls' => array( + 'radius' => true, + 'color' => true, + 'width' => true, + 'style' => true + ) + ) + ), + 'style' => 'wp-block-preformatted' + ), + 'pullquote' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/pullquote', + 'title' => 'Pullquote', + 'category' => 'text', + 'description' => 'Give special visual emphasis to a quote from your text.', + 'textdomain' => 'default', + 'attributes' => array( + 'value' => array( + 'type' => 'rich-text', + 'source' => 'rich-text', + 'selector' => 'p', + 'role' => 'content' + ), + 'citation' => array( + 'type' => 'rich-text', + 'source' => 'rich-text', + 'selector' => 'cite', + 'role' => 'content' + ), + 'textAlign' => array( + 'type' => 'string' + ) + ), + 'supports' => array( + 'anchor' => true, + 'align' => array( + 'left', + 'right', + 'wide', + 'full' + ), + 'background' => array( + 'backgroundImage' => true, + 'backgroundSize' => true, + '__experimentalDefaultControls' => array( + 'backgroundImage' => true + ) + ), + 'color' => array( + 'gradients' => true, + 'background' => true, + 'link' => true, + '__experimentalDefaultControls' => array( + 'background' => true, + 'text' => true + ) + ), + 'dimensions' => array( + 'minHeight' => true, + '__experimentalDefaultControls' => array( + 'minHeight' => false + ) + ), + 'spacing' => array( + 'margin' => true, + 'padding' => true + ), + 'typography' => array( + 'fontSize' => true, + 'lineHeight' => true, + '__experimentalFontFamily' => true, + '__experimentalFontWeight' => true, + '__experimentalFontStyle' => true, + '__experimentalTextTransform' => true, + '__experimentalTextDecoration' => true, + '__experimentalLetterSpacing' => true, + '__experimentalDefaultControls' => array( + 'fontSize' => true + ) + ), + '__experimentalBorder' => array( + 'color' => true, + 'radius' => true, + 'style' => true, + 'width' => true, + '__experimentalDefaultControls' => array( + 'color' => true, + 'radius' => true, + 'style' => true, + 'width' => true + ) + ), + '__experimentalStyle' => array( + 'typography' => array( + 'fontSize' => '1.5em', + 'lineHeight' => '1.6' + ) + ), + 'interactivity' => array( + 'clientNavigation' => true + ) + ), + 'editorStyle' => 'wp-block-pullquote-editor', + 'style' => 'wp-block-pullquote' + ), + 'query' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/query', + 'title' => 'Query Loop', + 'category' => 'theme', + 'description' => 'An advanced block that allows displaying post types based on different query parameters and visual configurations.', + 'keywords' => array( + 'posts', + 'list', + 'blog', + 'blogs', + 'custom post types' + ), + 'textdomain' => 'default', + 'attributes' => array( + 'queryId' => array( + 'type' => 'number' + ), + 'query' => array( + 'type' => 'object', + 'default' => array( + 'perPage' => null, + 'pages' => 0, + 'offset' => 0, + 'postType' => 'post', + 'order' => 'desc', + 'orderBy' => 'date', + 'author' => '', + 'search' => '', + 'exclude' => array( + + ), + 'sticky' => '', + 'inherit' => true, + 'taxQuery' => null, + 'parents' => array( + + ), + 'format' => array( + + ) + ) + ), + 'tagName' => array( + 'type' => 'string', + 'default' => 'div' + ), + 'namespace' => array( + 'type' => 'string' + ), + 'enhancedPagination' => array( + 'type' => 'boolean', + 'default' => false + ) + ), + 'usesContext' => array( + 'templateSlug' + ), + 'providesContext' => array( + 'queryId' => 'queryId', + 'query' => 'query', + 'displayLayout' => 'displayLayout', + 'enhancedPagination' => 'enhancedPagination' + ), + 'supports' => array( + 'anchor' => true, + 'align' => array( + 'wide', + 'full' + ), + 'html' => false, + 'layout' => true, + 'interactivity' => true + ), + 'editorStyle' => 'wp-block-query-editor' + ), + 'query-no-results' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/query-no-results', + 'title' => 'No Results', + 'category' => 'theme', + 'description' => 'Contains the block elements used to render content when no query results are found.', + 'ancestor' => array( + 'core/query' + ), + 'textdomain' => 'default', + 'usesContext' => array( + 'queryId', + 'query' + ), + 'supports' => array( + 'anchor' => true, + 'align' => true, + 'reusable' => false, + 'html' => false, + 'color' => array( + 'gradients' => true, + 'link' => true + ), + 'typography' => array( + 'fontSize' => true, + 'lineHeight' => true, + '__experimentalFontFamily' => true, + '__experimentalFontWeight' => true, + '__experimentalFontStyle' => true, + '__experimentalTextTransform' => true, + '__experimentalTextDecoration' => true, + '__experimentalLetterSpacing' => true, + '__experimentalDefaultControls' => array( + 'fontSize' => true + ) + ), + 'interactivity' => array( + 'clientNavigation' => true + ) + ) + ), + 'query-pagination' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/query-pagination', + 'title' => 'Pagination', + 'category' => 'theme', + 'ancestor' => array( + 'core/query' + ), + 'allowedBlocks' => array( + 'core/query-pagination-previous', + 'core/query-pagination-numbers', + 'core/query-pagination-next' + ), + 'description' => 'Displays a paginated navigation to next/previous set of posts, when applicable.', + 'textdomain' => 'default', + 'attributes' => array( + 'paginationArrow' => array( + 'type' => 'string', + 'default' => 'none' + ), + 'showLabel' => array( + 'type' => 'boolean', + 'default' => true + ) + ), + 'usesContext' => array( + 'queryId', + 'query' + ), + 'providesContext' => array( + 'paginationArrow' => 'paginationArrow', + 'showLabel' => 'showLabel' + ), + 'supports' => array( + 'anchor' => true, + 'align' => true, + 'reusable' => false, + 'html' => false, + 'color' => array( + 'gradients' => true, + 'link' => true, + '__experimentalDefaultControls' => array( + 'background' => true, + 'text' => true, + 'link' => true + ) + ), + 'layout' => array( + 'allowSwitching' => false, + 'allowInheriting' => false, + 'default' => array( + 'type' => 'flex' + ) + ), + 'typography' => array( + 'fontSize' => true, + 'lineHeight' => true, + '__experimentalFontFamily' => true, + '__experimentalFontWeight' => true, + '__experimentalFontStyle' => true, + '__experimentalTextTransform' => true, + '__experimentalTextDecoration' => true, + '__experimentalLetterSpacing' => true, + '__experimentalDefaultControls' => array( + 'fontSize' => true + ) + ), + 'interactivity' => array( + 'clientNavigation' => true + ) + ), + 'editorStyle' => 'wp-block-query-pagination-editor', + 'style' => 'wp-block-query-pagination' + ), + 'query-pagination-next' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/query-pagination-next', + 'title' => 'Next Page', + 'category' => 'theme', + 'parent' => array( + 'core/query-pagination' + ), + 'description' => 'Displays the next posts page link.', + 'textdomain' => 'default', + 'attributes' => array( + 'label' => array( + 'type' => 'string' + ) + ), + 'usesContext' => array( + 'queryId', + 'query', + 'paginationArrow', + 'showLabel', + 'enhancedPagination' + ), + 'supports' => array( + 'anchor' => true, + 'reusable' => false, + 'html' => false, + 'color' => array( + 'gradients' => true, + 'text' => false, + '__experimentalDefaultControls' => array( + 'background' => true + ) + ), + 'typography' => array( + 'fontSize' => true, + 'lineHeight' => true, + '__experimentalFontFamily' => true, + '__experimentalFontWeight' => true, + '__experimentalFontStyle' => true, + '__experimentalTextTransform' => true, + '__experimentalTextDecoration' => true, + '__experimentalLetterSpacing' => true, + '__experimentalDefaultControls' => array( + 'fontSize' => true + ) + ), + 'interactivity' => array( + 'clientNavigation' => true + ) + ) + ), + 'query-pagination-numbers' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/query-pagination-numbers', + 'title' => 'Page Numbers', + 'category' => 'theme', + 'parent' => array( + 'core/query-pagination' + ), + 'description' => 'Displays a list of page numbers for pagination.', + 'textdomain' => 'default', + 'attributes' => array( + 'midSize' => array( + 'type' => 'number', + 'default' => 2 + ) + ), + 'usesContext' => array( + 'queryId', + 'query', + 'enhancedPagination' + ), + 'supports' => array( + 'anchor' => true, + 'reusable' => false, + 'html' => false, + 'color' => array( + 'gradients' => true, + 'text' => false, + '__experimentalDefaultControls' => array( + 'background' => true + ) + ), + 'typography' => array( + 'fontSize' => true, + 'lineHeight' => true, + '__experimentalFontFamily' => true, + '__experimentalFontWeight' => true, + '__experimentalFontStyle' => true, + '__experimentalTextTransform' => true, + '__experimentalTextDecoration' => true, + '__experimentalLetterSpacing' => true, + '__experimentalDefaultControls' => array( + 'fontSize' => true + ) + ), + 'interactivity' => array( + 'clientNavigation' => true + ) + ), + 'editorStyle' => 'wp-block-query-pagination-numbers-editor' + ), + 'query-pagination-previous' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/query-pagination-previous', + 'title' => 'Previous Page', + 'category' => 'theme', + 'parent' => array( + 'core/query-pagination' + ), + 'description' => 'Displays the previous posts page link.', + 'textdomain' => 'default', + 'attributes' => array( + 'label' => array( + 'type' => 'string' + ) + ), + 'usesContext' => array( + 'queryId', + 'query', + 'paginationArrow', + 'showLabel', + 'enhancedPagination' + ), + 'supports' => array( + 'anchor' => true, + 'reusable' => false, + 'html' => false, + 'color' => array( + 'gradients' => true, + 'text' => false, + '__experimentalDefaultControls' => array( + 'background' => true + ) + ), + 'typography' => array( + 'fontSize' => true, + 'lineHeight' => true, + '__experimentalFontFamily' => true, + '__experimentalFontWeight' => true, + '__experimentalFontStyle' => true, + '__experimentalTextTransform' => true, + '__experimentalTextDecoration' => true, + '__experimentalLetterSpacing' => true, + '__experimentalDefaultControls' => array( + 'fontSize' => true + ) + ), + 'interactivity' => array( + 'clientNavigation' => true + ) + ) + ), + 'query-title' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/query-title', + 'title' => 'Query Title', + 'category' => 'theme', + 'description' => 'Display the query title.', + 'textdomain' => 'default', + 'attributes' => array( + 'type' => array( + 'type' => 'string' + ), + 'textAlign' => array( + 'type' => 'string' + ), + 'level' => array( + 'type' => 'number', + 'default' => 1 + ), + 'levelOptions' => array( + 'type' => 'array' + ), + 'showPrefix' => array( + 'type' => 'boolean', + 'default' => true + ), + 'showSearchTerm' => array( + 'type' => 'boolean', + 'default' => true + ) + ), + 'example' => array( + 'attributes' => array( + 'type' => 'search' + ) + ), + 'usesContext' => array( + 'query' + ), + 'supports' => array( + 'anchor' => true, + 'align' => array( + 'wide', + 'full' + ), + 'html' => false, + 'color' => array( + 'gradients' => true, + '__experimentalDefaultControls' => array( + 'background' => true, + 'text' => true + ) + ), + 'spacing' => array( + 'margin' => true, + 'padding' => true + ), + 'typography' => array( + 'fontSize' => true, + 'lineHeight' => true, + '__experimentalFontFamily' => true, + '__experimentalFontStyle' => true, + '__experimentalFontWeight' => true, + '__experimentalLetterSpacing' => true, + '__experimentalTextTransform' => true, + '__experimentalTextDecoration' => true, + '__experimentalDefaultControls' => array( + 'fontSize' => true + ) + ), + 'interactivity' => array( + 'clientNavigation' => true + ), + '__experimentalBorder' => array( + 'radius' => true, + 'color' => true, + 'width' => true, + 'style' => true, + '__experimentalDefaultControls' => array( + 'radius' => true, + 'color' => true, + 'width' => true, + 'style' => true + ) + ) + ), + 'style' => 'wp-block-query-title' + ), + 'query-total' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/query-total', + 'title' => 'Query Total', + 'category' => 'theme', + 'ancestor' => array( + 'core/query' + ), + 'description' => 'Display the total number of results in a query.', + 'textdomain' => 'default', + 'attributes' => array( + 'displayType' => array( + 'type' => 'string', + 'default' => 'total-results' + ) + ), + 'usesContext' => array( + 'queryId', + 'query' + ), + 'supports' => array( + 'anchor' => true, + 'align' => array( + 'wide', + 'full' + ), + 'html' => false, + 'spacing' => array( + 'margin' => true, + 'padding' => true + ), + 'color' => array( + 'gradients' => true, + '__experimentalDefaultControls' => array( + 'background' => true, + 'text' => true + ) + ), + 'typography' => array( + 'fontSize' => true, + 'lineHeight' => true, + '__experimentalFontFamily' => true, + '__experimentalFontWeight' => true, + '__experimentalFontStyle' => true, + '__experimentalTextTransform' => true, + '__experimentalTextDecoration' => true, + '__experimentalLetterSpacing' => true, + '__experimentalDefaultControls' => array( + 'fontSize' => true + ) + ), + '__experimentalBorder' => array( + 'radius' => true, + 'color' => true, + 'width' => true, + 'style' => true, + '__experimentalDefaultControls' => array( + 'radius' => true, + 'color' => true, + 'width' => true, + 'style' => true + ) + ), + 'interactivity' => array( + 'clientNavigation' => true + ) + ), + 'style' => 'wp-block-query-total' + ), + 'quote' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/quote', + 'title' => 'Quote', + 'category' => 'text', + 'description' => 'Give quoted text visual emphasis. "In quoting others, we cite ourselves." — Julio Cortázar', + 'keywords' => array( + 'blockquote', + 'cite' + ), + 'textdomain' => 'default', + 'attributes' => array( + 'value' => array( + 'type' => 'string', + 'source' => 'html', + 'selector' => 'blockquote', + 'multiline' => 'p', + 'default' => '', + 'role' => 'content' + ), + 'citation' => array( + 'type' => 'rich-text', + 'source' => 'rich-text', + 'selector' => 'cite', + 'role' => 'content' + ), + 'textAlign' => array( + 'type' => 'string' + ) + ), + 'supports' => array( + 'anchor' => true, + 'align' => array( + 'left', + 'right', + 'wide', + 'full' + ), + 'html' => false, + 'background' => array( + 'backgroundImage' => true, + 'backgroundSize' => true, + '__experimentalDefaultControls' => array( + 'backgroundImage' => true + ) + ), + '__experimentalBorder' => array( + 'color' => true, + 'radius' => true, + 'style' => true, + 'width' => true, + '__experimentalDefaultControls' => array( + 'color' => true, + 'radius' => true, + 'style' => true, + 'width' => true + ) + ), + 'dimensions' => array( + 'minHeight' => true, + '__experimentalDefaultControls' => array( + 'minHeight' => false + ) + ), + '__experimentalOnEnter' => true, + '__experimentalOnMerge' => true, + 'typography' => array( + 'fontSize' => true, + 'lineHeight' => true, + '__experimentalFontFamily' => true, + '__experimentalFontWeight' => true, + '__experimentalFontStyle' => true, + '__experimentalTextTransform' => true, + '__experimentalTextDecoration' => true, + '__experimentalLetterSpacing' => true, + '__experimentalDefaultControls' => array( + 'fontSize' => true + ) + ), + 'color' => array( + 'gradients' => true, + 'heading' => true, + 'link' => true, + '__experimentalDefaultControls' => array( + 'background' => true, + 'text' => true + ) + ), + 'layout' => array( + 'allowEditing' => false + ), + 'spacing' => array( + 'blockGap' => true, + 'padding' => true, + 'margin' => true + ), + 'interactivity' => array( + 'clientNavigation' => true + ), + 'allowedBlocks' => true + ), + 'styles' => array( + array( + 'name' => 'default', + 'label' => 'Default', + 'isDefault' => true + ), + array( + 'name' => 'plain', + 'label' => 'Plain' + ) + ), + 'editorStyle' => 'wp-block-quote-editor', + 'style' => 'wp-block-quote' + ), + 'read-more' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/read-more', + 'title' => 'Read More', + 'category' => 'theme', + 'description' => 'Displays the link of a post, page, or any other content-type.', + 'textdomain' => 'default', + 'attributes' => array( + 'content' => array( + 'type' => 'string', + 'role' => 'content' + ), + 'linkTarget' => array( + 'type' => 'string', + 'default' => '_self' + ) + ), + 'usesContext' => array( + 'postId' + ), + 'supports' => array( + 'anchor' => true, + 'html' => false, + 'color' => array( + 'gradients' => true, + 'text' => true + ), + 'typography' => array( + 'fontSize' => true, + 'lineHeight' => true, + '__experimentalFontFamily' => true, + '__experimentalFontWeight' => true, + '__experimentalFontStyle' => true, + '__experimentalTextTransform' => true, + '__experimentalLetterSpacing' => true, + '__experimentalTextDecoration' => true, + '__experimentalDefaultControls' => array( + 'fontSize' => true, + 'textDecoration' => true + ) + ), + 'spacing' => array( + 'margin' => array( + 'top', + 'bottom' + ), + 'padding' => true, + '__experimentalDefaultControls' => array( + 'padding' => true + ) + ), + '__experimentalBorder' => array( + 'color' => true, + 'radius' => true, + 'width' => true, + '__experimentalDefaultControls' => array( + 'width' => true + ) + ), + 'interactivity' => array( + 'clientNavigation' => true + ) + ), + 'style' => 'wp-block-read-more' + ), + 'rss' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/rss', + 'title' => 'RSS', + 'category' => 'widgets', + 'description' => 'Display entries from any RSS or Atom feed.', + 'keywords' => array( + 'atom', + 'feed' + ), + 'textdomain' => 'default', + 'attributes' => array( + 'columns' => array( + 'type' => 'number', + 'default' => 2 + ), + 'blockLayout' => array( + 'type' => 'string', + 'default' => 'list' + ), + 'feedURL' => array( + 'type' => 'string', + 'default' => '', + 'role' => 'content' + ), + 'itemsToShow' => array( + 'type' => 'number', + 'default' => 5 + ), + 'displayExcerpt' => array( + 'type' => 'boolean', + 'default' => false + ), + 'displayAuthor' => array( + 'type' => 'boolean', + 'default' => false + ), + 'displayDate' => array( + 'type' => 'boolean', + 'default' => false + ), + 'excerptLength' => array( + 'type' => 'number', + 'default' => 55 + ), + 'openInNewTab' => array( + 'type' => 'boolean', + 'default' => false + ), + 'rel' => array( + 'type' => 'string' + ) + ), + 'supports' => array( + 'anchor' => true, + 'align' => true, + 'html' => false, + 'interactivity' => array( + 'clientNavigation' => true + ), + '__experimentalBorder' => array( + 'radius' => true, + 'color' => true, + 'width' => true, + 'style' => true + ), + 'spacing' => array( + 'margin' => true, + 'padding' => true, + '__experimentalDefaultControls' => array( + 'padding' => false, + 'margin' => false + ) + ), + 'color' => array( + 'background' => true, + 'text' => true, + 'gradients' => true, + 'link' => true + ) + ), + 'editorStyle' => 'wp-block-rss-editor', + 'style' => 'wp-block-rss' + ), + 'search' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/search', + 'title' => 'Search', + 'category' => 'widgets', + 'description' => 'Help visitors find your content.', + 'keywords' => array( + 'find' + ), + 'textdomain' => 'default', + 'attributes' => array( + 'label' => array( + 'type' => 'string', + 'role' => 'content' + ), + 'showLabel' => array( + 'type' => 'boolean', + 'default' => true + ), + 'placeholder' => array( + 'type' => 'string', + 'default' => '', + 'role' => 'content' + ), + 'width' => array( + 'type' => 'number' + ), + 'widthUnit' => array( + 'type' => 'string' + ), + 'buttonText' => array( + 'type' => 'string', + 'role' => 'content' + ), + 'buttonPosition' => array( + 'type' => 'string', + 'default' => 'button-outside' + ), + 'buttonUseIcon' => array( + 'type' => 'boolean', + 'default' => false + ), + 'query' => array( + 'type' => 'object', + 'default' => array( + + ) + ), + 'isSearchFieldHidden' => array( + 'type' => 'boolean', + 'default' => false + ) + ), + 'supports' => array( + 'anchor' => true, + 'align' => array( + 'left', + 'center', + 'right' + ), + 'color' => array( + 'gradients' => true, + '__experimentalSkipSerialization' => true, + '__experimentalDefaultControls' => array( + 'background' => true, + 'text' => true + ) + ), + 'interactivity' => true, + 'typography' => array( + '__experimentalSkipSerialization' => true, + '__experimentalSelector' => '.wp-block-search__label, .wp-block-search__input, .wp-block-search__button', + 'fontSize' => true, + 'lineHeight' => true, + '__experimentalFontFamily' => true, + '__experimentalFontWeight' => true, + '__experimentalFontStyle' => true, + '__experimentalTextTransform' => true, + '__experimentalTextDecoration' => true, + '__experimentalLetterSpacing' => true, + '__experimentalDefaultControls' => array( + 'fontSize' => true + ) + ), + '__experimentalBorder' => array( + 'color' => true, + 'radius' => true, + 'width' => true, + '__experimentalSkipSerialization' => true, + '__experimentalDefaultControls' => array( + 'color' => true, + 'radius' => true, + 'width' => true + ) + ), + 'spacing' => array( + 'margin' => true + ), + 'html' => false + ), + 'editorStyle' => 'wp-block-search-editor', + 'style' => 'wp-block-search' + ), + 'separator' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/separator', + 'title' => 'Separator', + 'category' => 'design', + 'description' => 'Create a break between ideas or sections with a horizontal separator.', + 'keywords' => array( + 'horizontal-line', + 'hr', + 'divider' + ), + 'textdomain' => 'default', + 'attributes' => array( + 'opacity' => array( + 'type' => 'string', + 'default' => 'alpha-channel' + ), + 'tagName' => array( + 'type' => 'string', + 'enum' => array( + 'hr', + 'div' + ), + 'default' => 'hr' + ) + ), + 'supports' => array( + 'anchor' => true, + 'align' => array( + 'center', + 'wide', + 'full' + ), + 'color' => array( + 'enableContrastChecker' => false, + '__experimentalSkipSerialization' => true, + 'gradients' => true, + 'background' => true, + 'text' => false, + '__experimentalDefaultControls' => array( + 'background' => true + ) + ), + 'spacing' => array( + 'margin' => array( + 'top', + 'bottom' + ) + ), + 'interactivity' => array( + 'clientNavigation' => true + ) + ), + 'styles' => array( + array( + 'name' => 'default', + 'label' => 'Default', + 'isDefault' => true + ), + array( + 'name' => 'wide', + 'label' => 'Wide Line' + ), + array( + 'name' => 'dots', + 'label' => 'Dots' + ) + ), + 'editorStyle' => 'wp-block-separator-editor', + 'style' => 'wp-block-separator' + ), + 'shortcode' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/shortcode', + 'title' => 'Shortcode', + 'category' => 'widgets', + 'description' => 'Insert additional custom elements with a WordPress shortcode.', + 'textdomain' => 'default', + 'attributes' => array( + 'text' => array( + 'type' => 'string', + 'source' => 'raw', + 'role' => 'content' + ) + ), + 'supports' => array( + 'className' => false, + 'customClassName' => false, + 'html' => false, + 'customCSS' => false + ), + 'editorStyle' => 'wp-block-shortcode-editor' + ), + 'site-logo' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/site-logo', + 'title' => 'Site Logo', + 'category' => 'theme', + 'description' => 'Display an image to represent this site. Update this block and the changes apply everywhere.', + 'textdomain' => 'default', + 'attributes' => array( + 'width' => array( + 'type' => 'number' + ), + 'isLink' => array( + 'type' => 'boolean', + 'default' => true, + 'role' => 'content' + ), + 'linkTarget' => array( + 'type' => 'string', + 'default' => '_self', + 'role' => 'content' + ), + 'shouldSyncIcon' => array( + 'type' => 'boolean' + ) + ), + 'example' => array( + 'viewportWidth' => 500, + 'attributes' => array( + 'width' => 350, + 'className' => 'block-editor-block-types-list__site-logo-example' + ) + ), + 'supports' => array( + 'anchor' => true, + 'html' => false, + 'align' => true, + 'alignWide' => false, + 'color' => array( + 'text' => false, + 'background' => false + ), + 'spacing' => array( + 'margin' => true, + 'padding' => true, + '__experimentalDefaultControls' => array( + 'margin' => false, + 'padding' => false + ) + ), + 'interactivity' => array( + 'clientNavigation' => true + ), + 'filter' => array( + 'duotone' => true + ) + ), + 'styles' => array( + array( + 'name' => 'default', + 'label' => 'Default', + 'isDefault' => true + ), + array( + 'name' => 'rounded', + 'label' => 'Rounded' + ) + ), + 'selectors' => array( + 'filter' => array( + 'duotone' => '.wp-block-site-logo img, .wp-block-site-logo .components-placeholder__illustration, .wp-block-site-logo .components-placeholder::before' + ) + ), + 'editorStyle' => 'wp-block-site-logo-editor', + 'style' => 'wp-block-site-logo' + ), + 'site-tagline' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/site-tagline', + 'title' => 'Site Tagline', + 'category' => 'theme', + 'description' => 'Describe in a few words what this site is about. This is important for search results, sharing on social media, and gives overall clarity to visitors.', + 'keywords' => array( + 'description' + ), + 'textdomain' => 'default', + 'attributes' => array( + 'textAlign' => array( + 'type' => 'string' + ), + 'level' => array( + 'type' => 'number', + 'default' => 0 + ), + 'levelOptions' => array( + 'type' => 'array', + 'default' => array( + 0, + 1, + 2, + 3, + 4, + 5, + 6 + ) + ) + ), + 'example' => array( + 'viewportWidth' => 350, + 'attributes' => array( + 'textAlign' => 'center' + ) + ), + 'supports' => array( + 'anchor' => true, + 'align' => array( + 'wide', + 'full' + ), + 'html' => false, + 'color' => array( + 'gradients' => true, + '__experimentalDefaultControls' => array( + 'background' => true, + 'text' => true + ) + ), + 'contentRole' => true, + 'spacing' => array( + 'margin' => true, + 'padding' => true, + '__experimentalDefaultControls' => array( + 'margin' => false, + 'padding' => false + ) + ), + 'typography' => array( + 'fontSize' => true, + 'lineHeight' => true, + '__experimentalFontFamily' => true, + '__experimentalTextTransform' => true, + '__experimentalTextDecoration' => true, + '__experimentalFontStyle' => true, + '__experimentalFontWeight' => true, + '__experimentalLetterSpacing' => true, + '__experimentalWritingMode' => true, + '__experimentalDefaultControls' => array( + 'fontSize' => true + ) + ), + 'interactivity' => array( + 'clientNavigation' => true + ), + '__experimentalBorder' => array( + 'radius' => true, + 'color' => true, + 'width' => true, + 'style' => true + ) + ), + 'editorStyle' => 'wp-block-site-tagline-editor', + 'style' => 'wp-block-site-tagline' + ), + 'site-title' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/site-title', + 'title' => 'Site Title', + 'category' => 'theme', + 'description' => 'Displays the name of this site. Update the block, and the changes apply everywhere it’s used. This will also appear in the browser title bar and in search results.', + 'textdomain' => 'default', + 'attributes' => array( + 'level' => array( + 'type' => 'number', + 'default' => 1 + ), + 'levelOptions' => array( + 'type' => 'array', + 'default' => array( + 0, + 1, + 2, + 3, + 4, + 5, + 6 + ) + ), + 'textAlign' => array( + 'type' => 'string' + ), + 'isLink' => array( + 'type' => 'boolean', + 'default' => true, + 'role' => 'content' + ), + 'linkTarget' => array( + 'type' => 'string', + 'default' => '_self', + 'role' => 'content' + ) + ), + 'example' => array( + 'viewportWidth' => 500 + ), + 'supports' => array( + 'anchor' => true, + 'align' => array( + 'wide', + 'full' + ), + 'html' => false, + 'color' => array( + 'gradients' => true, + 'link' => true, + '__experimentalDefaultControls' => array( + 'background' => true, + 'text' => true, + 'link' => true + ) + ), + 'spacing' => array( + 'padding' => true, + 'margin' => true, + '__experimentalDefaultControls' => array( + 'margin' => false, + 'padding' => false + ) + ), + 'typography' => array( + 'fontSize' => true, + 'lineHeight' => true, + '__experimentalFontFamily' => true, + '__experimentalTextTransform' => true, + '__experimentalTextDecoration' => true, + '__experimentalFontStyle' => true, + '__experimentalFontWeight' => true, + '__experimentalLetterSpacing' => true, + '__experimentalWritingMode' => true, + '__experimentalDefaultControls' => array( + 'fontSize' => true + ) + ), + 'interactivity' => array( + 'clientNavigation' => true + ), + '__experimentalBorder' => array( + 'radius' => true, + 'color' => true, + 'width' => true, + 'style' => true + ) + ), + 'editorStyle' => 'wp-block-site-title-editor', + 'style' => 'wp-block-site-title' + ), + 'social-link' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/social-link', + 'title' => 'Social Icon', + 'category' => 'widgets', + 'parent' => array( + 'core/social-links' + ), + 'description' => 'Display an icon linking to a social profile or site.', + 'textdomain' => 'default', + 'attributes' => array( + 'url' => array( + 'type' => 'string', + 'role' => 'content' + ), + 'service' => array( + 'type' => 'string' + ), + 'label' => array( + 'type' => 'string', + 'role' => 'content' + ), + 'rel' => array( + 'type' => 'string' + ) + ), + 'usesContext' => array( + 'openInNewTab', + 'showLabels', + 'iconColor', + 'iconColorValue', + 'iconBackgroundColor', + 'iconBackgroundColorValue' + ), + 'supports' => array( + 'anchor' => true, + 'reusable' => false, + 'html' => false, + 'interactivity' => array( + 'clientNavigation' => true + ) + ), + 'editorStyle' => 'wp-block-social-link-editor' + ), + 'social-links' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/social-links', + 'title' => 'Social Icons', + 'category' => 'widgets', + 'allowedBlocks' => array( + 'core/social-link' + ), + 'description' => 'Display icons linking to your social profiles or sites.', + 'keywords' => array( + 'links' + ), + 'textdomain' => 'default', + 'attributes' => array( + 'iconColor' => array( + 'type' => 'string' + ), + 'customIconColor' => array( + 'type' => 'string' + ), + 'iconColorValue' => array( + 'type' => 'string' + ), + 'iconBackgroundColor' => array( + 'type' => 'string' + ), + 'customIconBackgroundColor' => array( + 'type' => 'string' + ), + 'iconBackgroundColorValue' => array( + 'type' => 'string' + ), + 'openInNewTab' => array( + 'type' => 'boolean', + 'default' => false + ), + 'showLabels' => array( + 'type' => 'boolean', + 'default' => false + ), + 'size' => array( + 'type' => 'string' + ) + ), + 'providesContext' => array( + 'openInNewTab' => 'openInNewTab', + 'showLabels' => 'showLabels', + 'iconColor' => 'iconColor', + 'iconColorValue' => 'iconColorValue', + 'iconBackgroundColor' => 'iconBackgroundColor', + 'iconBackgroundColorValue' => 'iconBackgroundColorValue' + ), + 'supports' => array( + 'align' => array( + 'left', + 'center', + 'right' + ), + 'anchor' => true, + 'html' => false, + '__experimentalExposeControlsToChildren' => true, + 'layout' => array( + 'allowSwitching' => false, + 'allowInheriting' => false, + 'allowVerticalAlignment' => false, + 'default' => array( + 'type' => 'flex' + ) + ), + 'color' => array( + 'enableContrastChecker' => false, + 'background' => true, + 'gradients' => true, + 'text' => false, + '__experimentalDefaultControls' => array( + 'background' => false + ) + ), + 'spacing' => array( + 'blockGap' => array( + 'horizontal', + 'vertical' + ), + 'margin' => true, + 'padding' => true, + 'units' => array( + 'px', + 'em', + 'rem', + 'vh', + 'vw' + ), + '__experimentalDefaultControls' => array( + 'blockGap' => true, + 'margin' => true, + 'padding' => false + ) + ), + 'interactivity' => array( + 'clientNavigation' => true + ), + '__experimentalBorder' => array( + 'radius' => true, + 'color' => true, + 'width' => true, + 'style' => true, + '__experimentalDefaultControls' => array( + 'radius' => true, + 'color' => true, + 'width' => true, + 'style' => true + ) + ), + 'contentRole' => true, + 'listView' => true + ), + 'styles' => array( + array( + 'name' => 'default', + 'label' => 'Default', + 'isDefault' => true + ), + array( + 'name' => 'logos-only', + 'label' => 'Logos Only' + ), + array( + 'name' => 'pill-shape', + 'label' => 'Pill Shape' + ) + ), + 'editorStyle' => 'wp-block-social-links-editor', + 'style' => 'wp-block-social-links' + ), + 'spacer' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/spacer', + 'title' => 'Spacer', + 'category' => 'design', + 'description' => 'Add white space between blocks and customize its height.', + 'textdomain' => 'default', + 'attributes' => array( + 'height' => array( + 'type' => 'string', + 'default' => '100px' + ), + 'width' => array( + 'type' => 'string' + ) + ), + 'usesContext' => array( + 'orientation' + ), + 'supports' => array( + 'anchor' => true, + 'spacing' => array( + 'margin' => array( + 'top', + 'bottom' + ), + '__experimentalDefaultControls' => array( + 'margin' => true + ) + ), + 'interactivity' => array( + 'clientNavigation' => true + ) + ), + 'editorStyle' => 'wp-block-spacer-editor', + 'style' => 'wp-block-spacer' + ), + 'table' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/table', + 'title' => 'Table', + 'category' => 'text', + 'description' => 'Create structured content in rows and columns to display information.', + 'textdomain' => 'default', + 'attributes' => array( + 'hasFixedLayout' => array( + 'type' => 'boolean', + 'default' => true + ), + 'caption' => array( + 'type' => 'rich-text', + 'source' => 'rich-text', + 'selector' => 'figcaption', + 'role' => 'content' + ), + 'head' => array( + 'type' => 'array', + 'default' => array( + + ), + 'source' => 'query', + 'selector' => 'thead tr', + 'query' => array( + 'cells' => array( + 'type' => 'array', + 'default' => array( + + ), + 'source' => 'query', + 'selector' => 'td,th', + 'query' => array( + 'content' => array( + 'type' => 'rich-text', + 'source' => 'rich-text', + 'role' => 'content' + ), + 'tag' => array( + 'type' => 'string', + 'default' => 'td', + 'source' => 'tag' + ), + 'scope' => array( + 'type' => 'string', + 'source' => 'attribute', + 'attribute' => 'scope' + ), + 'align' => array( + 'type' => 'string', + 'source' => 'attribute', + 'attribute' => 'data-align' + ), + 'colspan' => array( + 'type' => 'string', + 'source' => 'attribute', + 'attribute' => 'colspan' + ), + 'rowspan' => array( + 'type' => 'string', + 'source' => 'attribute', + 'attribute' => 'rowspan' + ) + ) + ) + ) + ), + 'body' => array( + 'type' => 'array', + 'default' => array( + + ), + 'source' => 'query', + 'selector' => 'tbody tr', + 'query' => array( + 'cells' => array( + 'type' => 'array', + 'default' => array( + + ), + 'source' => 'query', + 'selector' => 'td,th', + 'query' => array( + 'content' => array( + 'type' => 'rich-text', + 'source' => 'rich-text', + 'role' => 'content' + ), + 'tag' => array( + 'type' => 'string', + 'default' => 'td', + 'source' => 'tag' + ), + 'scope' => array( + 'type' => 'string', + 'source' => 'attribute', + 'attribute' => 'scope' + ), + 'align' => array( + 'type' => 'string', + 'source' => 'attribute', + 'attribute' => 'data-align' + ), + 'colspan' => array( + 'type' => 'string', + 'source' => 'attribute', + 'attribute' => 'colspan' + ), + 'rowspan' => array( + 'type' => 'string', + 'source' => 'attribute', + 'attribute' => 'rowspan' + ) + ) + ) + ) + ), + 'foot' => array( + 'type' => 'array', + 'default' => array( + + ), + 'source' => 'query', + 'selector' => 'tfoot tr', + 'query' => array( + 'cells' => array( + 'type' => 'array', + 'default' => array( + + ), + 'source' => 'query', + 'selector' => 'td,th', + 'query' => array( + 'content' => array( + 'type' => 'rich-text', + 'source' => 'rich-text', + 'role' => 'content' + ), + 'tag' => array( + 'type' => 'string', + 'default' => 'td', + 'source' => 'tag' + ), + 'scope' => array( + 'type' => 'string', + 'source' => 'attribute', + 'attribute' => 'scope' + ), + 'align' => array( + 'type' => 'string', + 'source' => 'attribute', + 'attribute' => 'data-align' + ), + 'colspan' => array( + 'type' => 'string', + 'source' => 'attribute', + 'attribute' => 'colspan' + ), + 'rowspan' => array( + 'type' => 'string', + 'source' => 'attribute', + 'attribute' => 'rowspan' + ) + ) + ) + ) + ) + ), + 'supports' => array( + 'anchor' => true, + 'align' => true, + 'color' => array( + '__experimentalSkipSerialization' => true, + 'gradients' => true, + '__experimentalDefaultControls' => array( + 'background' => true, + 'text' => true + ) + ), + 'spacing' => array( + 'margin' => true, + 'padding' => true, + '__experimentalDefaultControls' => array( + 'margin' => false, + 'padding' => false + ) + ), + 'typography' => array( + 'fontSize' => true, + 'lineHeight' => true, + '__experimentalFontFamily' => true, + '__experimentalFontStyle' => true, + '__experimentalFontWeight' => true, + '__experimentalLetterSpacing' => true, + '__experimentalTextTransform' => true, + '__experimentalTextDecoration' => true, + '__experimentalDefaultControls' => array( + 'fontSize' => true + ) + ), + '__experimentalBorder' => array( + '__experimentalSkipSerialization' => true, + 'color' => true, + 'style' => true, + 'width' => true, + '__experimentalDefaultControls' => array( + 'color' => true, + 'style' => true, + 'width' => true + ) + ), + 'interactivity' => array( + 'clientNavigation' => true + ) + ), + 'selectors' => array( + 'root' => '.wp-block-table > table', + 'spacing' => '.wp-block-table' + ), + 'styles' => array( + array( + 'name' => 'regular', + 'label' => 'Default', + 'isDefault' => true + ), + array( + 'name' => 'stripes', + 'label' => 'Stripes' + ) + ), + 'editorStyle' => 'wp-block-table-editor', + 'style' => 'wp-block-table' + ), + 'tag-cloud' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/tag-cloud', + 'title' => 'Tag Cloud', + 'category' => 'widgets', + 'description' => 'A cloud of popular keywords, each sized by how often it appears.', + 'textdomain' => 'default', + 'attributes' => array( + 'numberOfTags' => array( + 'type' => 'number', + 'default' => 45, + 'minimum' => 1, + 'maximum' => 100 + ), + 'taxonomy' => array( + 'type' => 'string', + 'default' => 'post_tag' + ), + 'showTagCounts' => array( + 'type' => 'boolean', + 'default' => false + ), + 'smallestFontSize' => array( + 'type' => 'string', + 'default' => '8pt' + ), + 'largestFontSize' => array( + 'type' => 'string', + 'default' => '22pt' + ) + ), + 'styles' => array( + array( + 'name' => 'default', + 'label' => 'Default', + 'isDefault' => true + ), + array( + 'name' => 'outline', + 'label' => 'Outline' + ) + ), + 'supports' => array( + 'anchor' => true, + 'html' => false, + 'align' => true, + 'spacing' => array( + 'margin' => true, + 'padding' => true + ), + 'typography' => array( + 'lineHeight' => true, + '__experimentalFontFamily' => true, + '__experimentalFontWeight' => true, + '__experimentalFontStyle' => true, + '__experimentalTextTransform' => true, + '__experimentalLetterSpacing' => true + ), + 'interactivity' => array( + 'clientNavigation' => true + ), + '__experimentalBorder' => array( + 'radius' => true, + 'color' => true, + 'width' => true, + 'style' => true, + '__experimentalDefaultControls' => array( + 'radius' => true, + 'color' => true, + 'width' => true, + 'style' => true + ) + ) + ) + ), + 'template-part' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/template-part', + 'title' => 'Template Part', + 'category' => 'theme', + 'description' => 'Edit the different global regions of your site, like the header, footer, sidebar, or create your own.', + 'textdomain' => 'default', + 'attributes' => array( + 'slug' => array( + 'type' => 'string' + ), + 'theme' => array( + 'type' => 'string' + ), + 'tagName' => array( + 'type' => 'string' + ), + 'area' => array( + 'type' => 'string' + ) + ), + 'supports' => array( + 'align' => true, + 'html' => false, + 'reusable' => false, + 'renaming' => false, + 'interactivity' => array( + 'clientNavigation' => true + ) + ), + 'editorStyle' => 'wp-block-template-part-editor' + ), + 'term-count' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/term-count', + 'title' => 'Term Count', + 'category' => 'theme', + 'description' => 'Displays the post count of a taxonomy term.', + 'textdomain' => 'default', + 'usesContext' => array( + 'termId', + 'taxonomy' + ), + 'attributes' => array( + 'bracketType' => array( + 'type' => 'string', + 'enum' => array( + 'none', + 'round', + 'square', + 'curly', + 'angle' + ), + 'default' => 'round' + ) + ), + 'supports' => array( + 'anchor' => true, + 'html' => false, + 'color' => array( + 'gradients' => true, + '__experimentalDefaultControls' => array( + 'background' => true, + 'text' => true + ) + ), + 'spacing' => array( + 'padding' => true + ), + 'typography' => array( + 'fontSize' => true, + 'lineHeight' => true, + '__experimentalFontFamily' => true, + '__experimentalFontWeight' => true, + '__experimentalFontStyle' => true, + '__experimentalTextTransform' => true, + '__experimentalTextDecoration' => true, + '__experimentalLetterSpacing' => true, + '__experimentalDefaultControls' => array( + 'fontSize' => true + ) + ), + 'interactivity' => array( + 'clientNavigation' => true + ), + '__experimentalBorder' => array( + 'radius' => true, + 'color' => true, + 'width' => true, + 'style' => true, + '__experimentalDefaultControls' => array( + 'color' => true, + 'width' => true, + 'style' => true + ) + ) + ), + 'style' => 'wp-block-term-count' + ), + 'term-description' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/term-description', + 'title' => 'Term Description', + 'category' => 'theme', + 'description' => 'Display the description of categories, tags and custom taxonomies when viewing an archive.', + 'textdomain' => 'default', + 'usesContext' => array( + 'termId', + 'taxonomy' + ), + 'supports' => array( + 'anchor' => true, + 'align' => array( + 'wide', + 'full' + ), + 'html' => false, + 'color' => array( + 'link' => true, + '__experimentalDefaultControls' => array( + 'background' => true, + 'text' => true + ) + ), + 'spacing' => array( + 'padding' => true, + 'margin' => true + ), + 'typography' => array( + 'fontSize' => true, + 'lineHeight' => true, + 'textAlign' => true, + '__experimentalFontFamily' => true, + '__experimentalFontWeight' => true, + '__experimentalFontStyle' => true, + '__experimentalTextTransform' => true, + '__experimentalTextDecoration' => true, + '__experimentalLetterSpacing' => true, + '__experimentalDefaultControls' => array( + 'fontSize' => true + ) + ), + 'interactivity' => array( + 'clientNavigation' => true + ), + '__experimentalBorder' => array( + 'radius' => true, + 'color' => true, + 'width' => true, + 'style' => true, + '__experimentalDefaultControls' => array( + 'radius' => true, + 'color' => true, + 'width' => true, + 'style' => true + ) + ) + ) + ), + 'term-name' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/term-name', + 'title' => 'Term Name', + 'category' => 'theme', + 'description' => 'Displays the name of a taxonomy term.', + 'keywords' => array( + 'term title' + ), + 'textdomain' => 'default', + 'usesContext' => array( + 'termId', + 'taxonomy' + ), + 'attributes' => array( + 'textAlign' => array( + 'type' => 'string' + ), + 'level' => array( + 'type' => 'number', + 'default' => 0 + ), + 'isLink' => array( + 'type' => 'boolean', + 'default' => false + ), + 'levelOptions' => array( + 'type' => 'array' + ) + ), + 'supports' => array( + 'anchor' => true, + 'align' => array( + 'wide', + 'full' + ), + 'html' => false, + 'color' => array( + 'gradients' => true, + 'link' => true, + '__experimentalDefaultControls' => array( + 'background' => true, + 'text' => true, + 'link' => true + ) + ), + 'spacing' => array( + 'padding' => true + ), + 'typography' => array( + 'fontSize' => true, + 'lineHeight' => true, + '__experimentalFontFamily' => true, + '__experimentalFontWeight' => true, + '__experimentalFontStyle' => true, + '__experimentalTextTransform' => true, + '__experimentalTextDecoration' => true, + '__experimentalLetterSpacing' => true, + '__experimentalDefaultControls' => array( + 'fontSize' => true + ) + ), + 'interactivity' => array( + 'clientNavigation' => true + ), + '__experimentalBorder' => array( + 'radius' => true, + 'color' => true, + 'width' => true, + 'style' => true, + '__experimentalDefaultControls' => array( + 'color' => true, + 'width' => true, + 'style' => true + ) + ) + ), + 'style' => 'wp-block-term-name' + ), + 'term-template' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/term-template', + 'title' => 'Term Template', + 'category' => 'theme', + 'ancestor' => array( + 'core/terms-query' + ), + 'description' => 'Contains the block elements used to render a taxonomy term, like the name, description, and more.', + 'textdomain' => 'default', + 'usesContext' => array( + 'termQuery' + ), + 'supports' => array( + 'anchor' => true, + 'reusable' => false, + 'html' => false, + 'align' => array( + 'wide', + 'full' + ), + 'layout' => true, + 'color' => array( + 'gradients' => true, + 'link' => true, + '__experimentalDefaultControls' => array( + 'background' => true, + 'text' => true + ) + ), + 'typography' => array( + 'fontSize' => true, + 'lineHeight' => true, + '__experimentalFontFamily' => true, + '__experimentalFontWeight' => true, + '__experimentalFontStyle' => true, + '__experimentalTextTransform' => true, + '__experimentalTextDecoration' => true, + '__experimentalLetterSpacing' => true, + '__experimentalDefaultControls' => array( + 'fontSize' => true + ) + ), + 'spacing' => array( + 'margin' => true, + 'padding' => true, + 'blockGap' => array( + '__experimentalDefault' => '1.25em' + ), + '__experimentalDefaultControls' => array( + 'blockGap' => true, + 'padding' => false, + 'margin' => false + ) + ), + 'interactivity' => array( + 'clientNavigation' => true + ), + '__experimentalBorder' => array( + 'radius' => true, + 'color' => true, + 'width' => true, + 'style' => true + ) + ), + 'style' => 'wp-block-term-template', + 'editorStyle' => 'wp-block-term-template-editor' + ), + 'terms-query' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/terms-query', + 'title' => 'Terms Query', + 'category' => 'theme', + 'description' => 'An advanced block that allows displaying taxonomy terms based on different query parameters and visual configurations.', + 'keywords' => array( + 'terms', + 'taxonomy', + 'categories', + 'tags', + 'list' + ), + 'textdomain' => 'default', + 'attributes' => array( + 'termQuery' => array( + 'type' => 'object', + 'default' => array( + 'perPage' => 10, + 'taxonomy' => 'category', + 'order' => 'asc', + 'orderBy' => 'name', + 'include' => array( + + ), + 'hideEmpty' => true, + 'showNested' => false, + 'inherit' => false + ) + ), + 'tagName' => array( + 'type' => 'string', + 'default' => 'div' + ) + ), + 'usesContext' => array( + 'templateSlug' + ), + 'providesContext' => array( + 'termQuery' => 'termQuery' + ), + 'supports' => array( + 'anchor' => true, + 'align' => array( + 'wide', + 'full' + ), + 'html' => false, + 'layout' => true, + 'interactivity' => true + ) + ), + 'text-columns' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/text-columns', + 'title' => 'Text Columns (deprecated)', + 'icon' => 'columns', + 'category' => 'design', + 'description' => 'This block is deprecated. Please use the Columns block instead.', + 'textdomain' => 'default', + 'attributes' => array( + 'content' => array( + 'type' => 'array', + 'source' => 'query', + 'selector' => 'p', + 'query' => array( + 'children' => array( + 'type' => 'string', + 'source' => 'html' + ) + ), + 'default' => array( + array( + + ), + array( + + ) + ) + ), + 'columns' => array( + 'type' => 'number', + 'default' => 2 + ), + 'width' => array( + 'type' => 'string' + ) + ), + 'supports' => array( + 'inserter' => false, + 'interactivity' => array( + 'clientNavigation' => true + ) + ), + 'editorStyle' => 'wp-block-text-columns-editor', + 'style' => 'wp-block-text-columns' + ), + 'verse' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/verse', + 'title' => 'Poetry', + 'category' => 'text', + 'description' => 'Insert poetry. Use special spacing formats. Or quote song lyrics.', + 'keywords' => array( + 'poetry', + 'poem', + 'verse', + 'stanza', + 'song', + 'lyrics' + ), + 'textdomain' => 'default', + 'attributes' => array( + 'content' => array( + 'type' => 'rich-text', + 'source' => 'rich-text', + 'selector' => 'pre', + '__unstablePreserveWhiteSpace' => true, + 'role' => 'content' + ) + ), + 'supports' => array( + 'anchor' => true, + 'background' => array( + 'backgroundImage' => true, + 'backgroundSize' => true, + '__experimentalDefaultControls' => array( + 'backgroundImage' => true + ) + ), + 'color' => array( + 'gradients' => true, + 'link' => true, + '__experimentalDefaultControls' => array( + 'background' => true, + 'text' => true + ) + ), + 'dimensions' => array( + 'minHeight' => true, + '__experimentalDefaultControls' => array( + 'minHeight' => false + ) + ), + 'typography' => array( + 'fontSize' => true, + '__experimentalFontFamily' => true, + 'lineHeight' => true, + 'textAlign' => true, + '__experimentalFontStyle' => true, + '__experimentalFontWeight' => true, + '__experimentalLetterSpacing' => true, + '__experimentalTextTransform' => true, + '__experimentalTextDecoration' => true, + '__experimentalWritingMode' => true, + '__experimentalDefaultControls' => array( + 'fontSize' => true + ) + ), + 'spacing' => array( + 'margin' => true, + 'padding' => true, + '__experimentalDefaultControls' => array( + 'margin' => false, + 'padding' => false + ) + ), + '__experimentalBorder' => array( + 'radius' => true, + 'width' => true, + 'color' => true, + 'style' => true + ), + 'interactivity' => array( + 'clientNavigation' => true + ) + ), + 'style' => 'wp-block-verse', + 'editorStyle' => 'wp-block-verse-editor' + ), + 'video' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/video', + 'title' => 'Video', + 'category' => 'media', + 'description' => 'Embed a video from your media library or upload a new one.', + 'keywords' => array( + 'movie' + ), + 'textdomain' => 'default', + 'attributes' => array( + 'autoplay' => array( + 'type' => 'boolean', + 'source' => 'attribute', + 'selector' => 'video', + 'attribute' => 'autoplay' + ), + 'caption' => array( + 'type' => 'rich-text', + 'source' => 'rich-text', + 'selector' => 'figcaption', + 'role' => 'content' + ), + 'controls' => array( + 'type' => 'boolean', + 'source' => 'attribute', + 'selector' => 'video', + 'attribute' => 'controls', + 'default' => true + ), + 'id' => array( + 'type' => 'number', + 'role' => 'content' + ), + 'loop' => array( + 'type' => 'boolean', + 'source' => 'attribute', + 'selector' => 'video', + 'attribute' => 'loop' + ), + 'muted' => array( + 'type' => 'boolean', + 'source' => 'attribute', + 'selector' => 'video', + 'attribute' => 'muted' + ), + 'poster' => array( + 'type' => 'string', + 'source' => 'attribute', + 'selector' => 'video', + 'attribute' => 'poster' + ), + 'preload' => array( + 'type' => 'string', + 'source' => 'attribute', + 'selector' => 'video', + 'attribute' => 'preload', + 'default' => 'metadata' + ), + 'blob' => array( + 'type' => 'string', + 'role' => 'local' + ), + 'src' => array( + 'type' => 'string', + 'source' => 'attribute', + 'selector' => 'video', + 'attribute' => 'src', + 'role' => 'content' + ), + 'playsInline' => array( + 'type' => 'boolean', + 'source' => 'attribute', + 'selector' => 'video', + 'attribute' => 'playsinline' + ), + 'tracks' => array( + 'role' => 'content', + 'type' => 'array', + 'items' => array( + 'type' => 'object' + ), + 'default' => array( + + ) + ) + ), + 'supports' => array( + 'anchor' => true, + 'align' => true, + 'spacing' => array( + 'margin' => true, + 'padding' => true, + '__experimentalDefaultControls' => array( + 'margin' => false, + 'padding' => false + ) + ), + 'interactivity' => array( + 'clientNavigation' => true + ) + ), + 'editorStyle' => 'wp-block-video-editor', + 'style' => 'wp-block-video' + ), + 'widget-group' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/widget-group', + 'title' => 'Widget Group', + 'category' => 'widgets', + 'attributes' => array( + 'title' => array( + 'type' => 'string' + ) + ), + 'supports' => array( + 'html' => false, + 'inserter' => true, + 'customClassName' => true, + 'reusable' => false + ), + 'editorStyle' => 'wp-block-widget-group-editor', + 'style' => 'wp-block-widget-group' + ) +); \ No newline at end of file diff --git a/src/wp-includes/blocks/breadcrumbs.php b/src/wp-includes/blocks/breadcrumbs.php new file mode 100644 index 0000000000000..c2e5a7f9513e3 --- /dev/null +++ b/src/wp-includes/blocks/breadcrumbs.php @@ -0,0 +1,611 @@ + 1 ) ) { + $breadcrumb_items[] = array( + 'label' => __( 'Home' ), + 'url' => home_url( '/' ), + ); + } else { + $breadcrumb_items[] = block_core_breadcrumbs_create_item( __( 'Home' ), block_core_breadcrumbs_is_paged() ); + } + } + + // Handle home. + if ( $is_home ) { + // These checks are explicitly nested in order not to execute the `else` branch. + if ( $page_for_posts ) { + $breadcrumb_items[] = block_core_breadcrumbs_create_item( block_core_breadcrumbs_get_post_title( $page_for_posts ), block_core_breadcrumbs_is_paged() ); + } + if ( block_core_breadcrumbs_is_paged() ) { + $breadcrumb_items[] = block_core_breadcrumbs_create_page_number_item(); + } + } elseif ( $is_front_page ) { + // Handle front page. + // This check is explicitly nested in order not to execute the `else` branch. + // If front page is set to custom page and is paged, add the page number. + if ( (int) get_query_var( 'page' ) > 1 ) { + $breadcrumb_items[] = block_core_breadcrumbs_create_page_number_item( 'page' ); + } + } elseif ( is_search() ) { + // Handle search results. + $is_paged = block_core_breadcrumbs_is_paged(); + /* translators: %s: search query */ + $text = sprintf( __( 'Search results for: "%s"' ), wp_trim_words( get_search_query(), 10 ) ); + $breadcrumb_items[] = block_core_breadcrumbs_create_item( $text, $is_paged ); + // Add the "Page X" as the current page if paginated. + if ( $is_paged ) { + $breadcrumb_items[] = block_core_breadcrumbs_create_page_number_item(); + } + } elseif ( is_404() ) { + // Handle 404 pages. + $breadcrumb_items[] = array( + 'label' => __( 'Page not found' ), + ); + } elseif ( is_archive() ) { + // Handle archive pages (taxonomy, post type, date, author archives). + $archive_breadcrumbs = block_core_breadcrumbs_get_archive_breadcrumbs(); + if ( ! empty( $archive_breadcrumbs ) ) { + $breadcrumb_items = array_merge( $breadcrumb_items, $archive_breadcrumbs ); + } + } else { + // Handle single post/page breadcrumbs. + if ( ! isset( $block->context['postId'] ) || ! isset( $block->context['postType'] ) ) { + return ''; + } + + $post_id = $block->context['postId']; + $post_type = $block->context['postType']; + + $post = get_post( $post_id ); + if ( ! $post ) { + return ''; + } + + // For non-hierarchical post types with parents (e.g., attachments), build trail for the parent. + $post_parent = $post->post_parent; + $parent_post = null; + if ( ! is_post_type_hierarchical( $post_type ) && $post_parent ) { + $parent_post = get_post( $post_parent ); + if ( $parent_post ) { + $post_id = $parent_post->ID; + $post_type = $parent_post->post_type; + $post_parent = $parent_post->post_parent; + } + } + + // Determine breadcrumb type. + // Some non-hierarchical post types (e.g., attachments) can have parents. + // Use hierarchical breadcrumbs if a parent exists, otherwise use taxonomy breadcrumbs. + $show_terms = false; + if ( ! is_post_type_hierarchical( $post_type ) && ! $post_parent ) { + $show_terms = true; + } elseif ( empty( get_object_taxonomies( $post_type, 'objects' ) ) ) { + $show_terms = false; + } else { + $show_terms = $attributes['prefersTaxonomy']; + } + + // Add post type archive link if applicable. + $post_type_object = get_post_type_object( $post_type ); + $archive_link = get_post_type_archive_link( $post_type ); + if ( $archive_link && untrailingslashit( home_url() ) !== untrailingslashit( $archive_link ) ) { + $label = $post_type_object->labels->archives; + if ( 'post' === $post_type && $page_for_posts ) { + $label = block_core_breadcrumbs_get_post_title( $page_for_posts ); + } + $breadcrumb_items[] = array( + 'label' => $label, + 'url' => $archive_link, + ); + } + // Build breadcrumb trail based on hierarchical structure or taxonomy terms. + if ( ! $show_terms ) { + $breadcrumb_items = array_merge( $breadcrumb_items, block_core_breadcrumbs_get_hierarchical_post_type_breadcrumbs( $post_id ) ); + } else { + $breadcrumb_items = array_merge( $breadcrumb_items, block_core_breadcrumbs_get_terms_breadcrumbs( $post_id, $post_type ) ); + } + + // Add post title: linked when viewing a paginated page, plain text otherwise. + $is_paged = (int) get_query_var( 'page' ) > 1 || (int) get_query_var( 'cpage' ) > 1; + $title = block_core_breadcrumbs_get_post_title( $post ); + + if ( $is_paged ) { + $breadcrumb_items[] = array( + 'label' => $title, + 'url' => get_permalink( $post ), + 'allow_html' => true, + ); + $breadcrumb_items[] = block_core_breadcrumbs_create_page_number_item( (int) get_query_var( 'cpage' ) > 1 ? 'cpage' : 'page' ); + } else { + $breadcrumb_items[] = array( + 'label' => $title, + 'allow_html' => true, + ); + } + } + + // Remove current item if disabled. + if ( ! $attributes['showCurrentItem'] && ! empty( $breadcrumb_items ) ) { + array_pop( $breadcrumb_items ); + } + + /** + * Filters the breadcrumb items array before rendering. + * + * Allows developers to modify, add, or remove breadcrumb items. + * + * @since 7.0.0 + * + * @param array[] $breadcrumb_items { + * Array of breadcrumb item data. + * + * @type string $label The breadcrumb text. + * @type string $url Optional. The breadcrumb link URL. + * @type bool $allow_html Optional. Whether to allow HTML in the label. + * When true, the label will be sanitized with wp_kses_post(), + * allowing only safe HTML tags. When false or omitted, all HTML + * will be escaped with esc_html(). Default false. + * } + */ + $breadcrumb_items = apply_filters( 'block_core_breadcrumbs_items', $breadcrumb_items ); + + if ( empty( $breadcrumb_items ) ) { + return ''; + } + + $wrapper_attributes = get_block_wrapper_attributes( + array( + 'style' => '--separator: "' . addcslashes( $attributes['separator'], '\\"' ) . '";', + 'aria-label' => __( 'Breadcrumbs' ), + ) + ); + + $breadcrumb_html = sprintf( + '', + $wrapper_attributes, + implode( + '', + array_map( + static function ( $item ) { + $label = ! empty( $item['allow_html'] ) ? wp_kses_post( $item['label'] ) : esc_html( $item['label'] ); + if ( ! empty( $item['url'] ) ) { + return '
  • ' . $label . '
  • '; + } + return '
  • ' . $label . '
  • '; + }, + $breadcrumb_items + ) + ) + ); + + return $breadcrumb_html; +} + +/** + * Checks if we're on a paginated view (page 2 or higher). + * + * @since 7.0.0 + * + * @return bool True if paged > 1, false otherwise. + */ +function block_core_breadcrumbs_is_paged() { + $paged = (int) get_query_var( 'paged' ); + return $paged > 1; +} + +/** + * Creates a "Page X" breadcrumb item for paginated views. + * + * @since 7.0.0 + * @param string $query_var Optional. Query variable to get current page number. Default 'paged'. + * @return array The "Page X" breadcrumb item data. + */ +function block_core_breadcrumbs_create_page_number_item( $query_var = 'paged' ) { + $paged = (int) get_query_var( $query_var ); + + if ( 'cpage' === $query_var ) { + return array( + 'label' => sprintf( + /* translators: %s: comment page number */ + __( 'Comments Page %s' ), + number_format_i18n( $paged ) + ), + ); + } + + return array( + 'label' => sprintf( + /* translators: %s: page number */ + __( 'Page %s' ), + number_format_i18n( $paged ) + ), + ); +} + + +/** + * Creates a breadcrumb item that's either a link or current page item. + * + * When paginated (is_paged is true), creates a link to page 1. + * Otherwise, creates a span marked as the current page. + * + * @since 7.0.0 + * + * @param string $text The text content. + * @param bool $is_paged Whether we're on a paginated view. + * + * @return array The breadcrumb item data. + */ +function block_core_breadcrumbs_create_item( $text, $is_paged = false ) { + $item = array( 'label' => $text ); + if ( $is_paged ) { + $item['url'] = get_pagenum_link( 1 ); + } + return $item; +} + +/** + * Gets a post title with fallback for empty titles. + * + * @since 7.0.0 + * + * @param int|WP_Post $post_id_or_object The post ID or post object. + * + * @return string The post title or fallback text. + */ +function block_core_breadcrumbs_get_post_title( $post_id_or_object ) { + $title = get_the_title( $post_id_or_object ); + if ( strlen( $title ) === 0 ) { + $title = __( '(no title)' ); + } + return $title; +} + +/** + * Generates breadcrumb items from hierarchical post type ancestors. + * + * @since 7.0.0 + * + * @param int $post_id The post ID. + * + * @return array Array of breadcrumb item data. + */ +function block_core_breadcrumbs_get_hierarchical_post_type_breadcrumbs( $post_id ) { + $breadcrumb_items = array(); + $ancestors = get_post_ancestors( $post_id ); + $ancestors = array_reverse( $ancestors ); + + foreach ( $ancestors as $ancestor_id ) { + $breadcrumb_items[] = array( + 'label' => block_core_breadcrumbs_get_post_title( $ancestor_id ), + 'url' => get_permalink( $ancestor_id ), + 'allow_html' => true, + ); + } + return $breadcrumb_items; +} + +/** + * Generates breadcrumb items for hierarchical term ancestors. + * + * For hierarchical taxonomies, retrieves and formats ancestor terms as breadcrumb links. + * + * @since 7.0.0 + * + * @param int $term_id The term ID. + * @param string $taxonomy The taxonomy name. + * + * @return array Array of breadcrumb item data for ancestors. + */ +function block_core_breadcrumbs_get_term_ancestors_items( $term_id, $taxonomy ) { + $breadcrumb_items = array(); + + // Check if taxonomy is hierarchical and add ancestor term links. + if ( is_taxonomy_hierarchical( $taxonomy ) ) { + $term_ancestors = get_ancestors( $term_id, $taxonomy, 'taxonomy' ); + $term_ancestors = array_reverse( $term_ancestors ); + foreach ( $term_ancestors as $ancestor_id ) { + $ancestor_term = get_term( $ancestor_id, $taxonomy ); + if ( $ancestor_term && ! is_wp_error( $ancestor_term ) ) { + $breadcrumb_items[] = array( + 'label' => $ancestor_term->name, + 'url' => get_term_link( $ancestor_term ), + ); + } + } + } + + return $breadcrumb_items; +} + +/** + * Generates breadcrumb items for archive pages. + * + * Handles taxonomy archives, post type archives, date archives, and author archives. + * For hierarchical taxonomies, includes ancestor terms in the breadcrumb trail. + * + * @since 7.0.0 + * + * @return array Array of breadcrumb item data. + */ +function block_core_breadcrumbs_get_archive_breadcrumbs() { + $breadcrumb_items = array(); + + // Date archive (check first since it doesn't have a queried object). + if ( is_date() ) { + $year = get_query_var( 'year' ); + $month = get_query_var( 'monthnum' ); + $day = get_query_var( 'day' ); + + // Fallback to 'm' query var for plain permalinks. + // Plain permalinks use ?m=YYYYMMDD format instead of separate query vars. + if ( ! $year ) { + $m = get_query_var( 'm' ); + if ( $m ) { + $year = substr( $m, 0, 4 ); + $month = substr( $m, 4, 2 ); + $day = (int) substr( $m, 6, 2 ); + } + } + + $is_paged = block_core_breadcrumbs_is_paged(); + + if ( $year ) { + if ( $month ) { + // Year is linked if we have month. + $breadcrumb_items[] = array( + 'label' => $year, + 'url' => get_year_link( $year ), + ); + + if ( $day ) { + // Month is linked if we have day. + $breadcrumb_items[] = array( + 'label' => date_i18n( 'F', mktime( 0, 0, 0, $month, 1, $year ) ), + 'url' => get_month_link( $year, $month ), + ); + // Add day (current if not paginated, link if paginated). + $breadcrumb_items[] = block_core_breadcrumbs_create_item( + $day, + $is_paged + ); + } else { + // Add month (current if not paginated, link if paginated). + $breadcrumb_items[] = block_core_breadcrumbs_create_item( + date_i18n( 'F', mktime( 0, 0, 0, $month, 1, $year ) ), + $is_paged + ); + } + } else { + // Add year (current if not paginated, link if paginated). + $breadcrumb_items[] = block_core_breadcrumbs_create_item( + $year, + $is_paged + ); + } + } + + // Add pagination breadcrumb if on a paged date archive. + if ( $is_paged ) { + $breadcrumb_items[] = block_core_breadcrumbs_create_page_number_item(); + } + + return $breadcrumb_items; + } + + // For other archive types, we need a queried object. + $queried_object = get_queried_object(); + + if ( ! $queried_object ) { + return array(); + } + + $is_paged = block_core_breadcrumbs_is_paged(); + + // Taxonomy archive (category, tag, custom taxonomy). + if ( $queried_object instanceof WP_Term ) { + $term = $queried_object; + $taxonomy = $term->taxonomy; + + // Add hierarchical term ancestors if applicable. + $breadcrumb_items = array_merge( + $breadcrumb_items, + block_core_breadcrumbs_get_term_ancestors_items( $term->term_id, $taxonomy ) + ); + + // Add current term (current if not paginated, link if paginated). + $breadcrumb_items[] = block_core_breadcrumbs_create_item( + $term->name, + $is_paged + ); + } elseif ( is_post_type_archive() ) { + // Post type archive. + $post_type = get_query_var( 'post_type' ); + if ( is_array( $post_type ) ) { + $post_type = reset( $post_type ); + } + $post_type_object = get_post_type_object( $post_type ); + + /** This filter is documented in wp-includes/general-template.php */ + $title = apply_filters( 'post_type_archive_title', $post_type_object->labels->archives, $post_type ); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound + + if ( $post_type_object ) { + // Add post type (current if not paginated, link if paginated). + $breadcrumb_items[] = block_core_breadcrumbs_create_item( + $title ? $title : $post_type_object->labels->archives, + $is_paged + ); + } + } elseif ( is_author() ) { + // Author archive. + $author = $queried_object; + // Add author (current if not paginated, link if paginated). + $breadcrumb_items[] = block_core_breadcrumbs_create_item( + $author->display_name, + $is_paged + ); + } + + // Add pagination breadcrumb if on a paged archive. + if ( $is_paged ) { + $breadcrumb_items[] = block_core_breadcrumbs_create_page_number_item(); + } + + return $breadcrumb_items; +} + +/** + * Generates breadcrumb items from taxonomy terms. + * + * Finds the first publicly queryable taxonomy with terms assigned to the post + * and generates breadcrumb links, including hierarchical term ancestors if applicable. + * + * @since 7.0.0 + * + * @param int $post_id The post ID. + * @param string $post_type The post type name. + * + * @return array Array of breadcrumb item data. + */ +function block_core_breadcrumbs_get_terms_breadcrumbs( $post_id, $post_type ) { + $breadcrumb_items = array(); + + // Get public taxonomies for this post type. + $taxonomies = wp_filter_object_list( + get_object_taxonomies( $post_type, 'objects' ), + array( + 'publicly_queryable' => true, + 'show_in_rest' => true, + ) + ); + + if ( empty( $taxonomies ) ) { + return $breadcrumb_items; + } + + /** + * Filters breadcrumb settings (taxonomy and term selection) for a post or post type. + * + * Allows developers to specify which taxonomy and term should be used in the + * breadcrumb trail when a post type has multiple taxonomies or when a post is + * assigned to multiple terms within a taxonomy. + * + * @since 7.0.0 + * + * @param array $settings { + * Array of breadcrumb settings. Default empty array. + * + * @type string $taxonomy Optional. Taxonomy slug to use for breadcrumbs. + * The taxonomy must be registered for the post type and have + * terms assigned to the post. If not found or has no terms, + * fall back to the first available taxonomy with terms. + * @type string $term Optional. Term slug to use when the post has multiple terms + * in the selected taxonomy. If the term is not found or not + * assigned to the post, fall back to the first term. If the + * post has only one term, that term is used regardless. + * } + * @param string $post_type The post type slug. + * @param int $post_id The post ID. + */ + $settings = apply_filters( 'block_core_breadcrumbs_post_type_settings', array(), $post_type, $post_id ); + + $taxonomy_name = null; + $terms = array(); + + // Try preferred taxonomy first if specified. + if ( ! empty( $settings['taxonomy'] ) ) { + foreach ( $taxonomies as $taxonomy ) { + if ( $taxonomy->name === $settings['taxonomy'] ) { + $post_terms = get_the_terms( $post_id, $taxonomy->name ); + if ( ! empty( $post_terms ) && ! is_wp_error( $post_terms ) ) { + $taxonomy_name = $taxonomy->name; + $terms = $post_terms; + } + break; + } + } + } + + // If no preferred taxonomy or it didn't have terms, find the first taxonomy with terms. + if ( empty( $terms ) ) { + foreach ( $taxonomies as $taxonomy ) { + $post_terms = get_the_terms( $post_id, $taxonomy->name ); + if ( ! empty( $post_terms ) && ! is_wp_error( $post_terms ) ) { + $taxonomy_name = $taxonomy->name; + $terms = $post_terms; + break; + } + } + } + + if ( ! empty( $terms ) ) { + // Select which term to use. + $term = reset( $terms ); + + // Try preferred term if specified and post has multiple terms. + if ( ! empty( $settings['term'] ) && count( $terms ) > 1 ) { + foreach ( $terms as $candidate_term ) { + if ( $candidate_term->slug === $settings['term'] ) { + $term = $candidate_term; + break; + } + } + } + + // Add hierarchical term ancestors if applicable. + $breadcrumb_items = array_merge( + $breadcrumb_items, + block_core_breadcrumbs_get_term_ancestors_items( $term->term_id, $taxonomy_name ) + ); + $breadcrumb_items[] = array( + 'label' => $term->name, + 'url' => get_term_link( $term ), + ); + } + return $breadcrumb_items; +} + +/** + * Registers the `core/breadcrumbs` block on the server. + * + * @since 7.0.0 + */ +function register_block_core_breadcrumbs() { + register_block_type_from_metadata( + __DIR__ . '/breadcrumbs', + array( + 'render_callback' => 'render_block_core_breadcrumbs', + ) + ); +} +add_action( 'init', 'register_block_core_breadcrumbs' ); diff --git a/src/wp-includes/blocks/breadcrumbs/block.json b/src/wp-includes/blocks/breadcrumbs/block.json new file mode 100644 index 0000000000000..597e36c41ae50 --- /dev/null +++ b/src/wp-includes/blocks/breadcrumbs/block.json @@ -0,0 +1,78 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "core/breadcrumbs", + "title": "Breadcrumbs", + "category": "theme", + "description": "Display a breadcrumb trail showing the path to the current page.", + "textdomain": "default", + "attributes": { + "prefersTaxonomy": { + "type": "boolean", + "default": false + }, + "separator": { + "type": "string", + "default": "/" + }, + "showHomeItem": { + "type": "boolean", + "default": true + }, + "showCurrentItem": { + "type": "boolean", + "default": true + }, + "showOnHomePage": { + "type": "boolean", + "default": false + } + }, + "usesContext": [ "postId", "postType", "templateSlug" ], + "supports": { + "anchor": true, + "html": false, + "align": [ "wide", "full" ], + "spacing": { + "margin": true, + "padding": true + }, + "color": { + "gradients": true, + "link": true, + "__experimentalDefaultControls": { + "background": true, + "text": true + } + }, + "__experimentalBorder": { + "radius": true, + "color": true, + "width": true, + "style": true, + "__experimentalDefaultControls": { + "radius": false, + "color": true, + "width": true, + "style": true + } + }, + "typography": { + "fontSize": true, + "lineHeight": true, + "__experimentalFontFamily": true, + "__experimentalFontWeight": true, + "__experimentalFontStyle": true, + "__experimentalTextTransform": true, + "__experimentalTextDecoration": true, + "__experimentalLetterSpacing": true, + "__experimentalDefaultControls": { + "fontSize": true + } + }, + "interactivity": { + "clientNavigation": true + } + }, + "style": "wp-block-breadcrumbs" +} diff --git a/src/wp-includes/blocks/button.php b/src/wp-includes/blocks/button.php new file mode 100644 index 0000000000000..0d03440b1cb0f --- /dev/null +++ b/src/wp-includes/blocks/button.php @@ -0,0 +1,79 @@ +` or `'; + + $body_content = preg_replace( '/]+>/', $button, $body_content ); + + $overlay_callback = function () { + block_core_image_print_lightbox_overlay(); + }; + add_action( 'wp_footer', $overlay_callback ); + + return $body_content; +} + +/** + * @since 6.5.0 + */ +function block_core_image_print_lightbox_overlay() { + $dialog_label = esc_attr__( 'Enlarged images' ); + $close_button_text = esc_attr__( 'Close' ); + $prev_button_text = esc_attr__( 'Previous' ); + $next_button_text = esc_attr__( 'Next' ); + $close_button_icon = ''; + $prev_button_icon = ''; + $next_button_icon = ''; + + // If the current theme does NOT have a `theme.json`, or the colors are not + // defined, it needs to set the background color & close button color to some + // default values because it can't get them from the Global Styles. + $background_color = '#fff'; + $close_button_color = '#000'; + if ( wp_theme_has_theme_json() ) { + $global_styles_color = wp_get_global_styles( array( 'color' ) ); + if ( ! empty( $global_styles_color['background'] ) ) { + $background_color = esc_attr( $global_styles_color['background'] ); + } + if ( ! empty( $global_styles_color['text'] ) ) { + $close_button_color = esc_attr( $global_styles_color['text'] ); + } + } + + echo << + + + + + +
    + + +HTML; +} + +/** + * Registers the `core/image` block on server. + * + * @since 5.9.0 + */ +function register_block_core_image() { + register_block_type_from_metadata( + __DIR__ . '/image', + array( + 'render_callback' => 'render_block_core_image', + ) + ); +} +add_action( 'init', 'register_block_core_image' ); diff --git a/src/wp-includes/blocks/image/block.json b/src/wp-includes/blocks/image/block.json new file mode 100644 index 0000000000000..66a4fac4a3023 --- /dev/null +++ b/src/wp-includes/blocks/image/block.json @@ -0,0 +1,156 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "core/image", + "title": "Image", + "category": "media", + "usesContext": [ + "allowResize", + "imageCrop", + "fixedHeight", + "navigationButtonType", + "postId", + "postType", + "queryId", + "galleryId" + ], + "description": "Insert an image to make a visual statement.", + "keywords": [ "img", "photo", "picture" ], + "textdomain": "default", + "attributes": { + "blob": { + "type": "string", + "role": "local" + }, + "url": { + "type": "string", + "source": "attribute", + "selector": "img", + "attribute": "src", + "role": "content" + }, + "alt": { + "type": "string", + "source": "attribute", + "selector": "img", + "attribute": "alt", + "default": "", + "role": "content" + }, + "caption": { + "type": "rich-text", + "source": "rich-text", + "selector": "figcaption", + "role": "content" + }, + "lightbox": { + "type": "object", + "enabled": { + "type": "boolean" + } + }, + "title": { + "type": "string", + "source": "attribute", + "selector": "img", + "attribute": "title", + "role": "content" + }, + "href": { + "type": "string", + "source": "attribute", + "selector": "figure > a", + "attribute": "href", + "role": "content" + }, + "rel": { + "type": "string", + "source": "attribute", + "selector": "figure > a", + "attribute": "rel" + }, + "linkClass": { + "type": "string", + "source": "attribute", + "selector": "figure > a", + "attribute": "class" + }, + "id": { + "type": "number", + "role": "content" + }, + "width": { + "type": "string" + }, + "height": { + "type": "string" + }, + "aspectRatio": { + "type": "string" + }, + "scale": { + "type": "string" + }, + "focalPoint": { + "type": "object" + }, + "sizeSlug": { + "type": "string" + }, + "linkDestination": { + "type": "string" + }, + "linkTarget": { + "type": "string", + "source": "attribute", + "selector": "figure > a", + "attribute": "target" + } + }, + "supports": { + "interactivity": true, + "align": [ "left", "center", "right", "wide", "full" ], + "anchor": true, + "color": { + "text": false, + "background": false + }, + "filter": { + "duotone": true + }, + "spacing": { + "margin": true + }, + "__experimentalBorder": { + "color": true, + "radius": true, + "width": true, + "__experimentalSkipSerialization": true, + "__experimentalDefaultControls": { + "color": true, + "radius": true, + "width": true + } + }, + "shadow": { + "__experimentalSkipSerialization": true + } + }, + "selectors": { + "border": ".wp-block-image img, .wp-block-image .wp-block-image__crop-area, .wp-block-image .components-placeholder", + "shadow": ".wp-block-image img, .wp-block-image .wp-block-image__crop-area, .wp-block-image .components-placeholder", + "filter": { + "duotone": ".wp-block-image img, .wp-block-image .components-placeholder" + } + }, + "styles": [ + { + "name": "default", + "label": "Default", + "isDefault": true + }, + { "name": "rounded", "label": "Rounded" } + ], + "editorStyle": "wp-block-image-editor", + "style": "wp-block-image" +} diff --git a/src/wp-includes/blocks/latest-comments.php b/src/wp-includes/blocks/latest-comments.php new file mode 100644 index 0000000000000..eec7e104533d1 --- /dev/null +++ b/src/wp-includes/blocks/latest-comments.php @@ -0,0 +1,171 @@ + $attributes['commentsToShow'], + 'status' => 'approve', + 'post_status' => 'publish', + ), + array() + ) + ); + + $list_items_markup = ''; + if ( ! empty( $comments ) ) { + // Prime the cache for associated posts. This is copied from \WP_Widget_Recent_Comments::widget(). + $post_ids = array_unique( wp_list_pluck( $comments, 'comment_post_ID' ) ); + _prime_post_caches( $post_ids, strpos( get_option( 'permalink_structure' ), '%category%' ), false ); + + foreach ( $comments as $comment ) { + $list_items_markup .= '
  • '; + if ( $attributes['displayAvatar'] ) { + $avatar = get_avatar( + $comment, + 48, + '', + '', + array( + 'class' => 'wp-block-latest-comments__comment-avatar', + ) + ); + if ( $avatar ) { + $list_items_markup .= $avatar; + } + } + + $list_items_markup .= '
    '; + $list_items_markup .= ''; + if ( 'full' === $display_content ) { + $list_items_markup .= '
    ' . wpautop( get_comment_text( $comment ) ) . '
    '; + } elseif ( 'excerpt' === $display_content ) { + $list_items_markup .= '
    ' . wpautop( get_comment_excerpt( $comment ) ) . '
    '; + } + $list_items_markup .= '
  • '; + } + } + + $classnames = array(); + if ( $attributes['displayAvatar'] ) { + $classnames[] = 'has-avatars'; + } + if ( $attributes['displayDate'] ) { + $classnames[] = 'has-dates'; + } + if ( 'none' !== $display_content ) { + $classnames[] = 'has-excerpts'; + } + if ( empty( $comments ) ) { + $classnames[] = 'no-comments'; + } + $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => implode( ' ', $classnames ) ) ); + + return ! empty( $comments ) ? sprintf( + '
      %2$s
    ', + $wrapper_attributes, + $list_items_markup + ) : sprintf( + '
    %2$s
    ', + $wrapper_attributes, + __( 'No comments to show.' ) + ); +} + +/** + * Registers the `core/latest-comments` block. + * + * @since 5.3.0 + */ +function register_block_core_latest_comments() { + register_block_type_from_metadata( + __DIR__ . '/latest-comments', + array( + 'render_callback' => 'render_block_core_latest_comments', + ) + ); +} + +add_action( 'init', 'register_block_core_latest_comments' ); diff --git a/src/wp-includes/blocks/latest-comments/block.json b/src/wp-includes/blocks/latest-comments/block.json new file mode 100644 index 0000000000000..781d39b1851f0 --- /dev/null +++ b/src/wp-includes/blocks/latest-comments/block.json @@ -0,0 +1,66 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "core/latest-comments", + "title": "Latest Comments", + "category": "widgets", + "description": "Display a list of your most recent comments.", + "keywords": [ "recent comments" ], + "textdomain": "default", + "attributes": { + "commentsToShow": { + "type": "number", + "default": 5, + "minimum": 1, + "maximum": 100 + }, + "displayAvatar": { + "type": "boolean", + "default": true + }, + "displayDate": { + "type": "boolean", + "default": true + }, + "displayContent": { + "type": "string", + "default": "excerpt", + "enum": [ "none", "excerpt", "full" ] + } + }, + "supports": { + "anchor": true, + "align": true, + "color": { + "gradients": true, + "link": true, + "__experimentalDefaultControls": { + "background": true, + "text": true, + "link": true + } + }, + "html": false, + "spacing": { + "margin": true, + "padding": true + }, + "typography": { + "fontSize": true, + "lineHeight": true, + "__experimentalFontFamily": true, + "__experimentalFontWeight": true, + "__experimentalFontStyle": true, + "__experimentalTextTransform": true, + "__experimentalTextDecoration": true, + "__experimentalLetterSpacing": true, + "__experimentalDefaultControls": { + "fontSize": true + } + }, + "interactivity": { + "clientNavigation": true + } + }, + "style": "wp-block-latest-comments" +} diff --git a/src/wp-includes/blocks/latest-posts.php b/src/wp-includes/blocks/latest-posts.php new file mode 100644 index 0000000000000..44231ac6d14a1 --- /dev/null +++ b/src/wp-includes/blocks/latest-posts.php @@ -0,0 +1,275 @@ + $attributes['postsToShow'], + 'post_status' => 'publish', + 'order' => $attributes['order'], + 'orderby' => $attributes['orderBy'], + 'ignore_sticky_posts' => true, + 'no_found_rows' => true, + ); + + $block_core_latest_posts_excerpt_length = $attributes['excerptLength']; + add_filter( 'excerpt_length', 'block_core_latest_posts_get_excerpt_length', 20 ); + + if ( ! empty( $attributes['categories'] ) ) { + $args['category__in'] = array_column( $attributes['categories'], 'id' ); + } + if ( isset( $attributes['selectedAuthor'] ) ) { + $args['author'] = $attributes['selectedAuthor']; + } + + $query = new WP_Query(); + $recent_posts = $query->query( $args ); + + if ( isset( $attributes['displayFeaturedImage'] ) && $attributes['displayFeaturedImage'] ) { + update_post_thumbnail_cache( $query ); + } + + $list_items_markup = ''; + + foreach ( $recent_posts as $post ) { + $post_link = esc_url( get_permalink( $post ) ); + $title = get_the_title( $post ); + + if ( ! $title ) { + $title = __( '(no title)' ); + } + + $list_items_markup .= '
  • '; + + if ( $attributes['displayFeaturedImage'] && has_post_thumbnail( $post ) ) { + $image_style = ''; + if ( isset( $attributes['featuredImageSizeWidth'] ) ) { + $image_style .= sprintf( 'max-width:%spx;', $attributes['featuredImageSizeWidth'] ); + } + if ( isset( $attributes['featuredImageSizeHeight'] ) ) { + $image_style .= sprintf( 'max-height:%spx;', $attributes['featuredImageSizeHeight'] ); + } + + $image_classes = 'wp-block-latest-posts__featured-image'; + if ( isset( $attributes['featuredImageAlign'] ) ) { + $image_classes .= ' align' . $attributes['featuredImageAlign']; + } + + $featured_image = get_the_post_thumbnail( + $post, + $attributes['featuredImageSizeSlug'], + array( + 'style' => esc_attr( $image_style ), + ) + ); + if ( $attributes['addLinkToFeaturedImage'] ) { + $featured_image = sprintf( + '%3$s', + esc_url( $post_link ), + esc_attr( $title ), + $featured_image + ); + } + $list_items_markup .= sprintf( + '
    %2$s
    ', + esc_attr( $image_classes ), + $featured_image + ); + } + + $list_items_markup .= sprintf( + '%2$s', + esc_url( $post_link ), + $title + ); + + if ( isset( $attributes['displayAuthor'] ) && $attributes['displayAuthor'] ) { + $author_display_name = get_the_author_meta( 'display_name', $post->post_author ); + + /* translators: byline. %s: author. */ + $byline = sprintf( __( 'by %s' ), $author_display_name ); + + if ( ! empty( $author_display_name ) ) { + $list_items_markup .= sprintf( + '', + $byline + ); + } + } + + if ( isset( $attributes['displayPostDate'] ) && $attributes['displayPostDate'] ) { + $list_items_markup .= sprintf( + '', + esc_attr( get_the_date( 'c', $post ) ), + get_the_date( '', $post ) + ); + } + + if ( isset( $attributes['displayPostContent'] ) && $attributes['displayPostContent'] + && isset( $attributes['displayPostContentRadio'] ) && 'excerpt' === $attributes['displayPostContentRadio'] ) { + + $trimmed_excerpt = get_the_excerpt( $post ); + + /* + * Adds a "Read more" link with screen reader text. + * […] is the default excerpt ending from wp_trim_excerpt() in Core. + */ + if ( str_ends_with( $trimmed_excerpt, ' […]' ) ) { + /** This filter is documented in wp-includes/formatting.php */ + $excerpt_length = (int) apply_filters( 'excerpt_length', $block_core_latest_posts_excerpt_length ); + if ( $excerpt_length <= $block_core_latest_posts_excerpt_length ) { + $trimmed_excerpt = substr( $trimmed_excerpt, 0, -11 ); + $trimmed_excerpt .= sprintf( + /* translators: 1: A URL to a post, 2: Hidden accessibility text: Post title */ + __( '… Read more: %2$s' ), + esc_url( $post_link ), + esc_html( $title ) + ); + } + } + + if ( post_password_required( $post ) ) { + $trimmed_excerpt = __( 'This content is password protected.' ); + } + + $list_items_markup .= sprintf( + '
    %1$s
    ', + $trimmed_excerpt + ); + } + + if ( isset( $attributes['displayPostContent'] ) && $attributes['displayPostContent'] + && isset( $attributes['displayPostContentRadio'] ) && 'full_post' === $attributes['displayPostContentRadio'] ) { + + $post_content = html_entity_decode( $post->post_content, ENT_QUOTES, get_option( 'blog_charset' ) ); + + if ( post_password_required( $post ) ) { + $post_content = __( 'This content is password protected.' ); + } + + $list_items_markup .= sprintf( + '
    %1$s
    ', + wp_kses_post( $post_content ) + ); + } + + $list_items_markup .= "
  • \n"; + } + + remove_filter( 'excerpt_length', 'block_core_latest_posts_get_excerpt_length', 20 ); + + $classes = array( 'wp-block-latest-posts__list' ); + if ( isset( $attributes['postLayout'] ) && 'grid' === $attributes['postLayout'] ) { + $classes[] = 'is-grid'; + } + if ( isset( $attributes['columns'] ) && 'grid' === $attributes['postLayout'] ) { + $classes[] = 'columns-' . $attributes['columns']; + } + if ( isset( $attributes['displayPostDate'] ) && $attributes['displayPostDate'] ) { + $classes[] = 'has-dates'; + } + if ( isset( $attributes['displayAuthor'] ) && $attributes['displayAuthor'] ) { + $classes[] = 'has-author'; + } + if ( isset( $attributes['style']['elements']['link']['color']['text'] ) ) { + $classes[] = 'has-link-color'; + } + + $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => implode( ' ', $classes ) ) ); + + return sprintf( + '', + $wrapper_attributes, + $list_items_markup + ); +} + +/** + * Registers the `core/latest-posts` block on server. + * + * @since 5.0.0 + */ +function register_block_core_latest_posts() { + register_block_type_from_metadata( + __DIR__ . '/latest-posts', + array( + 'render_callback' => 'render_block_core_latest_posts', + ) + ); +} +add_action( 'init', 'register_block_core_latest_posts' ); + +/** + * Handles outdated versions of the `core/latest-posts` block by converting + * attribute `categories` from a numeric string to an array with key `id`. + * + * This is done to accommodate the changes introduced in #20781 that sought to + * add support for multiple categories to the block. However, given that this + * block is dynamic, the usual provisions for block migration are insufficient, + * as they only act when a block is loaded in the editor. + * + * TODO: Remove when and if the bottom client-side deprecation for this block + * is removed. + * + * @since 5.5.0 + * + * @param array $block A single parsed block object. + * + * @return array The migrated block object. + */ +function block_core_latest_posts_migrate_categories( $block ) { + if ( + 'core/latest-posts' === $block['blockName'] && + ! empty( $block['attrs']['categories'] ) && + is_string( $block['attrs']['categories'] ) + ) { + $block['attrs']['categories'] = array( + array( 'id' => absint( $block['attrs']['categories'] ) ), + ); + } + + return $block; +} +add_filter( 'render_block_data', 'block_core_latest_posts_migrate_categories' ); diff --git a/src/wp-includes/blocks/latest-posts/block.json b/src/wp-includes/blocks/latest-posts/block.json new file mode 100644 index 0000000000000..03de79be44ce7 --- /dev/null +++ b/src/wp-includes/blocks/latest-posts/block.json @@ -0,0 +1,133 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "core/latest-posts", + "title": "Latest Posts", + "category": "widgets", + "description": "Display a list of your most recent posts.", + "keywords": [ "recent posts" ], + "textdomain": "default", + "attributes": { + "categories": { + "type": "array", + "items": { + "type": "object" + } + }, + "selectedAuthor": { + "type": "number" + }, + "postsToShow": { + "type": "number", + "default": 5 + }, + "displayPostContent": { + "type": "boolean", + "default": false + }, + "displayPostContentRadio": { + "type": "string", + "default": "excerpt" + }, + "excerptLength": { + "type": "number", + "default": 55 + }, + "displayAuthor": { + "type": "boolean", + "default": false + }, + "displayPostDate": { + "type": "boolean", + "default": false + }, + "postLayout": { + "type": "string", + "default": "list" + }, + "columns": { + "type": "number", + "default": 3 + }, + "order": { + "type": "string", + "default": "desc" + }, + "orderBy": { + "type": "string", + "default": "date" + }, + "displayFeaturedImage": { + "type": "boolean", + "default": false + }, + "featuredImageAlign": { + "type": "string", + "enum": [ "left", "center", "right" ] + }, + "featuredImageSizeSlug": { + "type": "string", + "default": "thumbnail" + }, + "featuredImageSizeWidth": { + "type": "number", + "default": null + }, + "featuredImageSizeHeight": { + "type": "number", + "default": null + }, + "addLinkToFeaturedImage": { + "type": "boolean", + "default": false + } + }, + "supports": { + "anchor": true, + "align": true, + "html": false, + "color": { + "gradients": true, + "link": true, + "__experimentalDefaultControls": { + "background": true, + "text": true, + "link": true + } + }, + "spacing": { + "margin": true, + "padding": true + }, + "typography": { + "fontSize": true, + "lineHeight": true, + "__experimentalFontFamily": true, + "__experimentalFontWeight": true, + "__experimentalFontStyle": true, + "__experimentalTextTransform": true, + "__experimentalTextDecoration": true, + "__experimentalLetterSpacing": true, + "__experimentalDefaultControls": { + "fontSize": true + } + }, + "__experimentalBorder": { + "radius": true, + "color": true, + "width": true, + "style": true, + "__experimentalDefaultControls": { + "radius": true, + "color": true, + "width": true, + "style": true + } + }, + "interactivity": { + "clientNavigation": true + } + }, + "editorStyle": "wp-block-latest-posts-editor", + "style": "wp-block-latest-posts" +} diff --git a/src/wp-includes/blocks/legacy-widget.php b/src/wp-includes/blocks/legacy-widget.php new file mode 100644 index 0000000000000..bec1b16b6ba8c --- /dev/null +++ b/src/wp-includes/blocks/legacy-widget.php @@ -0,0 +1,157 @@ +get_widget_key( $id_base ); + $widget_object = $wp_widget_factory->get_widget_object( $id_base ); + + if ( ! $widget_key || ! $widget_object ) { + return ''; + } + + if ( isset( $attributes['instance']['encoded'], $attributes['instance']['hash'] ) ) { + $serialized_instance = base64_decode( $attributes['instance']['encoded'] ); + if ( ! hash_equals( wp_hash( $serialized_instance ), (string) $attributes['instance']['hash'] ) ) { + return ''; + } + $instance = unserialize( $serialized_instance ); + } else { + $instance = array(); + } + + $args = array( + 'widget_id' => $widget_object->id, + 'widget_name' => $widget_object->name, + ); + + ob_start(); + the_widget( $widget_key, $instance, $args ); + return ob_get_clean(); +} + +/** + * Registers the 'core/legacy-widget' block. + * + * @since 5.8.0 + */ +function register_block_core_legacy_widget() { + register_block_type_from_metadata( + __DIR__ . '/legacy-widget', + array( + 'render_callback' => 'render_block_core_legacy_widget', + ) + ); +} + +add_action( 'init', 'register_block_core_legacy_widget' ); + +/** + * Intercepts any request with legacy-widget-preview in the query param and, if + * set, renders a page containing a preview of the requested Legacy Widget + * block. + * + * @since 5.8.0 + */ +function handle_legacy_widget_preview_iframe() { + if ( empty( $_GET['legacy-widget-preview'] ) ) { + return; + } + + if ( ! current_user_can( 'edit_theme_options' ) ) { + return; + } + + define( 'IFRAME_REQUEST', true ); + + ?> + + > + + + + + + + + > +
    +
    + get_registered( 'core/legacy-widget' ); + echo $block->render( $_GET['legacy-widget-preview'] ); + ?> +
    +
    + + + + li", + "border": ".wp-block-list:not(.wp-block-list .wp-block-list) > li" + } +} diff --git a/src/wp-includes/blocks/list.php b/src/wp-includes/blocks/list.php new file mode 100644 index 0000000000000..1bffd81324857 --- /dev/null +++ b/src/wp-includes/blocks/list.php @@ -0,0 +1,54 @@ + is transformed to
      . + * + * @since 6.6.0 + * + * @see https://github.com/WordPress/gutenberg/issues/12420 + * + * @param array $attributes Attributes of the block being rendered. + * @param string $content Content of the block being rendered. + * + * @return string The content of the block being rendered. + */ +function block_core_list_render( $attributes, $content ) { + if ( ! $content ) { + return $content; + } + + $processor = new WP_HTML_Tag_Processor( $content ); + + $list_tags = array( 'OL', 'UL' ); + while ( $processor->next_tag() ) { + if ( in_array( $processor->get_tag(), $list_tags, true ) ) { + $processor->add_class( 'wp-block-list' ); + break; + } + } + + return $processor->get_updated_html(); +} + +/** + * Registers the `core/list` block on server. + * + * @since 6.6.0 + */ +function register_block_core_list() { + register_block_type_from_metadata( + __DIR__ . '/list', + array( + 'render_callback' => 'block_core_list_render', + ) + ); +} + +add_action( 'init', 'register_block_core_list' ); diff --git a/src/wp-includes/blocks/list/block.json b/src/wp-includes/blocks/list/block.json new file mode 100644 index 0000000000000..e91ebf76817e0 --- /dev/null +++ b/src/wp-includes/blocks/list/block.json @@ -0,0 +1,89 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "core/list", + "title": "List", + "category": "text", + "allowedBlocks": [ "core/list-item" ], + "description": "An organized collection of items displayed in a specific order.", + "keywords": [ "bullet list", "ordered list", "numbered list" ], + "textdomain": "default", + "attributes": { + "ordered": { + "type": "boolean", + "default": false, + "role": "content" + }, + "values": { + "type": "string", + "source": "html", + "selector": "ol,ul", + "multiline": "li", + "default": "", + "role": "content" + }, + "type": { + "type": "string" + }, + "start": { + "type": "number" + }, + "reversed": { + "type": "boolean" + }, + "placeholder": { + "type": "string" + } + }, + "supports": { + "anchor": true, + "html": false, + "__experimentalBorder": { + "color": true, + "radius": true, + "style": true, + "width": true + }, + "typography": { + "fontSize": true, + "lineHeight": true, + "__experimentalFontFamily": true, + "__experimentalFontWeight": true, + "__experimentalFontStyle": true, + "__experimentalTextTransform": true, + "__experimentalTextDecoration": true, + "__experimentalLetterSpacing": true, + "__experimentalDefaultControls": { + "fontSize": true + } + }, + "color": { + "gradients": true, + "link": true, + "__experimentalDefaultControls": { + "background": true, + "text": true + } + }, + "spacing": { + "margin": true, + "padding": true, + "__experimentalDefaultControls": { + "margin": false, + "padding": false + } + }, + "__unstablePasteTextInline": true, + "__experimentalOnMerge": true, + "__experimentalSlashInserter": true, + "interactivity": { + "clientNavigation": true + }, + "listView": true + }, + "selectors": { + "border": ".wp-block-list:not(.wp-block-list .wp-block-list)" + }, + "editorStyle": "wp-block-list-editor", + "style": "wp-block-list" +} diff --git a/src/wp-includes/blocks/loginout.php b/src/wp-includes/blocks/loginout.php new file mode 100644 index 0000000000000..f83d8be424ece --- /dev/null +++ b/src/wp-includes/blocks/loginout.php @@ -0,0 +1,61 @@ + false ) ); + } + + $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $classes ) ); + + return '
      ' . $contents . '
      '; +} + +/** + * Registers the `core/loginout` block on server. + * + * @since 5.8.0 + */ +function register_block_core_loginout() { + register_block_type_from_metadata( + __DIR__ . '/loginout', + array( + 'render_callback' => 'render_block_core_loginout', + ) + ); +} +add_action( 'init', 'register_block_core_loginout' ); diff --git a/src/wp-includes/blocks/loginout/block.json b/src/wp-includes/blocks/loginout/block.json new file mode 100644 index 0000000000000..b4c038542b060 --- /dev/null +++ b/src/wp-includes/blocks/loginout/block.json @@ -0,0 +1,64 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "core/loginout", + "title": "Login/out", + "category": "theme", + "description": "Show login & logout links.", + "keywords": [ "login", "logout", "form" ], + "textdomain": "default", + "attributes": { + "displayLoginAsForm": { + "type": "boolean", + "default": false + }, + "redirectToCurrent": { + "type": "boolean", + "default": true + } + }, + "example": { + "viewportWidth": 350 + }, + "supports": { + "anchor": true, + "className": true, + "color": { + "background": true, + "text": false, + "gradients": true, + "link": true + }, + "spacing": { + "margin": true, + "padding": true, + "__experimentalDefaultControls": { + "margin": false, + "padding": false + } + }, + "typography": { + "fontSize": true, + "lineHeight": true, + "__experimentalFontFamily": true, + "__experimentalFontWeight": true, + "__experimentalFontStyle": true, + "__experimentalTextTransform": true, + "__experimentalTextDecoration": true, + "__experimentalLetterSpacing": true, + "__experimentalDefaultControls": { + "fontSize": true + } + }, + "__experimentalBorder": { + "radius": true, + "color": true, + "width": true, + "style": true + }, + "interactivity": { + "clientNavigation": true + } + }, + "style": "wp-block-loginout" +} diff --git a/src/wp-includes/blocks/math/block.json b/src/wp-includes/blocks/math/block.json new file mode 100644 index 0000000000000..a305900ab9961 --- /dev/null +++ b/src/wp-includes/blocks/math/block.json @@ -0,0 +1,52 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "core/math", + "title": "Math", + "category": "text", + "description": "Display mathematical notation using LaTeX.", + "keywords": [ "equation", "formula", "latex", "mathematics" ], + "textdomain": "default", + "supports": { + "anchor": true, + "html": false, + "__experimentalBorder": { + "color": true, + "radius": true, + "style": true, + "width": true + }, + "color": { + "gradients": true, + "__experimentalDefaultControls": { + "background": true, + "text": true + } + }, + "spacing": { + "margin": true, + "padding": true, + "__experimentalDefaultControls": { + "margin": false, + "padding": false + } + }, + "typography": { + "fontSize": true, + "__experimentalDefaultControls": { + "fontSize": true + } + } + }, + "attributes": { + "latex": { + "type": "string", + "role": "content" + }, + "mathML": { + "type": "string", + "source": "html", + "selector": "math" + } + } +} diff --git a/src/wp-includes/blocks/media-text.php b/src/wp-includes/blocks/media-text.php new file mode 100644 index 0000000000000..f6973dc616182 --- /dev/null +++ b/src/wp-includes/blocks/media-text.php @@ -0,0 +1,131 @@ + 'div', + 'class_name' => 'wp-block-media-text', + ); + + while ( $block_tag_processor->next_tag( $block_query ) ) { + if ( $image_fill ) { + // The markup below does not work with the deprecated `is-image-fill` class. + $block_tag_processor->remove_class( 'is-image-fill' ); + $block_tag_processor->add_class( 'is-image-fill-element' ); + } + } + + $content = $block_tag_processor->get_updated_html(); + + $media_tag_processor = new WP_HTML_Tag_Processor( $content ); + $wrapping_figure_query = array( + 'tag_name' => 'figure', + 'class_name' => 'wp-block-media-text__media', + ); + + if ( $has_media_on_right ) { + // Loop through all the figure tags and set a bookmark on the last figure tag. + while ( $media_tag_processor->next_tag( $wrapping_figure_query ) ) { + $media_tag_processor->set_bookmark( 'last_figure' ); + } + if ( $media_tag_processor->has_bookmark( 'last_figure' ) ) { + $media_tag_processor->seek( 'last_figure' ); + // Insert a unique ID to identify the figure tag. + $media_tag_processor->set_attribute( 'id', $unique_id ); + } + } else { + if ( $media_tag_processor->next_tag( $wrapping_figure_query ) ) { + // Insert a unique ID to identify the figure tag. + $media_tag_processor->set_attribute( 'id', $unique_id ); + } + } + + $content = $media_tag_processor->get_updated_html(); + + // Add the image tag inside the figure tag, and update the image attributes + // in order to display the featured image. + $media_size_slug = $attributes['mediaSizeSlug'] ?? 'full'; + $image_tag = ''; + $content = preg_replace( + '/()/', + '$1' . $image_tag, + $content + ); + + $image_tag_processor = new WP_HTML_Tag_Processor( $content ); + if ( $image_tag_processor->next_tag( + array( + 'tag_name' => 'figure', + 'id' => $unique_id, + ) + ) ) { + // The ID is only used to ensure that the correct figure tag is selected, + // and can now be removed. + $image_tag_processor->remove_attribute( 'id' ); + if ( $image_tag_processor->next_tag( + array( + 'tag_name' => 'img', + 'class_name' => 'wp-block-media-text__featured_image', + ) + ) ) { + $image_tag_processor->set_attribute( 'src', esc_url( $current_featured_image ) ); + $image_tag_processor->set_attribute( 'class', 'wp-image-' . get_post_thumbnail_id() . ' size-' . $media_size_slug ); + $image_tag_processor->set_attribute( 'alt', trim( strip_tags( get_post_meta( get_post_thumbnail_id(), '_wp_attachment_image_alt', true ) ) ) ); + if ( $image_fill ) { + $image_tag_processor->set_attribute( 'style', 'object-position:' . $focal_point . ';' ); + } + + $content = $image_tag_processor->get_updated_html(); + } + } + + return $content; +} + +/** + * Registers the `core/media-text` block renderer on server. + * + * @since 6.6.0 + */ +function register_block_core_media_text() { + register_block_type_from_metadata( + __DIR__ . '/media-text', + array( + 'render_callback' => 'render_block_core_media_text', + ) + ); +} +add_action( 'init', 'register_block_core_media_text' ); diff --git a/src/wp-includes/blocks/media-text/block.json b/src/wp-includes/blocks/media-text/block.json new file mode 100644 index 0000000000000..249a5d43032c8 --- /dev/null +++ b/src/wp-includes/blocks/media-text/block.json @@ -0,0 +1,148 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "core/media-text", + "title": "Media & Text", + "category": "media", + "description": "Set media and words side-by-side for a richer layout.", + "keywords": [ "image", "video" ], + "textdomain": "default", + "attributes": { + "align": { + "type": "string", + "default": "none" + }, + "mediaAlt": { + "type": "string", + "source": "attribute", + "selector": "figure img", + "attribute": "alt", + "default": "", + "role": "content" + }, + "mediaPosition": { + "type": "string", + "default": "left" + }, + "mediaId": { + "type": "number", + "role": "content" + }, + "mediaUrl": { + "type": "string", + "source": "attribute", + "selector": "figure video,figure img", + "attribute": "src", + "role": "content" + }, + "mediaLink": { + "type": "string" + }, + "linkDestination": { + "type": "string" + }, + "linkTarget": { + "type": "string", + "source": "attribute", + "selector": "figure a", + "attribute": "target" + }, + "href": { + "type": "string", + "source": "attribute", + "selector": "figure a", + "attribute": "href", + "role": "content" + }, + "rel": { + "type": "string", + "source": "attribute", + "selector": "figure a", + "attribute": "rel" + }, + "linkClass": { + "type": "string", + "source": "attribute", + "selector": "figure a", + "attribute": "class" + }, + "mediaType": { + "type": "string", + "role": "content" + }, + "mediaWidth": { + "type": "number", + "default": 50 + }, + "mediaSizeSlug": { + "type": "string" + }, + "isStackedOnMobile": { + "type": "boolean", + "default": true + }, + "verticalAlignment": { + "type": "string" + }, + "imageFill": { + "type": "boolean" + }, + "focalPoint": { + "type": "object" + }, + "useFeaturedImage": { + "type": "boolean", + "default": false + } + }, + "usesContext": [ "postId", "postType" ], + "supports": { + "anchor": true, + "align": [ "wide", "full" ], + "html": false, + "__experimentalBorder": { + "color": true, + "radius": true, + "style": true, + "width": true, + "__experimentalDefaultControls": { + "color": true, + "radius": true, + "style": true, + "width": true + } + }, + "color": { + "gradients": true, + "heading": true, + "link": true, + "__experimentalDefaultControls": { + "background": true, + "text": true + } + }, + "spacing": { + "margin": true, + "padding": true + }, + "typography": { + "fontSize": true, + "lineHeight": true, + "__experimentalFontFamily": true, + "__experimentalFontWeight": true, + "__experimentalFontStyle": true, + "__experimentalTextTransform": true, + "__experimentalTextDecoration": true, + "__experimentalLetterSpacing": true, + "__experimentalDefaultControls": { + "fontSize": true + } + }, + "interactivity": { + "clientNavigation": true + }, + "allowedBlocks": true + }, + "editorStyle": "wp-block-media-text-editor", + "style": "wp-block-media-text" +} diff --git a/src/wp-includes/blocks/missing/block.json b/src/wp-includes/blocks/missing/block.json new file mode 100644 index 0000000000000..92c9735d1ba15 --- /dev/null +++ b/src/wp-includes/blocks/missing/block.json @@ -0,0 +1,35 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "core/missing", + "title": "Unsupported", + "category": "text", + "description": "Your site doesn’t include support for this block.", + "textdomain": "default", + "attributes": { + "originalName": { + "type": "string" + }, + "originalUndelimitedContent": { + "type": "string" + }, + "originalContent": { + "type": "string", + "source": "raw" + } + }, + "supports": { + "className": false, + "customClassName": false, + "inserter": false, + "html": false, + "lock": false, + "reusable": false, + "renaming": false, + "visibility": false, + "interactivity": { + "clientNavigation": true + }, + "customCSS": false + } +} diff --git a/src/wp-includes/blocks/more/block.json b/src/wp-includes/blocks/more/block.json new file mode 100644 index 0000000000000..b33beeab922a6 --- /dev/null +++ b/src/wp-includes/blocks/more/block.json @@ -0,0 +1,33 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "core/more", + "title": "More", + "category": "design", + "description": "Content before this block will be shown in the excerpt on your archives page.", + "keywords": [ "read more" ], + "textdomain": "default", + "attributes": { + "customText": { + "type": "string", + "default": "", + "role": "content" + }, + "noTeaser": { + "type": "boolean", + "default": false + } + }, + "supports": { + "customClassName": false, + "className": false, + "html": false, + "multiple": false, + "visibility": false, + "interactivity": { + "clientNavigation": true + }, + "customCSS": false + }, + "editorStyle": "wp-block-more-editor" +} diff --git a/src/wp-includes/blocks/navigation-link.php b/src/wp-includes/blocks/navigation-link.php new file mode 100644 index 0000000000000..0888d7b5acebd --- /dev/null +++ b/src/wp-includes/blocks/navigation-link.php @@ -0,0 +1,488 @@ + array(), + 'inline_styles' => '', + ); + + // Text color. + $named_text_color = null; + $custom_text_color = null; + + if ( $is_sub_menu && array_key_exists( 'customOverlayTextColor', $context ) ) { + $custom_text_color = $context['customOverlayTextColor']; + } elseif ( $is_sub_menu && array_key_exists( 'overlayTextColor', $context ) ) { + $named_text_color = $context['overlayTextColor']; + } elseif ( array_key_exists( 'customTextColor', $context ) ) { + $custom_text_color = $context['customTextColor']; + } elseif ( array_key_exists( 'textColor', $context ) ) { + $named_text_color = $context['textColor']; + } elseif ( isset( $context['style']['color']['text'] ) ) { + $custom_text_color = $context['style']['color']['text']; + } + + // If has text color. + if ( ! is_null( $named_text_color ) ) { + // Add the color class. + array_push( $colors['css_classes'], 'has-text-color', sprintf( 'has-%s-color', $named_text_color ) ); + } elseif ( ! is_null( $custom_text_color ) ) { + // Add the custom color inline style. + $colors['css_classes'][] = 'has-text-color'; + $colors['inline_styles'] .= sprintf( 'color: %s;', $custom_text_color ); + } + + // Background color. + $named_background_color = null; + $custom_background_color = null; + + if ( $is_sub_menu && array_key_exists( 'customOverlayBackgroundColor', $context ) ) { + $custom_background_color = $context['customOverlayBackgroundColor']; + } elseif ( $is_sub_menu && array_key_exists( 'overlayBackgroundColor', $context ) ) { + $named_background_color = $context['overlayBackgroundColor']; + } elseif ( array_key_exists( 'customBackgroundColor', $context ) ) { + $custom_background_color = $context['customBackgroundColor']; + } elseif ( array_key_exists( 'backgroundColor', $context ) ) { + $named_background_color = $context['backgroundColor']; + } elseif ( isset( $context['style']['color']['background'] ) ) { + $custom_background_color = $context['style']['color']['background']; + } + + // If has background color. + if ( ! is_null( $named_background_color ) ) { + // Add the background-color class. + array_push( $colors['css_classes'], 'has-background', sprintf( 'has-%s-background-color', $named_background_color ) ); + } elseif ( ! is_null( $custom_background_color ) ) { + // Add the custom background-color inline style. + $colors['css_classes'][] = 'has-background'; + $colors['inline_styles'] .= sprintf( 'background-color: %s;', $custom_background_color ); + } + + return $colors; +} + +/** + * Build an array with CSS classes and inline styles defining the font sizes + * which will be applied to the navigation markup in the front-end. + * + * @since 5.9.0 + * + * @param array $context Navigation block context. + * @return array Font size CSS classes and inline styles. + */ +function block_core_navigation_link_build_css_font_sizes( $context ) { + // CSS classes. + $font_sizes = array( + 'css_classes' => array(), + 'inline_styles' => '', + ); + + $has_named_font_size = array_key_exists( 'fontSize', $context ); + $has_custom_font_size = isset( $context['style']['typography']['fontSize'] ); + + if ( $has_named_font_size ) { + // Add the font size class. + $font_sizes['css_classes'][] = sprintf( 'has-%s-font-size', $context['fontSize'] ); + } elseif ( $has_custom_font_size ) { + // Add the custom font size inline style. + $font_sizes['inline_styles'] = sprintf( + 'font-size: %s;', + wp_get_typography_font_size_value( + array( + 'size' => $context['style']['typography']['fontSize'], + ) + ) + ); + } + + return $font_sizes; +} + +/** + * Decodes a url if it's encoded, returning the same url if not. + * + * @since 6.2.0 + * + * @param string $url The url to decode. + * + * @return string $url Returns the decoded url. + */ +function block_core_navigation_link_maybe_urldecode( $url ) { + $is_url_encoded = false; + $query = parse_url( $url, PHP_URL_QUERY ); + $query_params = wp_parse_args( $query ); + + foreach ( $query_params as $query_param ) { + $can_query_param_be_encoded = is_string( $query_param ) && ! empty( $query_param ); + if ( ! $can_query_param_be_encoded ) { + continue; + } + if ( rawurldecode( $query_param ) !== $query_param ) { + $is_url_encoded = true; + break; + } + } + + if ( $is_url_encoded ) { + return rawurldecode( $url ); + } + + return $url; +} + + +/** + * Renders the `core/navigation-link` block. + * + * @since 5.9.0 + * + * @param array $attributes The block attributes. + * @param string $content The saved content. + * @param WP_Block $block The parsed block. + * + * @return string Returns the post content with the legacy widget added. + */ +function render_block_core_navigation_link( $attributes, $content, $block ) { + // Check if this navigation item should render based on post status. + if ( defined( 'IS_GUTENBERG_PLUGIN' ) && IS_GUTENBERG_PLUGIN ) { + if ( ! gutenberg_block_core_shared_navigation_item_should_render( $attributes, $block ) ) { + return ''; + } + } + + // Don't render the block's subtree if it has no label. + if ( empty( $attributes['label'] ) ) { + return ''; + } + + $font_sizes = block_core_navigation_link_build_css_font_sizes( $block->context ); + $classes = array_merge( + $font_sizes['css_classes'] + ); + $style_attribute = $font_sizes['inline_styles']; + + // Render inner blocks first to check if any menu items will actually display. + $inner_blocks_html = ''; + foreach ( $block->inner_blocks as $inner_block ) { + $inner_blocks_html .= $inner_block->render(); + } + $has_submenu = ! empty( trim( $inner_blocks_html ) ); + + $css_classes = trim( implode( ' ', $classes ) ); + $kind = empty( $attributes['kind'] ) ? 'post_type' : str_replace( '-', '_', $attributes['kind'] ); + $is_active = ! empty( $attributes['id'] ) && get_queried_object_id() === (int) $attributes['id'] && ! empty( get_queried_object()->$kind ); + + if ( is_post_type_archive() && ! empty( $attributes['url'] ) ) { + $queried_archive_link = get_post_type_archive_link( get_queried_object()->name ); + if ( $attributes['url'] === $queried_archive_link ) { + $is_active = true; + } + } + + $wrapper_attributes = get_block_wrapper_attributes( + array( + 'class' => $css_classes . ' wp-block-navigation-item' . ( $has_submenu ? ' has-child' : '' ) . + ( $is_active ? ' current-menu-item' : '' ), + 'style' => $style_attribute, + ) + ); + $html = '
    1. ' . + ''; + + if ( isset( $attributes['label'] ) ) { + $html .= wp_kses_post( $attributes['label'] ); + } + + $html .= ''; + + // Add description if available. + if ( ! empty( $attributes['description'] ) ) { + $html .= ''; + $html .= wp_kses_post( $attributes['description'] ); + $html .= ''; + } + + $html .= ''; + // End anchor tag content. + + if ( isset( $block->context['showSubmenuIcon'] ) && $block->context['showSubmenuIcon'] && $has_submenu ) { + // The submenu icon can be hidden by a CSS rule on the Navigation Block. + $html .= '' . block_core_navigation_render_submenu_icon() . ''; + } + + if ( $has_submenu ) { + $html .= sprintf( + '
        %s
      ', + $inner_blocks_html + ); + } + + $html .= '
    2. '; + + return $html; +} + +/** + * Returns a navigation link variation + * + * @since 5.9.0 + * + * @param WP_Taxonomy|WP_Post_Type $entity post type or taxonomy entity. + * @param string $kind string of value 'taxonomy' or 'post-type'. + * + * @return array + */ +function build_variation_for_navigation_link( $entity, $kind ) { + $title = ''; + $description = ''; + + // Get default labels based on entity type + $default_labels = null; + if ( $entity instanceof WP_Post_Type ) { + $default_labels = WP_Post_Type::get_default_labels(); + } elseif ( $entity instanceof WP_Taxonomy ) { + $default_labels = WP_Taxonomy::get_default_labels(); + } + + // Get title and check if it's default + $is_default_title = false; + if ( property_exists( $entity->labels, 'item_link' ) ) { + $title = $entity->labels->item_link; + if ( isset( $default_labels['item_link'] ) ) { + $is_default_title = in_array( $title, $default_labels['item_link'], true ); + } + } + + // Get description and check if it's default + $is_default_description = false; + if ( property_exists( $entity->labels, 'item_link_description' ) ) { + $description = $entity->labels->item_link_description; + if ( isset( $default_labels['item_link_description'] ) ) { + $is_default_description = in_array( $description, $default_labels['item_link_description'], true ); + } + } + + // Calculate singular name once (used for both title and description) + $singular = $entity->labels->singular_name ?? ucfirst( $entity->name ); + + // Set default title if needed + if ( $is_default_title || '' === $title ) { + /* translators: %s: Singular label of the entity. */ + $title = sprintf( __( '%s link' ), $singular ); + } + + // Default description if needed. + // Use a single space character instead of an empty string to prevent fallback to the + // block.json default description ("Add a page, link, or another item to your navigation."). + // An empty string would be treated as missing and trigger the fallback, while a single + // space appears blank in the UI but prevents the fallback behavior. + // We avoid generating descriptions like "A link to a %s" to prevent grammatical errors + // (e.g., "A link to a event" should be "A link to an event"). + if ( $is_default_description || '' === $description ) { + $description = ' '; + } + + $variation = array( + 'name' => $entity->name, + 'title' => $title, + 'description' => $description, + 'attributes' => array( + 'type' => $entity->name, + 'kind' => $kind, + ), + ); + + // Tweak some value for the variations. + $variation_overrides = array( + 'post_tag' => array( + 'name' => 'tag', + 'attributes' => array( + 'type' => 'tag', + 'kind' => $kind, + ), + ), + 'post_format' => array( + // The item_link and item_link_description for post formats is the + // same as for tags, so need to be overridden. + 'title' => __( 'Post Format Link' ), + 'description' => __( 'A link to a post format' ), + 'attributes' => array( + 'type' => 'post_format', + 'kind' => $kind, + ), + ), + ); + + if ( array_key_exists( $entity->name, $variation_overrides ) ) { + $variation = array_merge( + $variation, + $variation_overrides[ $entity->name ] + ); + } + + return $variation; +} + +/** + * Filters the registered variations for a block type. + * Returns the dynamically built variations for all post-types and taxonomies. + * + * @since 6.5.0 + * + * @param array $variations Array of registered variations for a block type. + * @param WP_Block_Type $block_type The full block type object. + * @return array Numerically indexed array of block variations. + */ +function block_core_navigation_link_filter_variations( $variations, $block_type ) { + if ( 'core/navigation-link' !== $block_type->name ) { + return $variations; + } + + $generated_variations = block_core_navigation_link_build_variations(); + + /* + * IMPORTANT: Order matters for deduplication. + * + * The variations returned from this filter are bootstrapped to JavaScript and + * processed by the block variations reducer. The reducer uses `getUniqueItemsByName()` + * (packages/blocks/src/store/reducer.js:51-57) which keeps the FIRST variation with + * a given 'name' and discards later duplicates when processing the array in order. + * + * By placing generated variations first in `array_merge()`, the improved + * labels (e.g., "Product link" instead of generic "Post Link") are processed first + * and preserved. The generic incoming variations are then discarded as duplicates. + * + * Why `array_merge()` instead of manual deduplication? + * - Both arrays use numeric indices (0, 1, 2...), so `array_merge()` concatenates + * and re-indexes them sequentially, preserving order + * - The reducer handles deduplication, so it is not needed here + * - This keeps the PHP code simple and relies on the established JavaScript behavior + * + * See: https://github.com/WordPress/gutenberg/pull/72517 + */ + return array_merge( $generated_variations, $variations ); +} + +/** + * Returns an array of variations for the navigation link block. + * + * @since 6.5.0 + * + * @return array + */ +function block_core_navigation_link_build_variations() { + $post_types = get_post_types( array( 'show_in_nav_menus' => true ), 'objects' ); + $taxonomies = get_taxonomies( array( 'show_in_nav_menus' => true ), 'objects' ); + + /* + * Use two separate arrays as a way to order the variations in the UI. + * Known variations (like Post Link and Page Link) are added to the + * `built_ins` array. Variations for custom post types and taxonomies are + * added to the `variations` array and will always appear after `built-ins. + */ + $built_ins = array(); + $variations = array(); + + if ( $post_types ) { + foreach ( $post_types as $post_type ) { + $variation = build_variation_for_navigation_link( $post_type, 'post-type' ); + if ( $post_type->_builtin ) { + $built_ins[] = $variation; + } else { + $variations[] = $variation; + } + } + } + if ( $taxonomies ) { + foreach ( $taxonomies as $taxonomy ) { + $variation = build_variation_for_navigation_link( $taxonomy, 'taxonomy' ); + if ( $taxonomy->_builtin ) { + $built_ins[] = $variation; + } else { + $variations[] = $variation; + } + } + } + + $all_variations = array_merge( $built_ins, $variations ); + + return $all_variations; +} + +/** + * Registers the navigation link block. + * + * @since 5.9.0 + * + * @uses render_block_core_navigation_link() + * @throws WP_Error An WP_Error exception parsing the block definition. + */ +function register_block_core_navigation_link() { + register_block_type_from_metadata( + __DIR__ . '/navigation-link', + array( + 'render_callback' => 'render_block_core_navigation_link', + ) + ); +} +add_action( 'init', 'register_block_core_navigation_link' ); +/** + * Creates all variations for post types / taxonomies dynamically (= each time when variations are requested). + * Do not use variation_callback, to also account for unregistering post types/taxonomies later on. + */ +add_action( 'get_block_type_variations', 'block_core_navigation_link_filter_variations', 10, 2 ); diff --git a/src/wp-includes/blocks/navigation-link/block.json b/src/wp-includes/blocks/navigation-link/block.json new file mode 100644 index 0000000000000..997275574f1ac --- /dev/null +++ b/src/wp-includes/blocks/navigation-link/block.json @@ -0,0 +1,90 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "core/navigation-link", + "title": "Custom Link", + "category": "design", + "parent": [ "core/navigation" ], + "allowedBlocks": [ + "core/navigation-link", + "core/navigation-submenu", + "core/page-list" + ], + "description": "Add a page, link, or another item to your navigation.", + "textdomain": "default", + "attributes": { + "label": { + "type": "string", + "role": "content" + }, + "type": { + "type": "string" + }, + "description": { + "type": "string" + }, + "rel": { + "type": "string" + }, + "id": { + "type": "number" + }, + "opensInNewTab": { + "type": "boolean", + "default": false + }, + "url": { + "type": "string", + "role": "content" + }, + "title": { + "type": "string" + }, + "kind": { + "type": "string" + }, + "isTopLevelLink": { + "type": "boolean" + } + }, + "usesContext": [ + "textColor", + "customTextColor", + "backgroundColor", + "customBackgroundColor", + "overlayTextColor", + "customOverlayTextColor", + "overlayBackgroundColor", + "customOverlayBackgroundColor", + "fontSize", + "customFontSize", + "showSubmenuIcon", + "maxNestingLevel", + "style" + ], + "supports": { + "anchor": true, + "reusable": false, + "html": false, + "__experimentalSlashInserter": true, + "typography": { + "fontSize": true, + "lineHeight": true, + "__experimentalFontFamily": true, + "__experimentalFontWeight": true, + "__experimentalFontStyle": true, + "__experimentalTextTransform": true, + "__experimentalTextDecoration": true, + "__experimentalLetterSpacing": true, + "__experimentalDefaultControls": { + "fontSize": true + } + }, + "renaming": false, + "interactivity": { + "clientNavigation": true + } + }, + "editorStyle": "wp-block-navigation-link-editor", + "style": "wp-block-navigation-link" +} diff --git a/src/wp-includes/blocks/navigation-link/shared/item-should-render.php b/src/wp-includes/blocks/navigation-link/shared/item-should-render.php new file mode 100644 index 0000000000000..c6c55b04e47eb --- /dev/null +++ b/src/wp-includes/blocks/navigation-link/shared/item-should-render.php @@ -0,0 +1,46 @@ +post_status, $allowed_post_status, true ) ) { + return false; + } + } + + return true; +} diff --git a/src/wp-includes/blocks/navigation-link/shared/render-submenu-icon.php b/src/wp-includes/blocks/navigation-link/shared/render-submenu-icon.php new file mode 100644 index 0000000000000..62d09e28abe43 --- /dev/null +++ b/src/wp-includes/blocks/navigation-link/shared/render-submenu-icon.php @@ -0,0 +1,17 @@ +'; +} diff --git a/src/wp-includes/blocks/navigation-overlay-close.php b/src/wp-includes/blocks/navigation-overlay-close.php new file mode 100644 index 0000000000000..1945cc4069eef --- /dev/null +++ b/src/wp-includes/blocks/navigation-overlay-close.php @@ -0,0 +1,56 @@ +'; + } + + if ( $show_text ) { + $button_text .= '' . wp_kses_post( $text ) . ''; + } + + $wrapper_attributes = get_block_wrapper_attributes(); + $html_content = sprintf( + '', + $wrapper_attributes, + ! $show_text ? 'aria-label="' . __( 'Close' ) . '"' : '', + $button_text + ); + + return $html_content; +} + +/** + * Registers the navigation overlay close block. + * + * @since 7.0.0 + */ +function register_block_core_navigation_overlay_close() { + register_block_type_from_metadata( + __DIR__ . '/navigation-overlay-close', + array( + 'render_callback' => 'render_block_core_navigation_overlay_close', + ) + ); +} +add_action( 'init', 'register_block_core_navigation_overlay_close' ); diff --git a/src/wp-includes/blocks/navigation-overlay-close/block.json b/src/wp-includes/blocks/navigation-overlay-close/block.json new file mode 100644 index 0000000000000..39bf2ce75b99a --- /dev/null +++ b/src/wp-includes/blocks/navigation-overlay-close/block.json @@ -0,0 +1,49 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "core/navigation-overlay-close", + "title": "Navigation Overlay Close", + "category": "design", + "description": "A customizable button to close overlays.", + "keywords": [ "close", "overlay", "navigation", "menu" ], + "textdomain": "default", + "attributes": { + "displayMode": { + "type": "string", + "enum": [ "icon", "text", "both" ], + "default": "icon" + }, + "text": { + "type": "string" + } + }, + "supports": { + "color": { + "gradients": false, + "__experimentalDefaultControls": { + "background": true, + "text": true + } + }, + "spacing": { + "padding": true, + "__experimentalDefaultControls": { + "padding": true + } + }, + "typography": { + "fontSize": true, + "lineHeight": true, + "__experimentalFontFamily": true, + "__experimentalFontWeight": true, + "__experimentalFontStyle": true, + "__experimentalTextTransform": true, + "__experimentalTextDecoration": true, + "__experimentalLetterSpacing": true, + "__experimentalDefaultControls": { + "fontSize": true + } + } + }, + "style": "wp-block-navigation-overlay-close" +} diff --git a/src/wp-includes/blocks/navigation-submenu.php b/src/wp-includes/blocks/navigation-submenu.php new file mode 100644 index 0000000000000..9138b5a5e08da --- /dev/null +++ b/src/wp-includes/blocks/navigation-submenu.php @@ -0,0 +1,342 @@ + 'click', false -> 'hover'. + return ! empty( $deprecated_open_submenus_on_click ) ? 'click' : 'hover'; + } + + $submenu_visibility = $context['submenuVisibility'] ?? null; + + // Use submenuVisibility for migrated/new blocks. + return $submenu_visibility ?? 'hover'; +} + +// Path differs between source and build: '../navigation-link/shared/' in source, './navigation-link/shared/' in build. +if ( file_exists( __DIR__ . '/../navigation-link/shared/item-should-render.php' ) ) { + require_once __DIR__ . '/../navigation-link/shared/item-should-render.php'; + require_once __DIR__ . '/../navigation-link/shared/render-submenu-icon.php'; +} else { + require_once __DIR__ . '/navigation-link/shared/item-should-render.php'; + require_once __DIR__ . '/navigation-link/shared/render-submenu-icon.php'; +} + +/** + * Build an array with CSS classes and inline styles defining the font sizes + * which will be applied to the navigation markup in the front-end. + * + * @since 5.9.0 + * + * @param array $context Navigation block context. + * @return array Font size CSS classes and inline styles. + */ +function block_core_navigation_submenu_build_css_font_sizes( $context ) { + // CSS classes. + $font_sizes = array( + 'css_classes' => array(), + 'inline_styles' => '', + ); + + $has_named_font_size = array_key_exists( 'fontSize', $context ); + $has_custom_font_size = isset( $context['style']['typography']['fontSize'] ); + + if ( $has_named_font_size ) { + // Add the font size class. + $font_sizes['css_classes'][] = sprintf( 'has-%s-font-size', $context['fontSize'] ); + } elseif ( $has_custom_font_size ) { + // Add the custom font size inline style. + $font_sizes['inline_styles'] = sprintf( + 'font-size: %s;', + wp_get_typography_font_size_value( + array( + 'size' => $context['style']['typography']['fontSize'], + ) + ) + ); + } + + return $font_sizes; +} + +/** + * Renders the `core/navigation-submenu` block. + * + * @since 5.9.0 + * + * @param array $attributes The block attributes. + * @param string $content The saved content. + * @param WP_Block $block The parsed block. + * + * @return string Returns the post content with the legacy widget added. + */ +function render_block_core_navigation_submenu( $attributes, $content, $block ) { + // Check if this navigation item should render based on post status. + if ( defined( 'IS_GUTENBERG_PLUGIN' ) && IS_GUTENBERG_PLUGIN ) { + if ( ! gutenberg_block_core_shared_navigation_item_should_render( $attributes, $block ) ) { + return ''; + } + } + + // Don't render the block's subtree if it has no label. + if ( empty( $attributes['label'] ) ) { + return ''; + } + + $font_sizes = block_core_navigation_submenu_build_css_font_sizes( $block->context ); + $style_attribute = $font_sizes['inline_styles']; + + // Render inner blocks first to check if any menu items will actually display. + $inner_blocks_html = ''; + foreach ( $block->inner_blocks as $inner_block ) { + $inner_blocks_html .= $inner_block->render(); + } + $has_submenu = ! empty( trim( $inner_blocks_html ) ); + + $kind = empty( $attributes['kind'] ) ? 'post_type' : str_replace( '-', '_', $attributes['kind'] ); + $is_active = ! empty( $attributes['id'] ) && get_queried_object_id() === (int) $attributes['id'] && ! empty( get_queried_object()->$kind ); + + if ( is_post_type_archive() && ! empty( $attributes['url'] ) ) { + $queried_archive_link = get_post_type_archive_link( get_queried_object()->name ); + if ( $attributes['url'] === $queried_archive_link ) { + $is_active = true; + } + } + + $show_submenu_indicators = isset( $block->context['showSubmenuIcon'] ) && $block->context['showSubmenuIcon']; + $computed_visibility = block_core_navigation_submenu_get_submenu_visibility( $block->context ); + $open_on_click = 'click' === $computed_visibility; + $open_on_hover = 'hover' === $computed_visibility; + $open_on_hover_and_click = $open_on_hover && $show_submenu_indicators; + + $classes = array( + 'wp-block-navigation-item', + ); + $classes = array_merge( + $classes, + $font_sizes['css_classes'] + ); + if ( $has_submenu ) { + $classes[] = 'has-child'; + } + if ( $open_on_click ) { + $classes[] = 'open-on-click'; + } + if ( $open_on_hover_and_click ) { + $classes[] = 'open-on-hover-click'; + } + if ( 'always' === $computed_visibility ) { + $classes[] = 'open-always'; + } + if ( $is_active ) { + $classes[] = 'current-menu-item'; + } + + $wrapper_attributes = get_block_wrapper_attributes( + array( + 'class' => implode( ' ', $classes ), + 'style' => $style_attribute, + ) + ); + + $label = ''; + + if ( isset( $attributes['label'] ) ) { + $label .= wp_kses_post( $attributes['label'] ); + } + + $aria_label = sprintf( + /* translators: Accessibility text. %s: Parent page title. */ + __( '%s submenu' ), + wp_strip_all_tags( $label ) + ); + + $html = '
    3. '; + + // If Submenus open on hover or are always open, we render an anchor tag with attributes. + // If submenu icons are set to show, we also render a submenu button, so the submenu can be opened on click. + if ( ! $open_on_click ) { + $item_url = $attributes['url'] ?? ''; + // Start appending HTML attributes to anchor tag. + $html .= '
    4. ' . wp_kses_post( $title ) . ''; + } + + if ( isset( $page['children'] ) ) { + if ( $is_navigation_child && $show_submenu_icons && ! $open_on_click ) { + $markup .= ''; + } + $markup .= '
        '; + $markup .= block_core_page_list_render_nested_page_list( $submenu_visibility, $show_submenu_icons, $is_navigation_child, $page['children'], $is_nested, $active_page_ancestor_ids, $colors, $depth + 1 ); + $markup .= '
      '; + } + $markup .= '
    5. '; + } + return $markup; +} + +/** + * Outputs nested array of pages + * + * @since 5.8.0 + * + * @param array $current_level The level being iterated through. + * @param array $children The children grouped by parent post ID. + * + * @return array The nested array of pages. + */ +function block_core_page_list_nest_pages( $current_level, $children ) { + if ( empty( $current_level ) ) { + return; + } + foreach ( (array) $current_level as $key => $current ) { + if ( isset( $children[ $key ] ) ) { + $current_level[ $key ]['children'] = block_core_page_list_nest_pages( $children[ $key ], $children ); + } + } + return $current_level; +} + +/** + * Renders the `core/page-list` block on server. + * + * @since 5.8.0 + * + * @param array $attributes The block attributes. + * @param string $content The saved content. + * @param WP_Block $block The parsed block. + * + * @return string Returns the page list markup. + */ +function render_block_core_page_list( $attributes, $content, $block ) { + static $block_id = 0; + ++$block_id; + + $parent_page_id = $attributes['parentPageID']; + $is_nested = $attributes['isNested']; + + $all_pages = get_pages( + array( + 'sort_column' => 'menu_order,post_title', + 'order' => 'asc', + ) + ); + + // If there are no pages, there is nothing to show. + if ( empty( $all_pages ) ) { + return; + } + + $top_level_pages = array(); + + $pages_with_children = array(); + + $active_page_ancestor_ids = array(); + + foreach ( (array) $all_pages as $page ) { + $is_active = ! empty( $page->ID ) && ( get_queried_object_id() === $page->ID ); + + if ( $is_active ) { + $active_page_ancestor_ids = get_post_ancestors( $page->ID ); + } + + if ( $page->post_parent ) { + $pages_with_children[ $page->post_parent ][ $page->ID ] = array( + 'page_id' => $page->ID, + 'title' => $page->post_title, + 'link' => get_permalink( $page ), + 'is_active' => $is_active, + ); + } else { + $top_level_pages[ $page->ID ] = array( + 'page_id' => $page->ID, + 'title' => $page->post_title, + 'link' => get_permalink( $page ), + 'is_active' => $is_active, + ); + + } + } + + $colors = block_core_page_list_build_css_colors( $attributes, $block->context ); + $font_sizes = block_core_page_list_build_css_font_sizes( $block->context ); + $classes = array_merge( + $colors['css_classes'], + $font_sizes['css_classes'] + ); + $style_attribute = ( $colors['inline_styles'] . $font_sizes['inline_styles'] ); + $css_classes = trim( implode( ' ', $classes ) ); + + $nested_pages = block_core_page_list_nest_pages( $top_level_pages, $pages_with_children ); + + if ( 0 !== $parent_page_id ) { + // If the parent page has no child pages, there is nothing to show. + if ( ! array_key_exists( $parent_page_id, $pages_with_children ) ) { + return; + } + + $nested_pages = block_core_page_list_nest_pages( + $pages_with_children[ $parent_page_id ], + $pages_with_children + ); + } + + $is_navigation_child = array_key_exists( 'showSubmenuIcon', $block->context ); + + // Get submenu visibility with backward compatibility for openSubmenusOnClick. + $submenu_visibility = $is_navigation_child ? block_core_page_list_get_submenu_visibility( $block->context ) : 'hover'; + + $show_submenu_icons = array_key_exists( 'showSubmenuIcon', $block->context ) ? $block->context['showSubmenuIcon'] : false; + + $wrapper_markup = $is_nested ? '%2$s' : '
        %2$s
      '; + + $items_markup = block_core_page_list_render_nested_page_list( $submenu_visibility, $show_submenu_icons, $is_navigation_child, $nested_pages, $is_nested, $active_page_ancestor_ids, $colors ); + + $wrapper_attributes = get_block_wrapper_attributes( + array( + 'class' => $css_classes, + 'style' => $style_attribute, + ) + ); + + return sprintf( + $wrapper_markup, + $wrapper_attributes, + $items_markup + ); +} + +/** + * Registers the `core/pages` block on server. + * + * @since 5.8.0 + */ +function register_block_core_page_list() { + register_block_type_from_metadata( + __DIR__ . '/page-list', + array( + 'render_callback' => 'render_block_core_page_list', + ) + ); +} +add_action( 'init', 'register_block_core_page_list' ); diff --git a/src/wp-includes/blocks/page-list/block.json b/src/wp-includes/blocks/page-list/block.json new file mode 100644 index 0000000000000..2b97f248c5768 --- /dev/null +++ b/src/wp-includes/blocks/page-list/block.json @@ -0,0 +1,86 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "core/page-list", + "title": "Page List", + "category": "widgets", + "allowedBlocks": [ "core/page-list-item" ], + "description": "Display a list of all pages.", + "keywords": [ "menu", "navigation" ], + "textdomain": "default", + "attributes": { + "parentPageID": { + "type": "integer", + "default": 0 + }, + "isNested": { + "type": "boolean", + "default": false + } + }, + "usesContext": [ + "textColor", + "customTextColor", + "backgroundColor", + "customBackgroundColor", + "overlayTextColor", + "customOverlayTextColor", + "overlayBackgroundColor", + "customOverlayBackgroundColor", + "fontSize", + "customFontSize", + "showSubmenuIcon", + "style", + "openSubmenusOnClick", + "submenuVisibility" + ], + "supports": { + "anchor": true, + "reusable": false, + "html": false, + "typography": { + "fontSize": true, + "lineHeight": true, + "__experimentalFontFamily": true, + "__experimentalFontWeight": true, + "__experimentalFontStyle": true, + "__experimentalTextTransform": true, + "__experimentalTextDecoration": true, + "__experimentalLetterSpacing": true, + "__experimentalDefaultControls": { + "fontSize": true + } + }, + "interactivity": { + "clientNavigation": true + }, + "color": { + "text": true, + "background": true, + "link": true, + "gradients": true, + "__experimentalDefaultControls": { + "background": true, + "text": true, + "link": true + } + }, + "__experimentalBorder": { + "radius": true, + "color": true, + "width": true, + "style": true + }, + "spacing": { + "padding": true, + "margin": true, + "__experimentalDefaultControls": { + "padding": false, + "margin": false + } + }, + "contentRole": true + }, + "editorStyle": "wp-block-page-list-editor", + "style": "wp-block-page-list" +} diff --git a/src/wp-includes/blocks/paragraph.php b/src/wp-includes/blocks/paragraph.php new file mode 100644 index 0000000000000..f72ca085a2048 --- /dev/null +++ b/src/wp-includes/blocks/paragraph.php @@ -0,0 +1,48 @@ +Hello World

      + * + * Would be transformed to: + *

      Hello World

      + * + * @since 7.0.0 + * + * @param string $block_content The block content. + * + * @return string Filtered block content. + */ +function block_core_paragraph_add_class( $block_content ) { + if ( ! $block_content ) { + return $block_content; + } + + $processor = new WP_HTML_Tag_Processor( $block_content ); + + if ( $processor->next_tag( 'p' ) ) { + $processor->add_class( 'wp-block-paragraph' ); + } + + return $processor->get_updated_html(); +} + +add_filter( 'render_block_core/paragraph', 'block_core_paragraph_add_class' ); + +/** + * Registers the `core/paragraph` block on server. + * + * @since 7.0.0 + */ +function register_block_core_paragraph() { + register_block_type_from_metadata( __DIR__ . '/paragraph' ); +} +add_action( 'init', 'register_block_core_paragraph' ); diff --git a/src/wp-includes/blocks/paragraph/block.json b/src/wp-includes/blocks/paragraph/block.json new file mode 100644 index 0000000000000..556c2870557f7 --- /dev/null +++ b/src/wp-includes/blocks/paragraph/block.json @@ -0,0 +1,88 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "core/paragraph", + "title": "Paragraph", + "category": "text", + "description": "Start with the basic building block of all narrative.", + "keywords": [ "text" ], + "textdomain": "default", + "attributes": { + "content": { + "type": "rich-text", + "source": "rich-text", + "selector": "p", + "role": "content" + }, + "dropCap": { + "type": "boolean", + "default": false + }, + "placeholder": { + "type": "string" + }, + "direction": { + "type": "string", + "enum": [ "ltr", "rtl" ] + } + }, + "supports": { + "align": [ "wide", "full" ], + "splitting": true, + "anchor": true, + "className": false, + "__experimentalBorder": { + "color": true, + "radius": true, + "style": true, + "width": true + }, + "color": { + "gradients": true, + "link": true, + "__experimentalDefaultControls": { + "background": true, + "text": true + } + }, + "spacing": { + "margin": true, + "padding": true, + "__experimentalDefaultControls": { + "margin": false, + "padding": false + } + }, + "typography": { + "fontSize": true, + "lineHeight": true, + "textAlign": true, + "textColumns": true, + "textIndent": true, + "__experimentalFontFamily": true, + "__experimentalTextDecoration": true, + "__experimentalFontStyle": true, + "__experimentalFontWeight": true, + "__experimentalLetterSpacing": true, + "__experimentalTextTransform": true, + "__experimentalWritingMode": true, + "fitText": true, + "__experimentalDefaultControls": { + "fontSize": true + } + }, + "__experimentalSelector": "p", + "__unstablePasteTextInline": true, + "interactivity": { + "clientNavigation": true + } + }, + "selectors": { + "root": "p", + "typography": { + "textIndent": ".wp-block-paragraph + .wp-block-paragraph" + } + }, + "editorStyle": "wp-block-paragraph-editor", + "style": "wp-block-paragraph" +} diff --git a/src/wp-includes/blocks/pattern.php b/src/wp-includes/blocks/pattern.php new file mode 100644 index 0000000000000..870313eb5e86d --- /dev/null +++ b/src/wp-includes/blocks/pattern.php @@ -0,0 +1,72 @@ + 'render_block_core_pattern', + ) + ); +} + +/** + * Renders the `core/pattern` block on the server. + * + * @since 6.3.0 Backwards compatibility: blocks with no `syncStatus` attribute do not receive block wrapper. + * + * @global WP_Embed $wp_embed Used to process embedded content within patterns + * + * @param array $attributes Block attributes. + * + * @return string Returns the output of the pattern. + */ +function render_block_core_pattern( $attributes ) { + static $seen_refs = array(); + + if ( empty( $attributes['slug'] ) ) { + return ''; + } + + $slug = $attributes['slug']; + $registry = WP_Block_Patterns_Registry::get_instance(); + + if ( ! $registry->is_registered( $slug ) ) { + return ''; + } + + if ( isset( $seen_refs[ $attributes['slug'] ] ) ) { + // WP_DEBUG_DISPLAY must only be honored when WP_DEBUG. This precedent + // is set in `wp_debug_mode()`. + $is_debug = WP_DEBUG && WP_DEBUG_DISPLAY; + + return $is_debug ? + // translators: Visible only in the front end, this warning takes the place of a faulty block. %s represents a pattern's slug. + sprintf( __( '[block rendering halted for pattern "%s"]' ), $slug ) : + ''; + } + + $pattern = $registry->get_registered( $slug ); + $content = $pattern['content']; + + $seen_refs[ $attributes['slug'] ] = true; + + $content = do_blocks( $content ); + + global $wp_embed; + $content = $wp_embed->autoembed( $content ); + + unset( $seen_refs[ $attributes['slug'] ] ); + return $content; +} + +add_action( 'init', 'register_block_core_pattern' ); diff --git a/src/wp-includes/blocks/pattern/block.json b/src/wp-includes/blocks/pattern/block.json new file mode 100644 index 0000000000000..d95db89e32f5a --- /dev/null +++ b/src/wp-includes/blocks/pattern/block.json @@ -0,0 +1,23 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "core/pattern", + "title": "Pattern Placeholder", + "category": "theme", + "description": "Show a block pattern.", + "supports": { + "html": false, + "inserter": false, + "renaming": false, + "visibility": false, + "interactivity": { + "clientNavigation": true + } + }, + "textdomain": "default", + "attributes": { + "slug": { + "type": "string" + } + } +} diff --git a/src/wp-includes/blocks/post-author-biography.php b/src/wp-includes/blocks/post-author-biography.php new file mode 100644 index 0000000000000..bd983f79e7609 --- /dev/null +++ b/src/wp-includes/blocks/post-author-biography.php @@ -0,0 +1,53 @@ +context['postId'] ) ) { + $author_id = get_post_field( 'post_author', $block->context['postId'] ); + } else { + $author_id = get_query_var( 'author' ); + } + + if ( empty( $author_id ) ) { + return ''; + } + + $author_biography = get_the_author_meta( 'description', $author_id ); + if ( empty( $author_biography ) ) { + return ''; + } + + $align_class_name = empty( $attributes['textAlign'] ) ? '' : "has-text-align-{$attributes['textAlign']}"; + $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $align_class_name ) ); + + return sprintf( '
      ', $wrapper_attributes ) . $author_biography . '
      '; +} + +/** + * Registers the `core/post-author-biography` block on the server. + * + * @since 6.0.0 + */ +function register_block_core_post_author_biography() { + register_block_type_from_metadata( + __DIR__ . '/post-author-biography', + array( + 'render_callback' => 'render_block_core_post_author_biography', + ) + ); +} +add_action( 'init', 'register_block_core_post_author_biography' ); diff --git a/src/wp-includes/blocks/post-author-biography/block.json b/src/wp-includes/blocks/post-author-biography/block.json new file mode 100644 index 0000000000000..1bf488f50cdc4 --- /dev/null +++ b/src/wp-includes/blocks/post-author-biography/block.json @@ -0,0 +1,58 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "core/post-author-biography", + "title": "Author Biography", + "category": "theme", + "description": "The author biography.", + "textdomain": "default", + "usesContext": [ "postType", "postId" ], + "example": { + "viewportWidth": 350 + }, + "supports": { + "anchor": true, + "spacing": { + "margin": true, + "padding": true + }, + "color": { + "gradients": true, + "link": true, + "__experimentalDefaultControls": { + "background": true, + "text": true + } + }, + "typography": { + "fontSize": true, + "lineHeight": true, + "textAlign": true, + "__experimentalFontFamily": true, + "__experimentalFontWeight": true, + "__experimentalFontStyle": true, + "__experimentalTextTransform": true, + "__experimentalTextDecoration": true, + "__experimentalLetterSpacing": true, + "__experimentalDefaultControls": { + "fontSize": true + } + }, + "interactivity": { + "clientNavigation": true + }, + "__experimentalBorder": { + "radius": true, + "color": true, + "width": true, + "style": true, + "__experimentalDefaultControls": { + "radius": true, + "color": true, + "width": true, + "style": true + } + } + }, + "style": "wp-block-post-author-biography" +} diff --git a/src/wp-includes/blocks/post-author-name.php b/src/wp-includes/blocks/post-author-name.php new file mode 100644 index 0000000000000..ac514401f5cc2 --- /dev/null +++ b/src/wp-includes/blocks/post-author-name.php @@ -0,0 +1,63 @@ +context['postId'] ) ) { + $author_id = get_post_field( 'post_author', $block->context['postId'] ); + } else { + $author_id = get_query_var( 'author' ); + } + + if ( empty( $author_id ) ) { + return ''; + } + + if ( isset( $block->context['postType'] ) && ! post_type_supports( $block->context['postType'], 'author' ) ) { + return ''; + } + + $author_name = get_the_author_meta( 'display_name', $author_id ); + if ( isset( $attributes['isLink'] ) && $attributes['isLink'] ) { + $author_name = sprintf( '', get_author_posts_url( $author_id ), esc_attr( $attributes['linkTarget'] ), $author_name ); + } + + $classes = array(); + if ( isset( $attributes['textAlign'] ) ) { + $classes[] = 'has-text-align-' . $attributes['textAlign']; + } + if ( isset( $attributes['style']['elements']['link']['color']['text'] ) ) { + $classes[] = 'has-link-color'; + } + $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => implode( ' ', $classes ) ) ); + + return sprintf( '
      %2$s
      ', $wrapper_attributes, $author_name ); +} + +/** + * Registers the `core/post-author-name` block on the server. + * + * @since 6.2.0 + */ +function register_block_core_post_author_name() { + register_block_type_from_metadata( + __DIR__ . '/post-author-name', + array( + 'render_callback' => 'render_block_core_post_author_name', + ) + ); +} +add_action( 'init', 'register_block_core_post_author_name' ); diff --git a/src/wp-includes/blocks/post-author-name/block.json b/src/wp-includes/blocks/post-author-name/block.json new file mode 100644 index 0000000000000..e68878d905b82 --- /dev/null +++ b/src/wp-includes/blocks/post-author-name/block.json @@ -0,0 +1,72 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "core/post-author-name", + "title": "Author Name", + "category": "theme", + "description": "The author name.", + "textdomain": "default", + "attributes": { + "isLink": { + "type": "boolean", + "default": false, + "role": "content" + }, + "linkTarget": { + "type": "string", + "default": "_self", + "role": "content" + } + }, + "usesContext": [ "postType", "postId" ], + "example": { + "viewportWidth": 350 + }, + "supports": { + "anchor": true, + "html": false, + "spacing": { + "margin": true, + "padding": true + }, + "color": { + "gradients": true, + "link": true, + "__experimentalDefaultControls": { + "background": true, + "text": true, + "link": true + } + }, + "typography": { + "fontSize": true, + "lineHeight": true, + "textAlign": true, + "__experimentalFontFamily": true, + "__experimentalFontWeight": true, + "__experimentalFontStyle": true, + "__experimentalTextTransform": true, + "__experimentalTextDecoration": true, + "__experimentalLetterSpacing": true, + "__experimentalDefaultControls": { + "fontSize": true + } + }, + "interactivity": { + "clientNavigation": true + }, + "__experimentalBorder": { + "radius": true, + "color": true, + "width": true, + "style": true, + "__experimentalDefaultControls": { + "radius": true, + "color": true, + "width": true, + "style": true + } + } + }, + "style": "wp-block-post-author-name" +} diff --git a/src/wp-includes/blocks/post-author.php b/src/wp-includes/blocks/post-author.php new file mode 100644 index 0000000000000..a4880f8a9e744 --- /dev/null +++ b/src/wp-includes/blocks/post-author.php @@ -0,0 +1,81 @@ +context['postId'] ) ) { + $author_id = get_query_var( 'author' ); + } else { + $author_id = get_post_field( 'post_author', $block->context['postId'] ); + } + + if ( empty( $author_id ) ) { + return ''; + } + + if ( isset( $block->context['postType'] ) && ! post_type_supports( $block->context['postType'], 'author' ) ) { + return ''; + } + + $avatar = ! empty( $attributes['avatarSize'] ) ? get_avatar( + $author_id, + $attributes['avatarSize'] + ) : null; + + $link = get_author_posts_url( $author_id ); + $author_name = get_the_author_meta( 'display_name', $author_id ); + if ( ! empty( $attributes['isLink'] && ! empty( $attributes['linkTarget'] ) ) ) { + $author_name = sprintf( '%3$s', esc_url( $link ), esc_attr( $attributes['linkTarget'] ), $author_name ); + } + + $byline = ! empty( $attributes['byline'] ) ? $attributes['byline'] : false; + $classes = array(); + if ( isset( $attributes['itemsJustification'] ) ) { + $classes[] = 'items-justified-' . $attributes['itemsJustification']; + } + if ( isset( $attributes['textAlign'] ) ) { + $classes[] = 'has-text-align-' . $attributes['textAlign']; + } + if ( isset( $attributes['style']['elements']['link']['color']['text'] ) ) { + $classes[] = 'has-link-color'; + } + + $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => implode( ' ', $classes ) ) ); + + return sprintf( '
      ', $wrapper_attributes ) . + ( ! empty( $attributes['showAvatar'] ) ? '' : '' ) . + '' . + '
      '; +} + +/** + * Registers the `core/post-author` block on the server. + * + * @since 5.9.0 + */ +function register_block_core_post_author() { + register_block_type_from_metadata( + __DIR__ . '/post-author', + array( + 'render_callback' => 'render_block_core_post_author', + ) + ); +} +add_action( 'init', 'register_block_core_post_author' ); diff --git a/src/wp-includes/blocks/post-author/block.json b/src/wp-includes/blocks/post-author/block.json new file mode 100644 index 0000000000000..e316702a5c194 --- /dev/null +++ b/src/wp-includes/blocks/post-author/block.json @@ -0,0 +1,94 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "core/post-author", + "title": "Author (deprecated)", + "category": "theme", + "description": "This block is deprecated. Please use the Avatar block, the Author Name block, and the Author Biography block instead.", + "textdomain": "default", + "attributes": { + "textAlign": { + "type": "string" + }, + "avatarSize": { + "type": "number", + "default": 48 + }, + "showAvatar": { + "type": "boolean", + "default": true + }, + "showBio": { + "type": "boolean" + }, + "byline": { + "type": "string" + }, + "isLink": { + "type": "boolean", + "default": false, + "role": "content" + }, + "linkTarget": { + "type": "string", + "default": "_self", + "role": "content" + } + }, + "usesContext": [ "postType", "postId", "queryId" ], + "supports": { + "inserter": false, + "anchor": true, + "html": false, + "spacing": { + "margin": true, + "padding": true + }, + "typography": { + "fontSize": true, + "lineHeight": true, + "__experimentalFontFamily": true, + "__experimentalFontWeight": true, + "__experimentalFontStyle": true, + "__experimentalTextTransform": true, + "__experimentalTextDecoration": true, + "__experimentalLetterSpacing": true, + "__experimentalDefaultControls": { + "fontSize": true + } + }, + "color": { + "gradients": true, + "link": true, + "__experimentalDefaultControls": { + "background": true, + "text": true + } + }, + "interactivity": { + "clientNavigation": true + }, + "__experimentalBorder": { + "radius": true, + "color": true, + "width": true, + "style": true, + "__experimentalDefaultControls": { + "radius": true, + "color": true, + "width": true, + "style": true + } + }, + "filter": { + "duotone": true + } + }, + "selectors": { + "filter": { + "duotone": ".wp-block-post-author .wp-block-post-author__avatar img" + } + }, + "editorStyle": "wp-block-post-author-editor", + "style": "wp-block-post-author" +} diff --git a/src/wp-includes/blocks/post-comments-count.php b/src/wp-includes/blocks/post-comments-count.php new file mode 100644 index 0000000000000..bf12d6f0f9c4c --- /dev/null +++ b/src/wp-includes/blocks/post-comments-count.php @@ -0,0 +1,49 @@ +context['postId'] ) ) { + return ''; + } + + $classes = ''; + if ( isset( $attributes['textAlign'] ) ) { + $classes .= 'has-text-align-' . $attributes['textAlign']; + } + + $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $classes ) ); + return sprintf( + '
      %2$s
      ', + $wrapper_attributes, + get_comments_number( $block->context['postId'] ) + ); +} + +/** + * Registers the `core/post-comments-count` block on the server. + * + * @since 6.9.0 + */ +function register_block_core_post_comments_count() { + register_block_type_from_metadata( + __DIR__ . '/post-comments-count', + array( + 'render_callback' => 'render_block_core_post_comments_count', + ) + ); +} +add_action( 'init', 'register_block_core_post_comments_count' ); diff --git a/src/wp-includes/blocks/post-comments-count/block.json b/src/wp-includes/blocks/post-comments-count/block.json new file mode 100644 index 0000000000000..e3066d7afff93 --- /dev/null +++ b/src/wp-includes/blocks/post-comments-count/block.json @@ -0,0 +1,52 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "core/post-comments-count", + "title": "Comments Count", + "category": "theme", + "description": "Display a post's comments count.", + "textdomain": "default", + "usesContext": [ "postId" ], + "example": { + "viewportWidth": 350 + }, + "supports": { + "anchor": true, + "html": false, + "color": { + "gradients": true, + "__experimentalDefaultControls": { + "background": true, + "text": true + } + }, + "spacing": { + "margin": true, + "padding": true + }, + "typography": { + "fontSize": true, + "lineHeight": true, + "textAlign": true, + "__experimentalFontFamily": true, + "__experimentalFontWeight": true, + "__experimentalFontStyle": true, + "__experimentalTextTransform": true, + "__experimentalTextDecoration": true, + "__experimentalLetterSpacing": true, + "__experimentalDefaultControls": { + "fontSize": true + } + }, + "__experimentalBorder": { + "radius": true, + "color": true, + "width": true, + "style": true + }, + "interactivity": { + "clientNavigation": true + } + }, + "style": "wp-block-post-comments-count" +} diff --git a/src/wp-includes/blocks/post-comments-form.php b/src/wp-includes/blocks/post-comments-form.php new file mode 100644 index 0000000000000..dfbf4c59f264a --- /dev/null +++ b/src/wp-includes/blocks/post-comments-form.php @@ -0,0 +1,88 @@ +context['postId'] ) ) { + return ''; + } + + if ( post_password_required( $block->context['postId'] ) ) { + return; + } + + $classes = array( 'comment-respond' ); // See comment further below. + if ( isset( $attributes['textAlign'] ) ) { + $classes[] = 'has-text-align-' . $attributes['textAlign']; + } + if ( isset( $attributes['style']['elements']['link']['color']['text'] ) ) { + $classes[] = 'has-link-color'; + } + $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => implode( ' ', $classes ) ) ); + + add_filter( 'comment_form_defaults', 'post_comments_form_block_form_defaults' ); + + ob_start(); + comment_form( array(), $block->context['postId'] ); + $form = ob_get_clean(); + + remove_filter( 'comment_form_defaults', 'post_comments_form_block_form_defaults' ); + + // We use the outermost wrapping `
      ` returned by `comment_form()` + // which is identified by its default classname `comment-respond` to inject + // our wrapper attributes. This way, it is guaranteed that all styling applied + // to the block is carried along when the comment form is moved to the location + // of the 'Reply' link that the user clicked by Core's `comment-reply.js` script. + $form = str_replace( 'class="comment-respond"', $wrapper_attributes, $form ); + + // Enqueue the comment-reply script. + wp_enqueue_script( 'comment-reply' ); + + return $form; +} + +/** + * Registers the `core/post-comments-form` block on the server. + * + * @since 6.0.0 + */ +function register_block_core_post_comments_form() { + register_block_type_from_metadata( + __DIR__ . '/post-comments-form', + array( + 'render_callback' => 'render_block_core_post_comments_form', + ) + ); +} +add_action( 'init', 'register_block_core_post_comments_form' ); + +/** + * Use the button block classes for the form-submit button. + * + * @since 6.0.0 + * + * @param array $fields The default comment form arguments. + * + * @return array Returns the modified fields. + */ +function post_comments_form_block_form_defaults( $fields ) { + if ( wp_is_block_theme() ) { + $fields['submit_button'] = ''; + $fields['submit_field'] = '

      %1$s %2$s

      '; + } + + return $fields; +} diff --git a/src/wp-includes/blocks/post-comments-form/block.json b/src/wp-includes/blocks/post-comments-form/block.json new file mode 100644 index 0000000000000..c9e9caa91d081 --- /dev/null +++ b/src/wp-includes/blocks/post-comments-form/block.json @@ -0,0 +1,66 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "core/post-comments-form", + "title": "Comments Form", + "category": "theme", + "description": "Display a post's comments form.", + "textdomain": "default", + "usesContext": [ "postId", "postType" ], + "supports": { + "anchor": true, + "html": false, + "color": { + "gradients": true, + "heading": true, + "link": true, + "__experimentalDefaultControls": { + "background": true, + "text": true + } + }, + "spacing": { + "margin": true, + "padding": true + }, + "typography": { + "fontSize": true, + "lineHeight": true, + "textAlign": true, + "__experimentalFontStyle": true, + "__experimentalFontWeight": true, + "__experimentalLetterSpacing": true, + "__experimentalTextTransform": true, + "__experimentalDefaultControls": { + "fontSize": true + } + }, + "__experimentalBorder": { + "radius": true, + "color": true, + "width": true, + "style": true, + "__experimentalDefaultControls": { + "radius": true, + "color": true, + "width": true, + "style": true + } + } + }, + "editorStyle": "wp-block-post-comments-form-editor", + "style": [ + "wp-block-post-comments-form", + "wp-block-buttons", + "wp-block-button" + ], + "example": { + "attributes": { + "style": { + "typography": { + "textAlign": "center" + } + } + } + } +} diff --git a/src/wp-includes/blocks/post-comments-link.php b/src/wp-includes/blocks/post-comments-link.php new file mode 100644 index 0000000000000..c6d33eb0cd65c --- /dev/null +++ b/src/wp-includes/blocks/post-comments-link.php @@ -0,0 +1,75 @@ +context['postId'] ) || + isset( $block->context['postId'] ) && + ! comments_open( $block->context['postId'] ) + ) { + return ''; + } + + $classes = array(); + if ( isset( $attributes['textAlign'] ) ) { + $classes[] = 'has-text-align-' . $attributes['textAlign']; + } + if ( isset( $attributes['style']['elements']['link']['color']['text'] ) ) { + $classes[] = 'has-link-color'; + } + $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => implode( ' ', $classes ) ) ); + $comments_number = (int) get_comments_number( $block->context['postId'] ); + $comments_link = get_comments_link( $block->context['postId'] ); + $post_title = get_the_title( $block->context['postId'] ); + $comment_html = ''; + + if ( 0 === $comments_number ) { + $comment_html = sprintf( + /* translators: %s post title */ + __( 'No comments on %s' ), + $post_title + ); + } else { + $comment_html = sprintf( + /* translators: 1: Number of comments, 2: post title */ + _n( + '%1$s comment on %2$s', + '%1$s comments on %2$s', + $comments_number + ), + esc_html( number_format_i18n( $comments_number ) ), + $post_title + ); + } + + return ''; +} + +/** + * Registers the `core/post-comments-link` block on the server. + * + * @since 6.9.0 + */ +function register_block_core_post_comments_link() { + register_block_type_from_metadata( + __DIR__ . '/post-comments-link', + array( + 'render_callback' => 'render_block_core_post_comments_link', + ) + ); +} +add_action( 'init', 'register_block_core_post_comments_link' ); diff --git a/src/wp-includes/blocks/post-comments-link/block.json b/src/wp-includes/blocks/post-comments-link/block.json new file mode 100644 index 0000000000000..c5c72c677adf6 --- /dev/null +++ b/src/wp-includes/blocks/post-comments-link/block.json @@ -0,0 +1,59 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "core/post-comments-link", + "title": "Comments Link", + "category": "theme", + "description": "Displays the link to the current post comments.", + "textdomain": "default", + "usesContext": [ "postType", "postId" ], + "example": { + "viewportWidth": 350 + }, + "supports": { + "anchor": true, + "html": false, + "color": { + "link": true, + "text": false, + "__experimentalDefaultControls": { + "background": true, + "link": true + } + }, + "spacing": { + "margin": true, + "padding": true + }, + "typography": { + "fontSize": true, + "lineHeight": true, + "textAlign": true, + "__experimentalFontFamily": true, + "__experimentalFontWeight": true, + "__experimentalFontStyle": true, + "__experimentalTextTransform": true, + "__experimentalTextDecoration": true, + "__experimentalLetterSpacing": true, + "__experimentalDefaultControls": { + "fontSize": true + } + }, + "interactivity": { + "clientNavigation": true + }, + "__experimentalBorder": { + "radius": true, + "color": true, + "width": true, + "style": true, + "__experimentalDefaultControls": { + "radius": true, + "color": true, + "width": true, + "style": true + } + } + }, + "style": "wp-block-post-comments-link" +} diff --git a/src/wp-includes/blocks/post-content.php b/src/wp-includes/blocks/post-content.php new file mode 100644 index 0000000000000..0be1a8730f605 --- /dev/null +++ b/src/wp-includes/blocks/post-content.php @@ -0,0 +1,86 @@ +context['postId'] ) ) { + return ''; + } + + $post_id = $block->context['postId']; + + if ( isset( $seen_ids[ $post_id ] ) ) { + // WP_DEBUG_DISPLAY must only be honored when WP_DEBUG. This precedent + // is set in `wp_debug_mode()`. + $is_debug = WP_DEBUG && WP_DEBUG_DISPLAY; + + return $is_debug ? + // translators: Visible only in the front end, this warning takes the place of a faulty block. + __( '[block rendering halted]' ) : + ''; + } + + $seen_ids[ $post_id ] = true; + + // When inside the main loop, we want to use queried object + // so that `the_preview` for the current post can apply. + // We force this behavior by omitting the third argument (post ID) from the `get_the_content`. + $content = get_the_content(); + // Check for nextpage to display page links for paginated posts. + if ( has_block( 'core/nextpage' ) ) { + $content .= wp_link_pages( array( 'echo' => 0 ) ); + } + + /** This filter is documented in wp-includes/post-template.php */ + $content = apply_filters( 'the_content', str_replace( ']]>', ']]>', $content ) ); + unset( $seen_ids[ $post_id ] ); + + if ( empty( $content ) ) { + return ''; + } + + $tag_name = 'div'; + + if ( ! empty( $attributes['tagName'] ) && tag_escape( $attributes['tagName'] ) === $attributes['tagName'] ) { + $tag_name = $attributes['tagName']; + } + + $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => 'entry-content' ) ); + + return sprintf( + '<%1$s %2$s>%3$s', + $tag_name, + $wrapper_attributes, + $content + ); +} + +/** + * Registers the `core/post-content` block on the server. + * + * @since 5.8.0 + */ +function register_block_core_post_content() { + register_block_type_from_metadata( + __DIR__ . '/post-content', + array( + 'render_callback' => 'render_block_core_post_content', + ) + ); +} +add_action( 'init', 'register_block_core_post_content' ); diff --git a/src/wp-includes/blocks/post-content/block.json b/src/wp-includes/blocks/post-content/block.json new file mode 100644 index 0000000000000..517af41487270 --- /dev/null +++ b/src/wp-includes/blocks/post-content/block.json @@ -0,0 +1,83 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "core/post-content", + "title": "Content", + "category": "theme", + "description": "Displays the contents of a post or page.", + "textdomain": "default", + "usesContext": [ "postId", "postType", "queryId" ], + "attributes": { + "tagName": { + "type": "string", + "default": "div" + } + }, + "example": { + "viewportWidth": 350 + }, + "supports": { + "anchor": true, + "align": [ "wide", "full" ], + "html": false, + "layout": true, + "background": { + "backgroundImage": true, + "backgroundSize": true, + "__experimentalDefaultControls": { + "backgroundImage": true + } + }, + "dimensions": { + "minHeight": true + }, + "spacing": { + "blockGap": true, + "padding": true, + "margin": true, + "__experimentalDefaultControls": { + "margin": false, + "padding": false + } + }, + "color": { + "gradients": true, + "heading": true, + "link": true, + "__experimentalDefaultControls": { + "background": false, + "text": false + } + }, + "typography": { + "fontSize": true, + "lineHeight": true, + "__experimentalFontFamily": true, + "__experimentalFontWeight": true, + "__experimentalFontStyle": true, + "__experimentalTextTransform": true, + "__experimentalTextDecoration": true, + "__experimentalLetterSpacing": true, + "__experimentalDefaultControls": { + "fontSize": true + } + }, + "interactivity": { + "clientNavigation": true + }, + "__experimentalBorder": { + "radius": true, + "color": true, + "width": true, + "style": true, + "__experimentalDefaultControls": { + "radius": true, + "color": true, + "width": true, + "style": true + } + } + }, + "style": "wp-block-post-content", + "editorStyle": "wp-block-post-content-editor" +} diff --git a/src/wp-includes/blocks/post-date.php b/src/wp-includes/blocks/post-date.php new file mode 100644 index 0000000000000..a8073dd846217 --- /dev/null +++ b/src/wp-includes/blocks/post-date.php @@ -0,0 +1,106 @@ + 'modified', + ); + } else { + $source_args = array( + 'field' => 'date', + ); + } + $attributes['datetime'] = $source->get_value( $source_args, $block, 'datetime' ); + } + + if ( isset( $source_args['field'] ) && 'modified' === $source_args['field'] ) { + $classes[] = 'wp-block-post-date__modified-date'; + } + + if ( empty( $attributes['datetime'] ) ) { + // If the `datetime` attribute is set but empty, it could be because Block Bindings + // set it that way. This can happen e.g. if the block is bound to the + // post's last modified date, and the latter lies before the publish date. + // (See https://github.com/WordPress/gutenberg/pull/46839 where this logic was originally + // implemented.) + // In this case, we have to respect and return the empty value. + return ''; + } + + $unformatted_date = $attributes['datetime']; + $post_timestamp = strtotime( $unformatted_date ); + + if ( isset( $attributes['format'] ) && 'human-diff' === $attributes['format'] ) { + if ( $post_timestamp > time() ) { + // translators: %s: human-readable time difference. + $formatted_date = sprintf( __( '%s from now' ), human_time_diff( $post_timestamp ) ); + } else { + // translators: %s: human-readable time difference. + $formatted_date = sprintf( __( '%s ago' ), human_time_diff( $post_timestamp ) ); + } + } else { + $format = empty( $attributes['format'] ) ? get_option( 'date_format' ) : $attributes['format']; + $formatted_date = wp_date( $format, $post_timestamp ); + } + + if ( isset( $attributes['textAlign'] ) ) { + $classes[] = 'has-text-align-' . $attributes['textAlign']; + } + if ( isset( $attributes['style']['elements']['link']['color']['text'] ) ) { + $classes[] = 'has-link-color'; + } + + $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => implode( ' ', $classes ) ) ); + + $time_tag = sprintf( '', $unformatted_date, $formatted_date ); + + if ( isset( $attributes['isLink'] ) && $attributes['isLink'] && isset( $block->context['postId'] ) ) { + $time_tag = sprintf( '%2s', get_the_permalink( $block->context['postId'] ), $time_tag ); + } + + return sprintf( '
      %2$s
      ', $wrapper_attributes, $time_tag ); +} + +/** + * Registers the `core/post-date` block on the server. + * + * @since 5.8.0 + */ +function register_block_core_post_date() { + register_block_type_from_metadata( + __DIR__ . '/post-date', + array( + 'render_callback' => 'render_block_core_post_date', + ) + ); +} +add_action( 'init', 'register_block_core_post_date' ); diff --git a/src/wp-includes/blocks/post-date/block.json b/src/wp-includes/blocks/post-date/block.json new file mode 100644 index 0000000000000..7952e36af3661 --- /dev/null +++ b/src/wp-includes/blocks/post-date/block.json @@ -0,0 +1,75 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "core/post-date", + "title": "Date", + "category": "theme", + "description": "Display a custom date.", + "textdomain": "default", + "attributes": { + "datetime": { + "type": "string", + "role": "content" + }, + "textAlign": { + "type": "string" + }, + "format": { + "type": "string" + }, + "isLink": { + "type": "boolean", + "default": false, + "role": "content" + } + }, + "usesContext": [ "postId", "postType", "queryId" ], + "example": { + "viewportWidth": 350 + }, + "supports": { + "anchor": true, + "html": false, + "color": { + "gradients": true, + "link": true, + "__experimentalDefaultControls": { + "background": true, + "text": true, + "link": true + } + }, + "spacing": { + "margin": true, + "padding": true + }, + "typography": { + "fontSize": true, + "lineHeight": true, + "__experimentalFontFamily": true, + "__experimentalFontWeight": true, + "__experimentalFontStyle": true, + "__experimentalTextTransform": true, + "__experimentalTextDecoration": true, + "__experimentalLetterSpacing": true, + "__experimentalDefaultControls": { + "fontSize": true + } + }, + "interactivity": { + "clientNavigation": true + }, + "__experimentalBorder": { + "radius": true, + "color": true, + "width": true, + "style": true, + "__experimentalDefaultControls": { + "radius": true, + "color": true, + "width": true, + "style": true + } + } + } +} diff --git a/src/wp-includes/blocks/post-excerpt.php b/src/wp-includes/blocks/post-excerpt.php new file mode 100644 index 0000000000000..64748162cacc8 --- /dev/null +++ b/src/wp-includes/blocks/post-excerpt.php @@ -0,0 +1,117 @@ +context['postId'] ) ) { + return ''; + } + + $more_text = ! empty( $attributes['moreText'] ) ? '' . wp_kses_post( $attributes['moreText'] ) . '' : ''; + $filter_excerpt_more = static function ( $more ) use ( $more_text ) { + return empty( $more_text ) ? $more : ''; + }; + /** + * Some themes might use `excerpt_more` filter to handle the + * `more` link displayed after a trimmed excerpt. Since the + * block has a `more text` attribute we have to check and + * override if needed the return value from this filter. + * So if the block's attribute is not empty override the + * `excerpt_more` filter and return nothing. This will + * result in showing only one `read more` link at a time. + * + * This hook needs to be applied before the excerpt is retrieved with get_the_excerpt. + * Otherwise, the read more link filter from the theme is not removed. + */ + add_filter( 'excerpt_more', $filter_excerpt_more ); + + /* + * The purpose of the excerpt length setting is to limit the length of both + * automatically generated and user-created excerpts. + * Because the excerpt_length filter only applies to auto generated excerpts, + * wp_trim_words is used instead. + * + * To ensure the block's excerptLength setting works correctly for auto-generated + * excerpts, we temporarily override excerpt_length to 101 (the max block setting) + * so that wp_trim_excerpt doesn't pre-trim the content before wp_trim_words can + * apply the user's desired length. + */ + $excerpt_length = $attributes['excerptLength']; + add_filter( 'excerpt_length', 'block_core_post_excerpt_excerpt_length', PHP_INT_MAX ); + + $excerpt = get_the_excerpt( $block->context['postId'] ); + + remove_filter( 'excerpt_length', 'block_core_post_excerpt_excerpt_length', PHP_INT_MAX ); + + if ( isset( $excerpt_length ) ) { + $excerpt = wp_trim_words( $excerpt, $excerpt_length ); + } + + $classes = array(); + if ( isset( $attributes['textAlign'] ) ) { + $classes[] = 'has-text-align-' . $attributes['textAlign']; + } + if ( isset( $attributes['style']['elements']['link']['color']['text'] ) ) { + $classes[] = 'has-link-color'; + } + $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => implode( ' ', $classes ) ) ); + + $content = '

      ' . $excerpt; + $show_more_on_new_line = ! isset( $attributes['showMoreOnNewLine'] ) || $attributes['showMoreOnNewLine']; + if ( $show_more_on_new_line && ! empty( $more_text ) ) { + $content .= '

      ' . $more_text . '

      '; + } else { + $content .= " $more_text

      "; + } + remove_filter( 'excerpt_more', $filter_excerpt_more ); + return sprintf( '
      %2$s
      ', $wrapper_attributes, $content ); +} + +/** + * Registers the `core/post-excerpt` block on the server. + * + * @since 5.8.0 + */ +function register_block_core_post_excerpt() { + register_block_type_from_metadata( + __DIR__ . '/post-excerpt', + array( + 'render_callback' => 'render_block_core_post_excerpt', + ) + ); +} +add_action( 'init', 'register_block_core_post_excerpt' ); + +/** + * Callback for the excerpt_length filter to override the excerpt length. + * + * If themes or plugins filter the excerpt_length, we need to + * override the filter in the editor, otherwise + * the excerpt length block setting has no effect. + * Returns 101 (one more than the max block setting of 100) to ensure + * wp_trim_words can detect when trimming is needed and add the ellipsis. + * + * @since 7.0.0 + * + * @return int The excerpt length. + */ +function block_core_post_excerpt_excerpt_length() { + return 101; +} + +if ( is_admin() ) { + add_filter( 'excerpt_length', 'block_core_post_excerpt_excerpt_length', PHP_INT_MAX ); +} diff --git a/src/wp-includes/blocks/post-excerpt/block.json b/src/wp-includes/blocks/post-excerpt/block.json new file mode 100644 index 0000000000000..99f6d5dcc99ed --- /dev/null +++ b/src/wp-includes/blocks/post-excerpt/block.json @@ -0,0 +1,78 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "core/post-excerpt", + "title": "Excerpt", + "category": "theme", + "description": "Display the excerpt.", + "textdomain": "default", + "attributes": { + "textAlign": { + "type": "string" + }, + "moreText": { + "type": "string", + "role": "content" + }, + "showMoreOnNewLine": { + "type": "boolean", + "default": true + }, + "excerptLength": { + "type": "number", + "default": 55 + } + }, + "usesContext": [ "postId", "postType", "queryId" ], + "example": { + "viewportWidth": 350 + }, + "supports": { + "anchor": true, + "html": false, + "color": { + "gradients": true, + "link": true, + "__experimentalDefaultControls": { + "background": true, + "text": true, + "link": true + } + }, + "spacing": { + "margin": true, + "padding": true + }, + "typography": { + "fontSize": true, + "lineHeight": true, + "textColumns": true, + "__experimentalFontFamily": true, + "__experimentalFontWeight": true, + "__experimentalFontStyle": true, + "__experimentalTextTransform": true, + "__experimentalTextDecoration": true, + "__experimentalLetterSpacing": true, + "__experimentalDefaultControls": { + "fontSize": true + } + }, + "interactivity": { + "clientNavigation": true + }, + "__experimentalBorder": { + "radius": true, + "color": true, + "width": true, + "style": true, + "__experimentalDefaultControls": { + "radius": true, + "color": true, + "width": true, + "style": true + } + } + }, + "editorStyle": "wp-block-post-excerpt-editor", + "style": "wp-block-post-excerpt" +} diff --git a/src/wp-includes/blocks/post-featured-image.php b/src/wp-includes/blocks/post-featured-image.php new file mode 100644 index 0000000000000..e9fc60f7038f5 --- /dev/null +++ b/src/wp-includes/blocks/post-featured-image.php @@ -0,0 +1,269 @@ +context['postId'] ) ) { + return ''; + } + $post_ID = $block->context['postId']; + + $is_link = isset( $attributes['isLink'] ) && $attributes['isLink']; + $size_slug = $attributes['sizeSlug'] ?? 'post-thumbnail'; + $attr = get_block_core_post_featured_image_border_attributes( $attributes ); + $overlay_markup = get_block_core_post_featured_image_overlay_element_markup( $attributes ); + + if ( $is_link ) { + $title = get_the_title( $post_ID ); + if ( $title ) { + $attr['alt'] = trim( strip_tags( $title ) ); + } else { + $attr['alt'] = sprintf( + // translators: %d is the post ID. + __( 'Untitled post %d' ), + $post_ID + ); + } + } + + $extra_styles = ''; + + // Aspect ratio with a height set needs to override the default width/height. + if ( ! empty( $attributes['aspectRatio'] ) ) { + $extra_styles .= 'width:100%;height:100%;'; + } elseif ( ! empty( $attributes['height'] ) ) { + $extra_styles .= "height:{$attributes['height']};"; + } + + if ( ! empty( $attributes['scale'] ) ) { + $extra_styles .= "object-fit:{$attributes['scale']};"; + } + if ( ! empty( $attributes['style']['shadow'] ) ) { + $shadow_styles = wp_style_engine_get_styles( array( 'shadow' => $attributes['style']['shadow'] ) ); + + if ( ! empty( $shadow_styles['css'] ) ) { + $extra_styles .= $shadow_styles['css']; + } + } + + if ( ! empty( $extra_styles ) ) { + $attr['style'] = empty( $attr['style'] ) ? $extra_styles : $attr['style'] . $extra_styles; + } + + $featured_image = get_the_post_thumbnail( $post_ID, $size_slug, $attr ); + + // Get the first image from the post. + if ( $attributes['useFirstImageFromPost'] && ! $featured_image ) { + $content_post = get_post( $post_ID ); + $content = $content_post->post_content; + $processor = new WP_HTML_Tag_Processor( $content ); + + /* + * Transfer the image tag from the post into a new text snippet. + * Because the HTML API doesn't currently expose a way to extract + * HTML substrings this is necessary as a workaround. Of note, this + * is different than directly extracting the IMG tag: + * - If there are duplicate attributes in the source there will only be one in the output. + * - If there are single-quoted or unquoted attributes they will be double-quoted in the output. + * - If there are named character references in the attribute values they may be replaced with their direct code points. E.g. `…` becomes `…`. + * In the future there will likely be a mechanism to copy snippets of HTML from + * one document into another, via the HTML Processor's `get_outer_html()` or + * equivalent. When that happens it would be appropriate to replace this custom + * code with that canonical code. + */ + if ( $processor->next_tag( 'img' ) ) { + $tag_html = new WP_HTML_Tag_Processor( '' ); + $tag_html->next_tag(); + foreach ( $processor->get_attribute_names_with_prefix( '' ) as $name ) { + $tag_html->set_attribute( $name, $processor->get_attribute( $name ) ); + } + $featured_image = $tag_html->get_updated_html(); + } + } + + if ( ! $featured_image ) { + return ''; + } + + if ( $is_link ) { + $link_target = $attributes['linkTarget']; + $rel = ! empty( $attributes['rel'] ) ? 'rel="' . esc_attr( $attributes['rel'] ) . '"' : ''; + $height = ! empty( $attributes['height'] ) ? 'style="' . esc_attr( safecss_filter_attr( 'height:' . $attributes['height'] ) ) . '"' : ''; + $featured_image = sprintf( + '%5$s%6$s', + get_the_permalink( $post_ID ), + esc_attr( $link_target ), + $rel, + $height, + $featured_image, + $overlay_markup + ); + } else { + $featured_image = $featured_image . $overlay_markup; + } + + $aspect_ratio = ! empty( $attributes['aspectRatio'] ) + ? esc_attr( safecss_filter_attr( 'aspect-ratio:' . $attributes['aspectRatio'] ) ) . ';' + : ''; + $width = ! empty( $attributes['width'] ) + ? esc_attr( safecss_filter_attr( 'width:' . $attributes['width'] ) ) . ';' + : ''; + $height = ! empty( $attributes['height'] ) + ? esc_attr( safecss_filter_attr( 'height:' . $attributes['height'] ) ) . ';' + : ''; + if ( ! $height && ! $width && ! $aspect_ratio ) { + $wrapper_attributes = get_block_wrapper_attributes(); + } else { + $wrapper_attributes = get_block_wrapper_attributes( array( 'style' => $aspect_ratio . $width . $height ) ); + } + return "
      {$featured_image}
      "; +} + +/** + * Generate markup for the HTML element that will be used for the overlay. + * + * @since 6.1.0 + * + * @param array $attributes Block attributes. + * + * @return string HTML markup in string format. + */ +function get_block_core_post_featured_image_overlay_element_markup( $attributes ) { + $has_dim_background = isset( $attributes['dimRatio'] ) && $attributes['dimRatio']; + $has_gradient = isset( $attributes['gradient'] ) && $attributes['gradient']; + $has_custom_gradient = isset( $attributes['customGradient'] ) && $attributes['customGradient']; + $has_solid_overlay = isset( $attributes['overlayColor'] ) && $attributes['overlayColor']; + $has_custom_overlay = isset( $attributes['customOverlayColor'] ) && $attributes['customOverlayColor']; + $class_names = array( 'wp-block-post-featured-image__overlay' ); + $styles = array(); + + if ( ! $has_dim_background ) { + return ''; + } + + // Apply border classes and styles. + $border_attributes = get_block_core_post_featured_image_border_attributes( $attributes ); + + if ( ! empty( $border_attributes['class'] ) ) { + $class_names[] = $border_attributes['class']; + } + + if ( ! empty( $border_attributes['style'] ) ) { + $styles[] = $border_attributes['style']; + } + + // Apply overlay and gradient classes. + if ( $has_dim_background ) { + $class_names[] = 'has-background-dim'; + $class_names[] = "has-background-dim-{$attributes['dimRatio']}"; + } + + if ( $has_solid_overlay ) { + $class_names[] = "has-{$attributes['overlayColor']}-background-color"; + } + + if ( $has_gradient || $has_custom_gradient ) { + $class_names[] = 'has-background-gradient'; + } + + if ( $has_gradient ) { + $class_names[] = "has-{$attributes['gradient']}-gradient-background"; + } + + // Apply background styles. + if ( $has_custom_gradient ) { + $styles[] = sprintf( 'background-image: %s;', $attributes['customGradient'] ); + } + + if ( $has_custom_overlay ) { + $styles[] = sprintf( 'background-color: %s;', $attributes['customOverlayColor'] ); + } + + return sprintf( + '', + esc_attr( implode( ' ', $class_names ) ), + esc_attr( safecss_filter_attr( implode( ' ', $styles ) ) ) + ); +} + +/** + * Generates class names and styles to apply the border support styles for + * the Post Featured Image block. + * + * @since 6.1.0 + * + * @param array $attributes The block attributes. + * @return array The border-related classnames and styles for the block. + */ +function get_block_core_post_featured_image_border_attributes( $attributes ) { + $border_styles = array(); + $sides = array( 'top', 'right', 'bottom', 'left' ); + + // Border radius. + if ( isset( $attributes['style']['border']['radius'] ) ) { + $border_styles['radius'] = $attributes['style']['border']['radius']; + } + + // Border style. + if ( isset( $attributes['style']['border']['style'] ) ) { + $border_styles['style'] = $attributes['style']['border']['style']; + } + + // Border width. + if ( isset( $attributes['style']['border']['width'] ) ) { + $border_styles['width'] = $attributes['style']['border']['width']; + } + + // Border color. + $preset_color = array_key_exists( 'borderColor', $attributes ) ? "var:preset|color|{$attributes['borderColor']}" : null; + $custom_color = $attributes['style']['border']['color'] ?? null; + $border_styles['color'] = $preset_color ? $preset_color : $custom_color; + + // Individual border styles e.g. top, left etc. + foreach ( $sides as $side ) { + $border = $attributes['style']['border'][ $side ] ?? null; + $border_styles[ $side ] = array( + 'color' => $border['color'] ?? null, + 'style' => $border['style'] ?? null, + 'width' => $border['width'] ?? null, + ); + } + + $styles = wp_style_engine_get_styles( array( 'border' => $border_styles ) ); + $attributes = array(); + if ( ! empty( $styles['classnames'] ) ) { + $attributes['class'] = $styles['classnames']; + } + if ( ! empty( $styles['css'] ) ) { + $attributes['style'] = $styles['css']; + } + return $attributes; +} + +/** + * Registers the `core/post-featured-image` block on the server. + * + * @since 5.8.0 + */ +function register_block_core_post_featured_image() { + register_block_type_from_metadata( + __DIR__ . '/post-featured-image', + array( + 'render_callback' => 'render_block_core_post_featured_image', + ) + ); +} +add_action( 'init', 'register_block_core_post_featured_image' ); diff --git a/src/wp-includes/blocks/post-featured-image/block.json b/src/wp-includes/blocks/post-featured-image/block.json new file mode 100644 index 0000000000000..f5619dc29fac5 --- /dev/null +++ b/src/wp-includes/blocks/post-featured-image/block.json @@ -0,0 +1,109 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "core/post-featured-image", + "title": "Featured Image", + "category": "theme", + "description": "Display a post's featured image.", + "textdomain": "default", + "attributes": { + "isLink": { + "type": "boolean", + "default": false, + "role": "content" + }, + "aspectRatio": { + "type": "string" + }, + "width": { + "type": "string" + }, + "height": { + "type": "string" + }, + "scale": { + "type": "string", + "default": "cover" + }, + "sizeSlug": { + "type": "string" + }, + "rel": { + "type": "string", + "attribute": "rel", + "default": "", + "role": "content" + }, + "linkTarget": { + "type": "string", + "default": "_self", + "role": "content" + }, + "overlayColor": { + "type": "string" + }, + "customOverlayColor": { + "type": "string" + }, + "dimRatio": { + "type": "number", + "default": 0 + }, + "gradient": { + "type": "string" + }, + "customGradient": { + "type": "string" + }, + "useFirstImageFromPost": { + "type": "boolean", + "default": false + } + }, + "usesContext": [ "postId", "postType", "queryId" ], + "example": { + "viewportWidth": 350 + }, + "supports": { + "anchor": true, + "align": [ "left", "right", "center", "wide", "full" ], + "color": { + "text": false, + "background": false + }, + "__experimentalBorder": { + "color": true, + "radius": true, + "width": true, + "__experimentalSkipSerialization": true, + "__experimentalDefaultControls": { + "color": true, + "radius": true, + "width": true + } + }, + "filter": { + "duotone": true + }, + "shadow": { + "__experimentalSkipSerialization": true + }, + "html": false, + "spacing": { + "margin": true, + "padding": true + }, + "interactivity": { + "clientNavigation": true + } + }, + "selectors": { + "border": ".wp-block-post-featured-image img, .wp-block-post-featured-image .block-editor-media-placeholder, .wp-block-post-featured-image .wp-block-post-featured-image__overlay", + "shadow": ".wp-block-post-featured-image img, .wp-block-post-featured-image .components-placeholder", + "filter": { + "duotone": ".wp-block-post-featured-image img, .wp-block-post-featured-image .wp-block-post-featured-image__placeholder, .wp-block-post-featured-image .components-placeholder__illustration, .wp-block-post-featured-image .components-placeholder::before" + } + }, + "editorStyle": "wp-block-post-featured-image-editor", + "style": "wp-block-post-featured-image" +} diff --git a/src/wp-includes/blocks/post-navigation-link.php b/src/wp-includes/blocks/post-navigation-link.php new file mode 100644 index 0000000000000..cde3910e74353 --- /dev/null +++ b/src/wp-includes/blocks/post-navigation-link.php @@ -0,0 +1,139 @@ + $classes, + ) + ); + // Set default values. + $format = '%link'; + $link = 'next' === $navigation_type ? _x( 'Next', 'label for next post link' ) : _x( 'Previous', 'label for previous post link' ); + $label = ''; + + // Only use hardcoded values here, otherwise we need to add escaping where these values are used. + $arrow_map = array( + 'none' => '', + 'arrow' => array( + 'next' => '→', + 'previous' => '←', + ), + 'chevron' => array( + 'next' => '»', + 'previous' => '«', + ), + ); + + // If a custom label is provided, make this a link. + // `$label` is used to prepend the provided label, if we want to show the page title as well. + if ( isset( $attributes['label'] ) && ! empty( $attributes['label'] ) ) { + $label = "{$attributes['label']}"; + $link = $label; + } + + // If we want to also show the page title, make the page title a link and prepend the label. + if ( isset( $attributes['showTitle'] ) && $attributes['showTitle'] ) { + /* + * If the label link option is not enabled but there is a custom label, + * display the custom label as text before the linked title. + */ + if ( ! $attributes['linkLabel'] ) { + if ( $label ) { + $format = '' . wp_kses_post( $label ) . ' %link'; + } + $link = '%title'; + } elseif ( isset( $attributes['linkLabel'] ) && $attributes['linkLabel'] ) { + // If the label link option is enabled and there is a custom label, display it before the title. + if ( $label ) { + $link = '' . wp_kses_post( $label ) . ' %title'; + } else { + /* + * If the label link option is enabled and there is no custom label, + * add a colon between the label and the post title. + */ + $label = 'next' === $navigation_type ? _x( 'Next:', 'label before the title of the next post' ) : _x( 'Previous:', 'label before the title of the previous post' ); + $link = sprintf( + '%1$s %2$s', + wp_kses_post( $label ), + '%title' + ); + } + } + } + + // Display arrows. + if ( isset( $attributes['arrow'] ) && 'none' !== $attributes['arrow'] && isset( $arrow_map[ $attributes['arrow'] ] ) ) { + $arrow = $arrow_map[ $attributes['arrow'] ][ $navigation_type ]; + + if ( 'next' === $navigation_type ) { + $format = '%link'; + } else { + $format = '%link'; + } + } + + /* + * The dynamic portion of the function name, `$navigation_type`, + * Refers to the type of adjacency, 'next' or 'previous'. + * + * @see https://developer.wordpress.org/reference/functions/get_previous_post_link/ + * @see https://developer.wordpress.org/reference/functions/get_next_post_link/ + */ + $get_link_function = "get_{$navigation_type}_post_link"; + + if ( ! empty( $attributes['taxonomy'] ) ) { + $content = $get_link_function( $format, $link, true, '', $attributes['taxonomy'] ); + } else { + $content = $get_link_function( $format, $link ); + } + + return sprintf( + '
      %2$s
      ', + $wrapper_attributes, + $content + ); +} + +/** + * Registers the `core/post-navigation-link` block on the server. + * + * @since 5.9.0 + */ +function register_block_core_post_navigation_link() { + register_block_type_from_metadata( + __DIR__ . '/post-navigation-link', + array( + 'render_callback' => 'render_block_core_post_navigation_link', + ) + ); +} +add_action( 'init', 'register_block_core_post_navigation_link' ); diff --git a/src/wp-includes/blocks/post-navigation-link/block.json b/src/wp-includes/blocks/post-navigation-link/block.json new file mode 100644 index 0000000000000..6d51d619637c9 --- /dev/null +++ b/src/wp-includes/blocks/post-navigation-link/block.json @@ -0,0 +1,65 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "core/post-navigation-link", + "title": "Post Navigation Link", + "category": "theme", + "description": "Displays the next or previous post link that is adjacent to the current post.", + "textdomain": "default", + "attributes": { + "textAlign": { + "type": "string" + }, + "type": { + "type": "string", + "default": "next" + }, + "label": { + "type": "string", + "role": "content" + }, + "showTitle": { + "type": "boolean", + "default": false + }, + "linkLabel": { + "type": "boolean", + "default": false + }, + "arrow": { + "type": "string", + "default": "none" + }, + "taxonomy": { + "type": "string", + "default": "" + } + }, + "usesContext": [ "postType" ], + "supports": { + "anchor": true, + "reusable": false, + "html": false, + "color": { + "link": true + }, + "typography": { + "fontSize": true, + "lineHeight": true, + "__experimentalFontFamily": true, + "__experimentalFontWeight": true, + "__experimentalFontStyle": true, + "__experimentalTextTransform": true, + "__experimentalTextDecoration": true, + "__experimentalLetterSpacing": true, + "__experimentalWritingMode": true, + "__experimentalDefaultControls": { + "fontSize": true + } + }, + "interactivity": { + "clientNavigation": true + } + }, + "style": "wp-block-post-navigation-link" +} diff --git a/src/wp-includes/blocks/post-template.php b/src/wp-includes/blocks/post-template.php new file mode 100644 index 0000000000000..72ebbe0e13d13 --- /dev/null +++ b/src/wp-includes/blocks/post-template.php @@ -0,0 +1,162 @@ +name ) { + return true; + } + if ( + 'core/cover' === $block->name && + ! empty( $block->attributes['useFeaturedImage'] ) + ) { + return true; + } + if ( $block->inner_blocks && block_core_post_template_uses_featured_image( $block->inner_blocks ) ) { + return true; + } + } + + return false; +} + +/** + * Renders the `core/post-template` block on the server. + * + * @since 6.3.0 Changed render_block_context priority to `1`. + * + * @global WP_Query $wp_query WordPress Query object. + * + * @param array $attributes Block attributes. + * @param string $content Block default content. + * @param WP_Block $block Block instance. + * + * @return string Returns the output of the query, structured using the layout defined by the block's inner blocks. + */ +function render_block_core_post_template( $attributes, $content, $block ) { + $page_key = isset( $block->context['queryId'] ) ? 'query-' . $block->context['queryId'] . '-page' : 'query-page'; + $enhanced_pagination = (bool) ( $block->context['enhancedPagination'] ?? false ); + $page = empty( $_GET[ $page_key ] ) ? 1 : (int) $_GET[ $page_key ]; + + // Use global query if needed. + $use_global_query = (bool) ( $block->context['query']['inherit'] ?? false ); + if ( $use_global_query ) { + global $wp_query; + + /* + * If already in the main query loop, duplicate the query instance to not tamper with the main instance. + * Since this is a nested query, it should start at the beginning, therefore rewind posts. + * Otherwise, the main query loop has not started yet and this block is responsible for doing so. + */ + if ( in_the_loop() ) { + $query = clone $wp_query; + $query->rewind_posts(); + } else { + $query = $wp_query; + } + } else { + $query_args = build_query_vars_from_query_block( $block, $page ); + $query = new WP_Query( $query_args ); + } + + if ( ! $query->have_posts() ) { + return ''; + } + + if ( block_core_post_template_uses_featured_image( $block->inner_blocks ) ) { + update_post_thumbnail_cache( $query ); + } + + $classnames = ''; + if ( isset( $block->context['displayLayout'] ) && isset( $block->context['query'] ) ) { + if ( isset( $block->context['displayLayout']['type'] ) && 'flex' === $block->context['displayLayout']['type'] ) { + $classnames = "is-flex-container columns-{$block->context['displayLayout']['columns']}"; + } + } + if ( isset( $attributes['style']['elements']['link']['color']['text'] ) ) { + $classnames .= ' has-link-color'; + } + + // Ensure backwards compatibility by flagging the number of columns via classname when using grid layout. + if ( isset( $attributes['layout']['type'] ) && 'grid' === $attributes['layout']['type'] && ! empty( $attributes['layout']['columnCount'] ) ) { + $classnames .= ' ' . sanitize_title( 'columns-' . $attributes['layout']['columnCount'] ); + } + + $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => trim( $classnames ) ) ); + + $content = ''; + while ( $query->have_posts() ) { + $query->the_post(); + + // Get an instance of the current Post Template block. + $block_instance = $block->parsed_block; + + // Set the block name to one that does not correspond to an existing registered block. + // This ensures that for the inner instances of the Post Template block, we do not render any block supports. + $block_instance['blockName'] = 'core/null'; + + $post_id = get_the_ID(); + $post_type = get_post_type(); + $filter_block_context = static function ( $context ) use ( $post_id, $post_type ) { + $context['postType'] = $post_type; + $context['postId'] = $post_id; + return $context; + }; + + // Use an early priority to so that other 'render_block_context' filters have access to the values. + add_filter( 'render_block_context', $filter_block_context, 1 ); + // Render the inner blocks of the Post Template block with `dynamic` set to `false` to prevent calling + // `render_callback` and ensure that no wrapper markup is included. + $block_content = ( new WP_Block( $block_instance ) )->render( array( 'dynamic' => false ) ); + remove_filter( 'render_block_context', $filter_block_context, 1 ); + + // Wrap the render inner blocks in a `li` element with the appropriate post classes. + $post_classes = implode( ' ', get_post_class( 'wp-block-post' ) ); + + $inner_block_directives = $enhanced_pagination ? ' data-wp-key="post-template-item-' . $post_id . '"' : ''; + + $content .= '' . $block_content . ''; + } + + /* + * Use this function to restore the context of the template tags + * from a secondary query loop back to the main query loop. + * Since we use two custom loops, it's safest to always restore. + */ + wp_reset_postdata(); + + return sprintf( + '
        %2$s
      ', + $wrapper_attributes, + $content + ); +} + +/** + * Registers the `core/post-template` block on the server. + * + * @since 5.8.0 + */ +function register_block_core_post_template() { + register_block_type_from_metadata( + __DIR__ . '/post-template', + array( + 'render_callback' => 'render_block_core_post_template', + 'skip_inner_blocks' => true, + ) + ); +} +add_action( 'init', 'register_block_core_post_template' ); diff --git a/src/wp-includes/blocks/post-template/block.json b/src/wp-includes/blocks/post-template/block.json new file mode 100644 index 0000000000000..fdd8e647154cc --- /dev/null +++ b/src/wp-includes/blocks/post-template/block.json @@ -0,0 +1,70 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "core/post-template", + "title": "Post Template", + "category": "theme", + "ancestor": [ "core/query" ], + "description": "Contains the block elements used to render a post, like the title, date, featured image, content or excerpt, and more.", + "textdomain": "default", + "usesContext": [ + "queryId", + "query", + "displayLayout", + "templateSlug", + "previewPostType", + "enhancedPagination", + "postType" + ], + "supports": { + "anchor": true, + "reusable": false, + "html": false, + "align": [ "wide", "full" ], + "layout": true, + "color": { + "gradients": true, + "link": true, + "__experimentalDefaultControls": { + "background": true, + "text": true + } + }, + "typography": { + "fontSize": true, + "lineHeight": true, + "__experimentalFontFamily": true, + "__experimentalFontWeight": true, + "__experimentalFontStyle": true, + "__experimentalTextTransform": true, + "__experimentalTextDecoration": true, + "__experimentalLetterSpacing": true, + "__experimentalDefaultControls": { + "fontSize": true + } + }, + "spacing": { + "margin": true, + "padding": true, + "blockGap": { + "__experimentalDefault": "1.25em" + }, + "__experimentalDefaultControls": { + "blockGap": true, + "padding": false, + "margin": false + } + }, + "interactivity": { + "clientNavigation": true + }, + "__experimentalBorder": { + "radius": true, + "color": true, + "width": true, + "style": true + } + }, + "style": "wp-block-post-template", + "editorStyle": "wp-block-post-template-editor" +} diff --git a/src/wp-includes/blocks/post-terms.php b/src/wp-includes/blocks/post-terms.php new file mode 100644 index 0000000000000..3e7a05f10117e --- /dev/null +++ b/src/wp-includes/blocks/post-terms.php @@ -0,0 +1,130 @@ +context['postId'] ) || ! isset( $attributes['term'] ) ) { + return ''; + } + + if ( ! is_taxonomy_viewable( $attributes['term'] ) ) { + return ''; + } + + $classes = array( 'taxonomy-' . $attributes['term'] ); + if ( isset( $attributes['textAlign'] ) ) { + $classes[] = 'has-text-align-' . $attributes['textAlign']; + } + if ( isset( $attributes['style']['elements']['link']['color']['text'] ) ) { + $classes[] = 'has-link-color'; + } + + $separator = empty( $attributes['separator'] ) ? ' ' : $attributes['separator']; + + $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => implode( ' ', $classes ) ) ); + + $prefix = "
      "; + if ( isset( $attributes['prefix'] ) && $attributes['prefix'] ) { + $prefix .= '' . $attributes['prefix'] . ''; + } + + $suffix = '
      '; + if ( isset( $attributes['suffix'] ) && $attributes['suffix'] ) { + $suffix = '' . $attributes['suffix'] . '' . $suffix; + } + + $post_terms = get_the_term_list( + $block->context['postId'], + $attributes['term'], + wp_kses_post( $prefix ), + '' . esc_html( $separator ) . '', + wp_kses_post( $suffix ) + ); + + if ( is_wp_error( $post_terms ) || empty( $post_terms ) ) { + return ''; + } + + return $post_terms; +} + +/** + * Returns the available variations for the `core/post-terms` block. + * + * @since 6.5.0 + * + * @return array The available variations for the block. + */ +function block_core_post_terms_build_variations() { + $taxonomies = get_taxonomies( + array( + 'publicly_queryable' => true, + 'show_in_rest' => true, + ), + 'objects' + ); + + // Split the available taxonomies to `built_in` and custom ones, + // in order to prioritize the `built_in` taxonomies at the + // search results. + $built_ins = array(); + $custom_variations = array(); + + // Create and register the eligible taxonomies variations. + foreach ( $taxonomies as $taxonomy ) { + $variation = array( + 'name' => $taxonomy->name, + 'title' => $taxonomy->label, + 'description' => sprintf( + /* translators: %s: taxonomy's label */ + __( 'Display a list of assigned terms from the taxonomy: %s' ), + $taxonomy->label + ), + 'attributes' => array( + 'term' => $taxonomy->name, + ), + 'isActive' => array( 'term' ), + 'scope' => array( 'inserter', 'transform' ), + ); + // Set the category variation as the default one. + if ( 'category' === $taxonomy->name ) { + $variation['isDefault'] = true; + } + if ( $taxonomy->_builtin ) { + $built_ins[] = $variation; + } else { + $custom_variations[] = $variation; + } + } + + return array_merge( $built_ins, $custom_variations ); +} + +/** + * Registers the `core/post-terms` block on the server. + * + * @since 5.8.0 + */ +function register_block_core_post_terms() { + register_block_type_from_metadata( + __DIR__ . '/post-terms', + array( + 'render_callback' => 'render_block_core_post_terms', + 'variation_callback' => 'block_core_post_terms_build_variations', + ) + ); +} +add_action( 'init', 'register_block_core_post_terms' ); diff --git a/src/wp-includes/blocks/post-terms/block.json b/src/wp-includes/blocks/post-terms/block.json new file mode 100644 index 0000000000000..5dcb079d34713 --- /dev/null +++ b/src/wp-includes/blocks/post-terms/block.json @@ -0,0 +1,79 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "core/post-terms", + "title": "Post Terms", + "category": "theme", + "description": "Post terms.", + "textdomain": "default", + "attributes": { + "term": { + "type": "string" + }, + "separator": { + "type": "string", + "default": ", " + }, + "prefix": { + "type": "string", + "default": "", + "role": "content" + }, + "suffix": { + "type": "string", + "default": "", + "role": "content" + } + }, + "usesContext": [ "postId", "postType" ], + "example": { + "viewportWidth": 350 + }, + "supports": { + "anchor": true, + "html": false, + "color": { + "gradients": true, + "link": true, + "__experimentalDefaultControls": { + "background": true, + "text": true, + "link": true + } + }, + "spacing": { + "margin": true, + "padding": true + }, + "typography": { + "fontSize": true, + "lineHeight": true, + "textAlign": true, + "__experimentalFontFamily": true, + "__experimentalFontWeight": true, + "__experimentalFontStyle": true, + "__experimentalTextTransform": true, + "__experimentalTextDecoration": true, + "__experimentalLetterSpacing": true, + "__experimentalDefaultControls": { + "fontSize": true + } + }, + "interactivity": { + "clientNavigation": true + }, + "__experimentalBorder": { + "radius": true, + "color": true, + "width": true, + "style": true, + "__experimentalDefaultControls": { + "radius": true, + "color": true, + "width": true, + "style": true + } + } + }, + "style": "wp-block-post-terms" +} diff --git a/src/wp-includes/blocks/post-time-to-read.php b/src/wp-includes/blocks/post-time-to-read.php new file mode 100644 index 0000000000000..74a091d97c335 --- /dev/null +++ b/src/wp-includes/blocks/post-time-to-read.php @@ -0,0 +1,185 @@ + '/<\/?[a-z][^>]*?>/i', + 'html_comment_regexp' => '//', + 'space_regexp' => '/ | /i', + 'html_entity_regexp' => '/&\S+?;/', + 'connector_regexp' => "/--|\x{2014}/u", + 'remove_regexp' => "/[\x{0021}-\x{0040}\x{005B}-\x{0060}\x{007B}-\x{007E}\x{0080}-\x{00BF}\x{00D7}\x{00F7}\x{2000}-\x{2BFF}\x{2E00}-\x{2E7F}]/u", + 'astral_regexp' => "/[\x{010000}-\x{10FFFF}]/u", + 'words_regexp' => '/\S\s+/u', + 'characters_excluding_spaces_regexp' => '/\S/u', + 'characters_including_spaces_regexp' => "/[^\f\n\r\t\v\x{00AD}\x{2028}\x{2029}]/u", + ); + + $count = 0; + + if ( '' === trim( $text ) ) { + return $count; + } + + // Sanitize type to one of three possibilities: 'words', 'characters_excluding_spaces' or 'characters_including_spaces'. + if ( 'characters_excluding_spaces' !== $type && 'characters_including_spaces' !== $type ) { + $type = 'words'; + } + + $text .= "\n"; + + // Replace all HTML with a new-line. + $text = preg_replace( $settings['html_regexp'], "\n", $text ); + + // Remove all HTML comments. + $text = preg_replace( $settings['html_comment_regexp'], '', $text ); + + // If a shortcode regular expression has been provided use it to remove shortcodes. + if ( ! empty( $settings['shortcodes_regexp'] ) ) { + $text = preg_replace( $settings['shortcodes_regexp'], "\n", $text ); + } + + // Normalize non-breaking space to a normal space. + $text = preg_replace( $settings['space_regexp'], ' ', $text ); + + if ( 'words' === $type ) { + // Remove HTML Entities. + $text = preg_replace( $settings['html_entity_regexp'], '', $text ); + + // Convert connectors to spaces to count attached text as words. + $text = preg_replace( $settings['connector_regexp'], ' ', $text ); + + // Remove unwanted characters. + $text = preg_replace( $settings['remove_regexp'], '', $text ); + } else { + // Convert HTML Entities to "a". + $text = preg_replace( $settings['html_entity_regexp'], 'a', $text ); + + // Remove surrogate points. + $text = preg_replace( $settings['astral_regexp'], 'a', $text ); + } + + // Match with the selected type regular expression to count the items. + return (int) preg_match_all( $settings[ $type . '_regexp' ], $text ); +} + +/** + * Renders the `core/post-time-to-read` block on the server. + * + * @since 6.9.0 + * + * @param array $attributes Block attributes. + * @param string $content Block default content. + * @param WP_Block $block Block instance. + * @return string Returns the rendered post author name block. + */ +function render_block_core_post_time_to_read( $attributes, $content, $block ) { + if ( ! isset( $block->context['postId'] ) ) { + return ''; + } + + $content = get_the_content(); + $average_reading_rate = $attributes['averageReadingSpeed'] ?? 189; + + $display_mode = $attributes['displayMode'] ?? 'time'; + + $word_count_type = wp_get_word_count_type(); + $total_words = block_core_post_time_to_read_word_count( $content, $word_count_type ); + + $parts = array(); + + // Add "time to read" part, if enabled. + if ( 'time' === $display_mode ) { + if ( ! empty( $attributes['displayAsRange'] ) ) { + // Calculate faster reading rate with 20% speed = lower minutes, + // and slower reading rate with 20% speed = higher minutes. + $min_minutes = max( 1, (int) round( $total_words / $average_reading_rate * 0.8 ) ); + $max_minutes = max( 1, (int) round( $total_words / $average_reading_rate * 1.2 ) ); + if ( $min_minutes === $max_minutes ) { + $max_minutes = $min_minutes + 1; + } + /* translators: 1: minimum minutes, 2: maximum minutes to read the post. */ + $time_string = sprintf( + /* translators: 1: minimum minutes, 2: maximum minutes to read the post. */ + _x( '%1$s–%2$s minutes', 'Range of minutes to read' ), + $min_minutes, + $max_minutes + ); + } else { + $minutes_to_read = max( 1, (int) round( $total_words / $average_reading_rate ) ); + $time_string = sprintf( + /* translators: %s: the number of minutes to read the post. */ + _n( '%s minute', '%s minutes', $minutes_to_read ), + $minutes_to_read + ); + } + $parts[] = $time_string; + } + + // Add "word count" part, if enabled. + if ( 'words' === $display_mode ) { + $word_count_string = 'words' === $word_count_type ? sprintf( + /* translators: %s: the number of words in the post. */ + _n( '%s word', '%s words', $total_words ), + number_format_i18n( $total_words ) + ) : sprintf( + /* translators: %s: the number of characters in the post. */ + _n( '%s character', '%s characters', $total_words ), + number_format_i18n( $total_words ) + ); + $parts[] = $word_count_string; + } + + $display_string = implode( '
      ', $parts ); + + $align_class_name = empty( $attributes['textAlign'] ) ? '' : "has-text-align-{$attributes['textAlign']}"; + + $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $align_class_name ) ); + + return sprintf( + '
      %2$s
      ', + $wrapper_attributes, + $display_string + ); +} + + +/** + * Registers the `core/post-time-to-read` block on the server. + * + * @since 6.9.0 + */ +function register_block_core_post_time_to_read() { + register_block_type_from_metadata( + __DIR__ . '/post-time-to-read', + array( + 'render_callback' => 'render_block_core_post_time_to_read', + ) + ); +} + +add_action( 'init', 'register_block_core_post_time_to_read' ); diff --git a/src/wp-includes/blocks/post-time-to-read/block.json b/src/wp-includes/blocks/post-time-to-read/block.json new file mode 100644 index 0000000000000..18fd93c74d015 --- /dev/null +++ b/src/wp-includes/blocks/post-time-to-read/block.json @@ -0,0 +1,66 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "core/post-time-to-read", + "title": "Time to Read", + "category": "theme", + "description": "Show minutes required to finish reading the post. Can also show a word count.", + "textdomain": "default", + "usesContext": [ "postId", "postType" ], + "attributes": { + "displayAsRange": { + "type": "boolean", + "default": true + }, + "displayMode": { + "type": "string", + "default": "time" + }, + "averageReadingSpeed": { + "type": "number", + "default": 189 + } + }, + "supports": { + "anchor": true, + "color": { + "gradients": true, + "__experimentalDefaultControls": { + "background": true, + "text": true + } + }, + "html": false, + "spacing": { + "margin": true, + "padding": true, + "__experimentalDefaultControls": { + "margin": false, + "padding": false + } + }, + "typography": { + "fontSize": true, + "lineHeight": true, + "textAlign": true, + "__experimentalFontFamily": true, + "__experimentalFontWeight": true, + "__experimentalFontStyle": true, + "__experimentalTextTransform": true, + "__experimentalTextDecoration": true, + "__experimentalLetterSpacing": true, + "__experimentalDefaultControls": { + "fontSize": true + } + }, + "interactivity": { + "clientNavigation": true + }, + "__experimentalBorder": { + "radius": true, + "color": true, + "width": true, + "style": true + } + } +} diff --git a/src/wp-includes/blocks/post-title.php b/src/wp-includes/blocks/post-title.php new file mode 100644 index 0000000000000..ed27f2e4158eb --- /dev/null +++ b/src/wp-includes/blocks/post-title.php @@ -0,0 +1,74 @@ +context['postId'] ) ) { + return ''; + } + + /** + * The `$post` argument is intentionally omitted so that changes are reflected when previewing a post. + * See: https://github.com/WordPress/gutenberg/pull/37622#issuecomment-1000932816. + */ + $title = get_the_title(); + + if ( ! $title ) { + return ''; + } + + $tag_name = 'h2'; + if ( isset( $attributes['level'] ) ) { + $tag_name = 0 === $attributes['level'] ? 'p' : 'h' . (int) $attributes['level']; + } + + if ( isset( $attributes['isLink'] ) && $attributes['isLink'] ) { + $rel = ! empty( $attributes['rel'] ) ? 'rel="' . esc_attr( $attributes['rel'] ) . '"' : ''; + $title = sprintf( '%4$s', esc_url( get_the_permalink( $block->context['postId'] ) ), esc_attr( $attributes['linkTarget'] ), $rel, $title ); + } + + $classes = array(); + if ( isset( $attributes['textAlign'] ) ) { + $classes[] = 'has-text-align-' . $attributes['textAlign']; + } + if ( isset( $attributes['style']['elements']['link']['color']['text'] ) ) { + $classes[] = 'has-link-color'; + } + $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => implode( ' ', $classes ) ) ); + + return sprintf( + '<%1$s %2$s>%3$s', + $tag_name, + $wrapper_attributes, + $title + ); +} + +/** + * Registers the `core/post-title` block on the server. + * + * @since 5.8.0 + */ +function register_block_core_post_title() { + register_block_type_from_metadata( + __DIR__ . '/post-title', + array( + 'render_callback' => 'render_block_core_post_title', + ) + ); +} +add_action( 'init', 'register_block_core_post_title' ); diff --git a/src/wp-includes/blocks/post-title/block.json b/src/wp-includes/blocks/post-title/block.json new file mode 100644 index 0000000000000..1fb7efcf82db5 --- /dev/null +++ b/src/wp-includes/blocks/post-title/block.json @@ -0,0 +1,88 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "core/post-title", + "title": "Title", + "category": "theme", + "description": "Displays the title of a post, page, or any other content-type.", + "textdomain": "default", + "usesContext": [ "postId", "postType", "queryId" ], + "attributes": { + "textAlign": { + "type": "string" + }, + "level": { + "type": "number", + "default": 2 + }, + "levelOptions": { + "type": "array" + }, + "isLink": { + "type": "boolean", + "default": false, + "role": "content" + }, + "rel": { + "type": "string", + "attribute": "rel", + "default": "", + "role": "content" + }, + "linkTarget": { + "type": "string", + "default": "_self", + "role": "content" + } + }, + "example": { + "viewportWidth": 350 + }, + "supports": { + "anchor": true, + "align": [ "wide", "full" ], + "html": false, + "color": { + "gradients": true, + "link": true, + "__experimentalDefaultControls": { + "background": true, + "text": true, + "link": true + } + }, + "spacing": { + "margin": true, + "padding": true + }, + "typography": { + "fontSize": true, + "lineHeight": true, + "__experimentalFontFamily": true, + "__experimentalFontWeight": true, + "__experimentalFontStyle": true, + "__experimentalTextTransform": true, + "__experimentalTextDecoration": true, + "__experimentalLetterSpacing": true, + "__experimentalDefaultControls": { + "fontSize": true + } + }, + "interactivity": { + "clientNavigation": true + }, + "__experimentalBorder": { + "radius": true, + "color": true, + "width": true, + "style": true, + "__experimentalDefaultControls": { + "radius": true, + "color": true, + "width": true, + "style": true + } + } + }, + "style": "wp-block-post-title" +} diff --git a/src/wp-includes/blocks/preformatted/block.json b/src/wp-includes/blocks/preformatted/block.json new file mode 100644 index 0000000000000..c25b8ce37093a --- /dev/null +++ b/src/wp-includes/blocks/preformatted/block.json @@ -0,0 +1,61 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "core/preformatted", + "title": "Preformatted", + "category": "text", + "description": "Add text that respects your spacing and tabs, and also allows styling.", + "textdomain": "default", + "attributes": { + "content": { + "type": "rich-text", + "source": "rich-text", + "selector": "pre", + "__unstablePreserveWhiteSpace": true, + "role": "content" + } + }, + "supports": { + "anchor": true, + "color": { + "gradients": true, + "__experimentalDefaultControls": { + "background": true, + "text": true + } + }, + "spacing": { + "padding": true, + "margin": true + }, + "typography": { + "fontSize": true, + "lineHeight": true, + "__experimentalFontFamily": true, + "__experimentalFontWeight": true, + "__experimentalFontStyle": true, + "__experimentalTextTransform": true, + "__experimentalTextDecoration": true, + "__experimentalLetterSpacing": true, + "__experimentalDefaultControls": { + "fontSize": true + } + }, + "interactivity": { + "clientNavigation": true + }, + "__experimentalBorder": { + "radius": true, + "color": true, + "width": true, + "style": true, + "__experimentalDefaultControls": { + "radius": true, + "color": true, + "width": true, + "style": true + } + } + }, + "style": "wp-block-preformatted" +} diff --git a/src/wp-includes/blocks/pullquote/block.json b/src/wp-includes/blocks/pullquote/block.json new file mode 100644 index 0000000000000..271bba74d0252 --- /dev/null +++ b/src/wp-includes/blocks/pullquote/block.json @@ -0,0 +1,92 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "core/pullquote", + "title": "Pullquote", + "category": "text", + "description": "Give special visual emphasis to a quote from your text.", + "textdomain": "default", + "attributes": { + "value": { + "type": "rich-text", + "source": "rich-text", + "selector": "p", + "role": "content" + }, + "citation": { + "type": "rich-text", + "source": "rich-text", + "selector": "cite", + "role": "content" + }, + "textAlign": { + "type": "string" + } + }, + "supports": { + "anchor": true, + "align": [ "left", "right", "wide", "full" ], + "background": { + "backgroundImage": true, + "backgroundSize": true, + "__experimentalDefaultControls": { + "backgroundImage": true + } + }, + "color": { + "gradients": true, + "background": true, + "link": true, + "__experimentalDefaultControls": { + "background": true, + "text": true + } + }, + "dimensions": { + "minHeight": true, + "__experimentalDefaultControls": { + "minHeight": false + } + }, + "spacing": { + "margin": true, + "padding": true + }, + "typography": { + "fontSize": true, + "lineHeight": true, + "__experimentalFontFamily": true, + "__experimentalFontWeight": true, + "__experimentalFontStyle": true, + "__experimentalTextTransform": true, + "__experimentalTextDecoration": true, + "__experimentalLetterSpacing": true, + "__experimentalDefaultControls": { + "fontSize": true + } + }, + "__experimentalBorder": { + "color": true, + "radius": true, + "style": true, + "width": true, + "__experimentalDefaultControls": { + "color": true, + "radius": true, + "style": true, + "width": true + } + }, + "__experimentalStyle": { + "typography": { + "fontSize": "1.5em", + "lineHeight": "1.6" + } + }, + "interactivity": { + "clientNavigation": true + } + }, + "editorStyle": "wp-block-pullquote-editor", + "style": "wp-block-pullquote" +} diff --git a/src/wp-includes/blocks/query-no-results.php b/src/wp-includes/blocks/query-no-results.php new file mode 100644 index 0000000000000..34d6b321cbd6b --- /dev/null +++ b/src/wp-includes/blocks/query-no-results.php @@ -0,0 +1,65 @@ +context['queryId'] ) ? 'query-' . $block->context['queryId'] . '-page' : 'query-page'; + $page = empty( $_GET[ $page_key ] ) ? 1 : (int) $_GET[ $page_key ]; + + // Override the custom query with the global query if needed. + $use_global_query = ( isset( $block->context['query']['inherit'] ) && $block->context['query']['inherit'] ); + if ( $use_global_query ) { + global $wp_query; + $query = $wp_query; + } else { + $query_args = build_query_vars_from_query_block( $block, $page ); + $query = new WP_Query( $query_args ); + } + + if ( $query->post_count > 0 ) { + return ''; + } + + $classes = ( isset( $attributes['style']['elements']['link']['color']['text'] ) ) ? 'has-link-color' : ''; + $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $classes ) ); + return sprintf( + '
      %2$s
      ', + $wrapper_attributes, + $content + ); +} + +/** + * Registers the `core/query-no-results` block on the server. + * + * @since 6.0.0 + */ +function register_block_core_query_no_results() { + register_block_type_from_metadata( + __DIR__ . '/query-no-results', + array( + 'render_callback' => 'render_block_core_query_no_results', + ) + ); +} +add_action( 'init', 'register_block_core_query_no_results' ); diff --git a/src/wp-includes/blocks/query-no-results/block.json b/src/wp-includes/blocks/query-no-results/block.json new file mode 100644 index 0000000000000..3e6479a5aa20a --- /dev/null +++ b/src/wp-includes/blocks/query-no-results/block.json @@ -0,0 +1,37 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "core/query-no-results", + "title": "No Results", + "category": "theme", + "description": "Contains the block elements used to render content when no query results are found.", + "ancestor": [ "core/query" ], + "textdomain": "default", + "usesContext": [ "queryId", "query" ], + "supports": { + "anchor": true, + "align": true, + "reusable": false, + "html": false, + "color": { + "gradients": true, + "link": true + }, + "typography": { + "fontSize": true, + "lineHeight": true, + "__experimentalFontFamily": true, + "__experimentalFontWeight": true, + "__experimentalFontStyle": true, + "__experimentalTextTransform": true, + "__experimentalTextDecoration": true, + "__experimentalLetterSpacing": true, + "__experimentalDefaultControls": { + "fontSize": true + } + }, + "interactivity": { + "clientNavigation": true + } + } +} diff --git a/src/wp-includes/blocks/query-pagination-next.php b/src/wp-includes/blocks/query-pagination-next.php new file mode 100644 index 0000000000000..5854f4c4e08cc --- /dev/null +++ b/src/wp-includes/blocks/query-pagination-next.php @@ -0,0 +1,102 @@ +context['queryId'] ) ? 'query-' . $block->context['queryId'] . '-page' : 'query-page'; + $enhanced_pagination = (bool) ( $block->context['enhancedPagination'] ?? false ); + $page = empty( $_GET[ $page_key ] ) ? 1 : (int) $_GET[ $page_key ]; + $max_page = (int) ( $block->context['query']['pages'] ?? 0 ); + + $wrapper_attributes = get_block_wrapper_attributes(); + $show_label = (bool) ( $block->context['showLabel'] ?? true ); + $default_label = __( 'Next Page' ); + $label_text = isset( $attributes['label'] ) && ! empty( $attributes['label'] ) ? esc_html( $attributes['label'] ) : $default_label; + $label = $show_label ? $label_text : ''; + $pagination_arrow = get_query_pagination_arrow( $block, true ); + + if ( ! $label ) { + $wrapper_attributes .= ' aria-label="' . $label_text . '"'; + } + if ( $pagination_arrow ) { + $label .= $pagination_arrow; + } + $content = ''; + + // Check if the pagination is for Query that inherits the global context. + if ( isset( $block->context['query']['inherit'] ) && $block->context['query']['inherit'] ) { + $filter_link_attributes = static function () use ( $wrapper_attributes ) { + return $wrapper_attributes; + }; + add_filter( 'next_posts_link_attributes', $filter_link_attributes ); + // Take into account if we have set a bigger `max page` + // than what the query has. + global $wp_query; + if ( $max_page > $wp_query->max_num_pages ) { + $max_page = $wp_query->max_num_pages; + } + $content = get_next_posts_link( $label, $max_page ); + remove_filter( 'next_posts_link_attributes', $filter_link_attributes ); + } elseif ( ! $max_page || $max_page > $page ) { + $custom_query = new WP_Query( build_query_vars_from_query_block( $block, $page ) ); + $custom_query_max_pages = (int) $custom_query->max_num_pages; + if ( $custom_query_max_pages && $custom_query_max_pages !== $page ) { + $content = sprintf( + '%3$s', + esc_url( add_query_arg( $page_key, $page + 1 ) ), + $wrapper_attributes, + $label + ); + } + wp_reset_postdata(); // Restore original Post Data. + } + + if ( $enhanced_pagination && isset( $content ) ) { + $p = new WP_HTML_Tag_Processor( $content ); + if ( $p->next_tag( + array( + 'tag_name' => 'a', + 'class_name' => 'wp-block-query-pagination-next', + ) + ) ) { + $p->set_attribute( 'data-wp-key', 'query-pagination-next' ); + $p->set_attribute( 'data-wp-on--click', 'core/query::actions.navigate' ); + $p->set_attribute( 'data-wp-on--mouseenter', 'core/query::actions.prefetch' ); + $p->set_attribute( 'data-wp-watch', 'core/query::callbacks.prefetch' ); + $content = $p->get_updated_html(); + } + } + + return $content; +} + +/** + * Registers the `core/query-pagination-next` block on the server. + * + * @since 5.8.0 + */ +function register_block_core_query_pagination_next() { + register_block_type_from_metadata( + __DIR__ . '/query-pagination-next', + array( + 'render_callback' => 'render_block_core_query_pagination_next', + ) + ); +} +add_action( 'init', 'register_block_core_query_pagination_next' ); diff --git a/src/wp-includes/blocks/query-pagination-next/block.json b/src/wp-includes/blocks/query-pagination-next/block.json new file mode 100644 index 0000000000000..86acaa7462d32 --- /dev/null +++ b/src/wp-includes/blocks/query-pagination-next/block.json @@ -0,0 +1,50 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "core/query-pagination-next", + "title": "Next Page", + "category": "theme", + "parent": [ "core/query-pagination" ], + "description": "Displays the next posts page link.", + "textdomain": "default", + "attributes": { + "label": { + "type": "string" + } + }, + "usesContext": [ + "queryId", + "query", + "paginationArrow", + "showLabel", + "enhancedPagination" + ], + "supports": { + "anchor": true, + "reusable": false, + "html": false, + "color": { + "gradients": true, + "text": false, + "__experimentalDefaultControls": { + "background": true + } + }, + "typography": { + "fontSize": true, + "lineHeight": true, + "__experimentalFontFamily": true, + "__experimentalFontWeight": true, + "__experimentalFontStyle": true, + "__experimentalTextTransform": true, + "__experimentalTextDecoration": true, + "__experimentalLetterSpacing": true, + "__experimentalDefaultControls": { + "fontSize": true + } + }, + "interactivity": { + "clientNavigation": true + } + } +} diff --git a/src/wp-includes/blocks/query-pagination-numbers.php b/src/wp-includes/blocks/query-pagination-numbers.php new file mode 100644 index 0000000000000..35016fb169c6d --- /dev/null +++ b/src/wp-includes/blocks/query-pagination-numbers.php @@ -0,0 +1,133 @@ +context['queryId'] ) ? 'query-' . $block->context['queryId'] . '-page' : 'query-page'; + $enhanced_pagination = (bool) ( $block->context['enhancedPagination'] ?? false ); + $page = empty( $_GET[ $page_key ] ) ? 1 : (int) $_GET[ $page_key ]; + $max_page = (int) ( $block->context['query']['pages'] ?? 0 ); + + $wrapper_attributes = get_block_wrapper_attributes(); + $content = ''; + global $wp_query; + $mid_size = isset( $block->attributes['midSize'] ) ? (int) $block->attributes['midSize'] : null; + if ( isset( $block->context['query']['inherit'] ) && $block->context['query']['inherit'] ) { + // Take into account if we have set a bigger `max page` + // than what the query has. + $total = ! $max_page || $max_page > $wp_query->max_num_pages ? $wp_query->max_num_pages : $max_page; + $paginate_args = array( + 'prev_next' => false, + 'total' => $total, + ); + if ( null !== $mid_size ) { + $paginate_args['mid_size'] = $mid_size; + } + $content = paginate_links( $paginate_args ); + } else { + $block_query = new WP_Query( build_query_vars_from_query_block( $block, $page ) ); + // `paginate_links` works with the global $wp_query, so we have to + // temporarily switch it with our custom query. + $prev_wp_query = $wp_query; + $wp_query = $block_query; + $total = ! $max_page || $max_page > $wp_query->max_num_pages ? $wp_query->max_num_pages : $max_page; + $paginate_args = array( + 'base' => '%_%', + 'format' => "?$page_key=%#%", + 'current' => max( 1, $page ), + 'total' => $total, + 'prev_next' => false, + ); + if ( null !== $mid_size ) { + $paginate_args['mid_size'] = $mid_size; + } + if ( 1 !== $page ) { + /** + * `paginate_links` doesn't use the provided `format` when the page is `1`. + * This is great for the main query as it removes the extra query params + * making the URL shorter, but in the case of multiple custom queries is + * problematic. It results in returning an empty link which ends up with + * a link to the current page. + * + * A way to address this is to add a `fake` query arg with no value that + * is the same for all custom queries. This way the link is not empty and + * preserves all the other existent query args. + * + * @see https://developer.wordpress.org/reference/functions/paginate_links/ + * + * The proper fix of this should be in core. Track Ticket: + * @see https://core.trac.wordpress.org/ticket/53868 + * + * TODO: After two WP versions (starting from the WP version the core patch landed), + * we should remove this and call `paginate_links` with the proper new arg. + */ + $paginate_args['add_args'] = array( 'cst' => '' ); + } + // We still need to preserve `paged` query param if exists, as is used + // for Queries that inherit from global context. + $paged = empty( $_GET['paged'] ) ? null : (int) $_GET['paged']; + if ( $paged ) { + $paginate_args['add_args'] = array( 'paged' => $paged ); + } + $content = paginate_links( $paginate_args ); + wp_reset_postdata(); // Restore original Post Data. + $wp_query = $prev_wp_query; + } + + if ( empty( $content ) ) { + return ''; + } + + if ( $enhanced_pagination ) { + $p = new WP_HTML_Tag_Processor( $content ); + $tag_index = 0; + while ( $p->next_tag( + array( 'class_name' => 'page-numbers' ) + ) ) { + if ( null === $p->get_attribute( 'data-wp-key' ) ) { + $p->set_attribute( 'data-wp-key', 'index-' . $tag_index++ ); + } + if ( 'A' === $p->get_tag() ) { + $p->set_attribute( 'data-wp-on--click', 'core/query::actions.navigate' ); + } + } + $content = $p->get_updated_html(); + } + + return sprintf( + '
      %2$s
      ', + $wrapper_attributes, + $content + ); +} + +/** + * Registers the `core/query-pagination-numbers` block on the server. + * + * @since 5.8.0 + */ +function register_block_core_query_pagination_numbers() { + register_block_type_from_metadata( + __DIR__ . '/query-pagination-numbers', + array( + 'render_callback' => 'render_block_core_query_pagination_numbers', + ) + ); +} +add_action( 'init', 'register_block_core_query_pagination_numbers' ); diff --git a/src/wp-includes/blocks/query-pagination-numbers/block.json b/src/wp-includes/blocks/query-pagination-numbers/block.json new file mode 100644 index 0000000000000..75b2e4476accb --- /dev/null +++ b/src/wp-includes/blocks/query-pagination-numbers/block.json @@ -0,0 +1,46 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "core/query-pagination-numbers", + "title": "Page Numbers", + "category": "theme", + "parent": [ "core/query-pagination" ], + "description": "Displays a list of page numbers for pagination.", + "textdomain": "default", + "attributes": { + "midSize": { + "type": "number", + "default": 2 + } + }, + "usesContext": [ "queryId", "query", "enhancedPagination" ], + "supports": { + "anchor": true, + "reusable": false, + "html": false, + "color": { + "gradients": true, + "text": false, + "__experimentalDefaultControls": { + "background": true + } + }, + "typography": { + "fontSize": true, + "lineHeight": true, + "__experimentalFontFamily": true, + "__experimentalFontWeight": true, + "__experimentalFontStyle": true, + "__experimentalTextTransform": true, + "__experimentalTextDecoration": true, + "__experimentalLetterSpacing": true, + "__experimentalDefaultControls": { + "fontSize": true + } + }, + "interactivity": { + "clientNavigation": true + } + }, + "editorStyle": "wp-block-query-pagination-numbers-editor" +} diff --git a/src/wp-includes/blocks/query-pagination-previous.php b/src/wp-includes/blocks/query-pagination-previous.php new file mode 100644 index 0000000000000..5fc53e7c3c5c7 --- /dev/null +++ b/src/wp-includes/blocks/query-pagination-previous.php @@ -0,0 +1,95 @@ +context['queryId'] ) ? 'query-' . $block->context['queryId'] . '-page' : 'query-page'; + $enhanced_pagination = (bool) ( $block->context['enhancedPagination'] ?? false ); + $max_page = (int) ( $block->context['query']['pages'] ?? 0 ); + $page = empty( $_GET[ $page_key ] ) ? 1 : (int) $_GET[ $page_key ]; + $wrapper_attributes = get_block_wrapper_attributes(); + $show_label = (bool) ( $block->context['showLabel'] ?? true ); + $default_label = __( 'Previous Page' ); + $label_text = isset( $attributes['label'] ) && ! empty( $attributes['label'] ) ? esc_html( $attributes['label'] ) : $default_label; + $label = $show_label ? $label_text : ''; + $pagination_arrow = get_query_pagination_arrow( $block, false ); + if ( ! $label ) { + $wrapper_attributes .= ' aria-label="' . $label_text . '"'; + } + if ( $pagination_arrow ) { + $label = $pagination_arrow . $label; + } + $content = ''; + // Check if the pagination is for Query that inherits the global context + // and handle appropriately. + if ( isset( $block->context['query']['inherit'] ) && $block->context['query']['inherit'] ) { + $filter_link_attributes = static function () use ( $wrapper_attributes ) { + return $wrapper_attributes; + }; + + add_filter( 'previous_posts_link_attributes', $filter_link_attributes ); + $content = get_previous_posts_link( $label ); + remove_filter( 'previous_posts_link_attributes', $filter_link_attributes ); + } else { + $block_query = new WP_Query( build_query_vars_from_query_block( $block, $page ) ); + $block_max_pages = $block_query->max_num_pages; + $total = ! $max_page || $max_page > $block_max_pages ? $block_max_pages : $max_page; + wp_reset_postdata(); + + if ( 1 < $page && $page <= $total ) { + $content = sprintf( + '%3$s', + esc_url( add_query_arg( $page_key, $page - 1 ) ), + $wrapper_attributes, + $label + ); + } + } + + if ( $enhanced_pagination && isset( $content ) ) { + $p = new WP_HTML_Tag_Processor( $content ); + if ( $p->next_tag( + array( + 'tag_name' => 'a', + 'class_name' => 'wp-block-query-pagination-previous', + ) + ) ) { + $p->set_attribute( 'data-wp-key', 'query-pagination-previous' ); + $p->set_attribute( 'data-wp-on--click', 'core/query::actions.navigate' ); + $p->set_attribute( 'data-wp-on--mouseenter', 'core/query::actions.prefetch' ); + $p->set_attribute( 'data-wp-watch', 'core/query::callbacks.prefetch' ); + $content = $p->get_updated_html(); + } + } + + return $content; +} + +/** + * Registers the `core/query-pagination-previous` block on the server. + * + * @since 5.8.0 + */ +function register_block_core_query_pagination_previous() { + register_block_type_from_metadata( + __DIR__ . '/query-pagination-previous', + array( + 'render_callback' => 'render_block_core_query_pagination_previous', + ) + ); +} +add_action( 'init', 'register_block_core_query_pagination_previous' ); diff --git a/src/wp-includes/blocks/query-pagination-previous/block.json b/src/wp-includes/blocks/query-pagination-previous/block.json new file mode 100644 index 0000000000000..f13c9d4704cf1 --- /dev/null +++ b/src/wp-includes/blocks/query-pagination-previous/block.json @@ -0,0 +1,50 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "core/query-pagination-previous", + "title": "Previous Page", + "category": "theme", + "parent": [ "core/query-pagination" ], + "description": "Displays the previous posts page link.", + "textdomain": "default", + "attributes": { + "label": { + "type": "string" + } + }, + "usesContext": [ + "queryId", + "query", + "paginationArrow", + "showLabel", + "enhancedPagination" + ], + "supports": { + "anchor": true, + "reusable": false, + "html": false, + "color": { + "gradients": true, + "text": false, + "__experimentalDefaultControls": { + "background": true + } + }, + "typography": { + "fontSize": true, + "lineHeight": true, + "__experimentalFontFamily": true, + "__experimentalFontWeight": true, + "__experimentalFontStyle": true, + "__experimentalTextTransform": true, + "__experimentalTextDecoration": true, + "__experimentalLetterSpacing": true, + "__experimentalDefaultControls": { + "fontSize": true + } + }, + "interactivity": { + "clientNavigation": true + } + } +} diff --git a/src/wp-includes/blocks/query-pagination.php b/src/wp-includes/blocks/query-pagination.php new file mode 100644 index 0000000000000..acafe968c0bec --- /dev/null +++ b/src/wp-includes/blocks/query-pagination.php @@ -0,0 +1,51 @@ + __( 'Pagination' ), + 'class' => $classes, + ) + ); + + return sprintf( + '', + $wrapper_attributes, + $content + ); +} + +/** + * Registers the `core/query-pagination` block on the server. + * + * @since 5.8.0 + */ +function register_block_core_query_pagination() { + register_block_type_from_metadata( + __DIR__ . '/query-pagination', + array( + 'render_callback' => 'render_block_core_query_pagination', + ) + ); +} +add_action( 'init', 'register_block_core_query_pagination' ); diff --git a/src/wp-includes/blocks/query-pagination/block.json b/src/wp-includes/blocks/query-pagination/block.json new file mode 100644 index 0000000000000..c5e8cde66e7bc --- /dev/null +++ b/src/wp-includes/blocks/query-pagination/block.json @@ -0,0 +1,70 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "core/query-pagination", + "title": "Pagination", + "category": "theme", + "ancestor": [ "core/query" ], + "allowedBlocks": [ + "core/query-pagination-previous", + "core/query-pagination-numbers", + "core/query-pagination-next" + ], + "description": "Displays a paginated navigation to next/previous set of posts, when applicable.", + "textdomain": "default", + "attributes": { + "paginationArrow": { + "type": "string", + "default": "none" + }, + "showLabel": { + "type": "boolean", + "default": true + } + }, + "usesContext": [ "queryId", "query" ], + "providesContext": { + "paginationArrow": "paginationArrow", + "showLabel": "showLabel" + }, + "supports": { + "anchor": true, + "align": true, + "reusable": false, + "html": false, + "color": { + "gradients": true, + "link": true, + "__experimentalDefaultControls": { + "background": true, + "text": true, + "link": true + } + }, + "layout": { + "allowSwitching": false, + "allowInheriting": false, + "default": { + "type": "flex" + } + }, + "typography": { + "fontSize": true, + "lineHeight": true, + "__experimentalFontFamily": true, + "__experimentalFontWeight": true, + "__experimentalFontStyle": true, + "__experimentalTextTransform": true, + "__experimentalTextDecoration": true, + "__experimentalLetterSpacing": true, + "__experimentalDefaultControls": { + "fontSize": true + } + }, + "interactivity": { + "clientNavigation": true + } + }, + "editorStyle": "wp-block-query-pagination-editor", + "style": "wp-block-query-pagination" +} diff --git a/src/wp-includes/blocks/query-title.php b/src/wp-includes/blocks/query-title.php new file mode 100644 index 0000000000000..d26a3d08ae42a --- /dev/null +++ b/src/wp-includes/blocks/query-title.php @@ -0,0 +1,103 @@ +context['query']['postType'] ?? get_post_type(); + + if ( ! $type || + ( 'archive' === $type && ! $is_archive ) || + ( 'search' === $type && ! $is_search ) || + ( 'post-type' === $type && ! $post_type ) + ) { + return ''; + } + $title = ''; + if ( $is_archive ) { + $show_prefix = $attributes['showPrefix'] ?? true; + if ( ! $show_prefix ) { + add_filter( 'get_the_archive_title_prefix', '__return_empty_string', 1 ); + $title = get_the_archive_title(); + remove_filter( 'get_the_archive_title_prefix', '__return_empty_string', 1 ); + } else { + $title = get_the_archive_title(); + } + } + if ( $is_search ) { + $title = __( 'Search results' ); + + if ( isset( $attributes['showSearchTerm'] ) && $attributes['showSearchTerm'] ) { + $title = sprintf( + /* translators: %s is the search term. */ + __( 'Search results for: “%s”' ), + get_search_query() + ); + } + } + if ( 'post-type' === $type ) { + $post_type_object = get_post_type_object( $post_type ); + + if ( ! $post_type_object ) { + return ''; + } + + $post_type_name = $post_type_object->labels->singular_name; + $show_prefix = $attributes['showPrefix'] ?? true; + + if ( $show_prefix ) { + $title = sprintf( + /* translators: %s is the post type name. */ + __( 'Post Type: “%s”' ), + $post_type_name + ); + } else { + $title = $post_type_name; + } + } + + $level = (int) ( $attributes['level'] ?? 1 ); + $tag_name = 0 === $level ? 'p' : 'h' . $level; + + $align_class_name = empty( $attributes['textAlign'] ) ? '' : "has-text-align-{$attributes['textAlign']}"; + $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $align_class_name ) ); + return sprintf( + '<%1$s %2$s>%3$s', + $tag_name, + $wrapper_attributes, + $title + ); +} + +/** + * Registers the `core/query-title` block on the server. + * + * @since 5.8.0 + */ +function register_block_core_query_title() { + register_block_type_from_metadata( + __DIR__ . '/query-title', + array( + 'render_callback' => 'render_block_core_query_title', + ) + ); +} +add_action( 'init', 'register_block_core_query_title' ); diff --git a/src/wp-includes/blocks/query-title/block.json b/src/wp-includes/blocks/query-title/block.json new file mode 100644 index 0000000000000..41e9e3fd29b62 --- /dev/null +++ b/src/wp-includes/blocks/query-title/block.json @@ -0,0 +1,83 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "core/query-title", + "title": "Query Title", + "category": "theme", + "description": "Display the query title.", + "textdomain": "default", + "attributes": { + "type": { + "type": "string" + }, + "textAlign": { + "type": "string" + }, + "level": { + "type": "number", + "default": 1 + }, + "levelOptions": { + "type": "array" + }, + "showPrefix": { + "type": "boolean", + "default": true + }, + "showSearchTerm": { + "type": "boolean", + "default": true + } + }, + "example": { + "attributes": { + "type": "search" + } + }, + "usesContext": [ "query" ], + "supports": { + "anchor": true, + "align": [ "wide", "full" ], + "html": false, + "color": { + "gradients": true, + "__experimentalDefaultControls": { + "background": true, + "text": true + } + }, + "spacing": { + "margin": true, + "padding": true + }, + "typography": { + "fontSize": true, + "lineHeight": true, + "__experimentalFontFamily": true, + "__experimentalFontStyle": true, + "__experimentalFontWeight": true, + "__experimentalLetterSpacing": true, + "__experimentalTextTransform": true, + "__experimentalTextDecoration": true, + "__experimentalDefaultControls": { + "fontSize": true + } + }, + "interactivity": { + "clientNavigation": true + }, + "__experimentalBorder": { + "radius": true, + "color": true, + "width": true, + "style": true, + "__experimentalDefaultControls": { + "radius": true, + "color": true, + "width": true, + "style": true + } + } + }, + "style": "wp-block-query-title" +} diff --git a/src/wp-includes/blocks/query-total.php b/src/wp-includes/blocks/query-total.php new file mode 100644 index 0000000000000..54da2ca5757ae --- /dev/null +++ b/src/wp-includes/blocks/query-total.php @@ -0,0 +1,90 @@ +context['query']['inherit'] ?? false ) { + $query_to_use = $wp_query; + $current_page = max( 1, (int) get_query_var( 'paged', 1 ) ); + } else { + $page_key = isset( $block->context['queryId'] ) ? 'query-' . $block->context['queryId'] . '-page' : 'query-page'; + $current_page = (int) ( $_GET[ $page_key ] ?? 1 ); + $query_to_use = new WP_Query( build_query_vars_from_query_block( $block, $current_page ) ); + } + + $max_rows = $query_to_use->found_posts; + $posts_per_page = (int) $query_to_use->get( 'posts_per_page' ); + + // Calculate the range of posts being displayed. + $start = ( 0 === $max_rows ) ? 0 : ( ( $current_page - 1 ) * $posts_per_page + 1 ); + $end = min( $start + $posts_per_page - 1, $max_rows ); + + // Prepare the display based on the `displayType` attribute. + $output = ''; + switch ( $attributes['displayType'] ) { + case 'range-display': + if ( $start === $end ) { + $output = sprintf( + /* translators: 1: Start index of posts, 2: Total number of posts */ + __( 'Displaying %1$s of %2$s' ), + $start, + $max_rows + ); + } else { + $output = sprintf( + /* translators: 1: Start index of posts, 2: End index of posts, 3: Total number of posts */ + __( 'Displaying %1$s – %2$s of %3$s' ), + $start, + $end, + $max_rows + ); + } + + break; + + case 'total-results': + default: + // translators: %d: number of results. + $output = sprintf( _n( '%d result found', '%d results found', $max_rows ), $max_rows ); + break; + } + + return sprintf( + '
      %2$s
      ', + $wrapper_attributes, + $output + ); +} + +/** + * Registers the `query-total` block. + * + * @since 6.8.0 + */ +function register_block_core_query_total() { + register_block_type_from_metadata( + __DIR__ . '/query-total', + array( + 'render_callback' => 'render_block_core_query_total', + ) + ); +} +add_action( 'init', 'register_block_core_query_total' ); diff --git a/src/wp-includes/blocks/query-total/block.json b/src/wp-includes/blocks/query-total/block.json new file mode 100644 index 0000000000000..9cd803a5665b9 --- /dev/null +++ b/src/wp-includes/blocks/query-total/block.json @@ -0,0 +1,62 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "core/query-total", + "title": "Query Total", + "category": "theme", + "ancestor": [ "core/query" ], + "description": "Display the total number of results in a query.", + "textdomain": "default", + "attributes": { + "displayType": { + "type": "string", + "default": "total-results" + } + }, + "usesContext": [ "queryId", "query" ], + "supports": { + "anchor": true, + "align": [ "wide", "full" ], + "html": false, + "spacing": { + "margin": true, + "padding": true + }, + "color": { + "gradients": true, + "__experimentalDefaultControls": { + "background": true, + "text": true + } + }, + "typography": { + "fontSize": true, + "lineHeight": true, + "__experimentalFontFamily": true, + "__experimentalFontWeight": true, + "__experimentalFontStyle": true, + "__experimentalTextTransform": true, + "__experimentalTextDecoration": true, + "__experimentalLetterSpacing": true, + "__experimentalDefaultControls": { + "fontSize": true + } + }, + "__experimentalBorder": { + "radius": true, + "color": true, + "width": true, + "style": true, + "__experimentalDefaultControls": { + "radius": true, + "color": true, + "width": true, + "style": true + } + }, + "interactivity": { + "clientNavigation": true + } + }, + "style": "wp-block-query-total" +} diff --git a/src/wp-includes/blocks/query.php b/src/wp-includes/blocks/query.php new file mode 100644 index 0000000000000..6b544cd99ae8c --- /dev/null +++ b/src/wp-includes/blocks/query.php @@ -0,0 +1,152 @@ +next_tag() ) { + // Add the necessary directives. + $p->set_attribute( 'data-wp-interactive', 'core/query' ); + $p->set_attribute( 'data-wp-router-region', 'query-' . $attributes['queryId'] ); + $p->set_attribute( 'data-wp-context', '{}' ); + $p->set_attribute( 'data-wp-key', $attributes['queryId'] ); + $content = $p->get_updated_html(); + } + } + + // Add the styles to the block type if the block is interactive and remove + // them if it's not. + $style_asset = 'wp-block-query'; + if ( ! wp_style_is( $style_asset ) ) { + $style_handles = $block->block_type->style_handles; + // If the styles are not needed, and they are still in the `style_handles`, remove them. + if ( ! $is_interactive && in_array( $style_asset, $style_handles, true ) ) { + $block->block_type->style_handles = array_diff( $style_handles, array( $style_asset ) ); + } + // If the styles are needed, but they were previously removed, add them again. + if ( $is_interactive && ! in_array( $style_asset, $style_handles, true ) ) { + $block->block_type->style_handles = array_merge( $style_handles, array( $style_asset ) ); + } + } + + return $content; +} + +/** + * Registers the `core/query` block on the server. + * + * @since 5.8.0 + */ +function register_block_core_query() { + register_block_type_from_metadata( + __DIR__ . '/query', + array( + 'render_callback' => 'render_block_core_query', + ) + ); +} +add_action( 'init', 'register_block_core_query' ); + +/** + * Traverse the tree of blocks looking for any plugin block (i.e., a block from + * an installed plugin) inside a Query block with the enhanced pagination + * enabled. If at least one is found, the enhanced pagination is effectively + * disabled to prevent any potential incompatibilities. + * + * @since 6.4.0 + * + * @param array $parsed_block The block being rendered. + * @return array Returns the parsed block, unmodified. + */ +function block_core_query_disable_enhanced_pagination( $parsed_block ) { + static $enhanced_query_stack = array(); + static $dirty_enhanced_queries = array(); + static $render_query_callback = null; + + $block_name = $parsed_block['blockName']; + $block_type = WP_Block_Type_Registry::get_instance()->get_registered( $block_name ); + $has_enhanced_pagination = isset( $parsed_block['attrs']['enhancedPagination'] ) && true === $parsed_block['attrs']['enhancedPagination'] && isset( $parsed_block['attrs']['queryId'] ); + /* + * Client side navigation can be true in two states: + * - supports.interactivity = true; + * - supports.interactivity.clientNavigation = true; + */ + $supports_client_navigation = ( isset( $block_type->supports['interactivity']['clientNavigation'] ) && true === $block_type->supports['interactivity']['clientNavigation'] ) + || ( isset( $block_type->supports['interactivity'] ) && true === $block_type->supports['interactivity'] ); + + if ( 'core/query' === $block_name && $has_enhanced_pagination ) { + $enhanced_query_stack[] = $parsed_block['attrs']['queryId']; + + if ( ! isset( $render_query_callback ) ) { + /** + * Filter that disables the enhanced pagination feature during block + * rendering when a plugin block has been found inside. It does so + * by adding an attribute called `data-wp-navigation-disabled` which + * is later handled by the front-end logic. + * + * @param string $content The block content. + * @param array $block The full block, including name and attributes. + * @return string Returns the modified output of the query block. + */ + $render_query_callback = static function ( $content, $block ) use ( &$enhanced_query_stack, &$dirty_enhanced_queries, &$render_query_callback ) { + $has_enhanced_pagination = isset( $block['attrs']['enhancedPagination'] ) && true === $block['attrs']['enhancedPagination'] && isset( $block['attrs']['queryId'] ); + + if ( ! $has_enhanced_pagination ) { + return $content; + } + + if ( isset( $dirty_enhanced_queries[ $block['attrs']['queryId'] ] ) ) { + // Disable navigation in the router store config. + wp_interactivity_config( 'core/router', array( 'clientNavigationDisabled' => true ) ); + $dirty_enhanced_queries[ $block['attrs']['queryId'] ] = null; + } + + array_pop( $enhanced_query_stack ); + + if ( empty( $enhanced_query_stack ) ) { + remove_filter( 'render_block_core/query', $render_query_callback ); + $render_query_callback = null; + } + + return $content; + }; + + add_filter( 'render_block_core/query', $render_query_callback, 10, 2 ); + } + } elseif ( + ! empty( $enhanced_query_stack ) && + isset( $block_name ) && + ( ! $supports_client_navigation ) + ) { + foreach ( $enhanced_query_stack as $query_id ) { + $dirty_enhanced_queries[ $query_id ] = true; + } + } + + return $parsed_block; +} + +add_filter( 'render_block_data', 'block_core_query_disable_enhanced_pagination', 10, 1 ); diff --git a/src/wp-includes/blocks/query/block.json b/src/wp-includes/blocks/query/block.json new file mode 100644 index 0000000000000..c2d8abc1a9334 --- /dev/null +++ b/src/wp-includes/blocks/query/block.json @@ -0,0 +1,60 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "core/query", + "title": "Query Loop", + "category": "theme", + "description": "An advanced block that allows displaying post types based on different query parameters and visual configurations.", + "keywords": [ "posts", "list", "blog", "blogs", "custom post types" ], + "textdomain": "default", + "attributes": { + "queryId": { + "type": "number" + }, + "query": { + "type": "object", + "default": { + "perPage": null, + "pages": 0, + "offset": 0, + "postType": "post", + "order": "desc", + "orderBy": "date", + "author": "", + "search": "", + "exclude": [], + "sticky": "", + "inherit": true, + "taxQuery": null, + "parents": [], + "format": [] + } + }, + "tagName": { + "type": "string", + "default": "div" + }, + "namespace": { + "type": "string" + }, + "enhancedPagination": { + "type": "boolean", + "default": false + } + }, + "usesContext": [ "templateSlug" ], + "providesContext": { + "queryId": "queryId", + "query": "query", + "displayLayout": "displayLayout", + "enhancedPagination": "enhancedPagination" + }, + "supports": { + "anchor": true, + "align": [ "wide", "full" ], + "html": false, + "layout": true, + "interactivity": true + }, + "editorStyle": "wp-block-query-editor" +} diff --git a/src/wp-includes/blocks/quote/block.json b/src/wp-includes/blocks/quote/block.json new file mode 100644 index 0000000000000..52609ee57d12a --- /dev/null +++ b/src/wp-includes/blocks/quote/block.json @@ -0,0 +1,105 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "core/quote", + "title": "Quote", + "category": "text", + "description": "Give quoted text visual emphasis. \"In quoting others, we cite ourselves.\" — Julio Cortázar", + "keywords": [ "blockquote", "cite" ], + "textdomain": "default", + "attributes": { + "value": { + "type": "string", + "source": "html", + "selector": "blockquote", + "multiline": "p", + "default": "", + "role": "content" + }, + "citation": { + "type": "rich-text", + "source": "rich-text", + "selector": "cite", + "role": "content" + }, + "textAlign": { + "type": "string" + } + }, + "supports": { + "anchor": true, + "align": [ "left", "right", "wide", "full" ], + "html": false, + "background": { + "backgroundImage": true, + "backgroundSize": true, + "__experimentalDefaultControls": { + "backgroundImage": true + } + }, + "__experimentalBorder": { + "color": true, + "radius": true, + "style": true, + "width": true, + "__experimentalDefaultControls": { + "color": true, + "radius": true, + "style": true, + "width": true + } + }, + "dimensions": { + "minHeight": true, + "__experimentalDefaultControls": { + "minHeight": false + } + }, + "__experimentalOnEnter": true, + "__experimentalOnMerge": true, + "typography": { + "fontSize": true, + "lineHeight": true, + "__experimentalFontFamily": true, + "__experimentalFontWeight": true, + "__experimentalFontStyle": true, + "__experimentalTextTransform": true, + "__experimentalTextDecoration": true, + "__experimentalLetterSpacing": true, + "__experimentalDefaultControls": { + "fontSize": true + } + }, + "color": { + "gradients": true, + "heading": true, + "link": true, + "__experimentalDefaultControls": { + "background": true, + "text": true + } + }, + "layout": { + "allowEditing": false + }, + "spacing": { + "blockGap": true, + "padding": true, + "margin": true + }, + "interactivity": { + "clientNavigation": true + }, + "allowedBlocks": true + }, + "styles": [ + { + "name": "default", + "label": "Default", + "isDefault": true + }, + { "name": "plain", "label": "Plain" } + ], + "editorStyle": "wp-block-quote-editor", + "style": "wp-block-quote" +} diff --git a/src/wp-includes/blocks/read-more.php b/src/wp-includes/blocks/read-more.php new file mode 100644 index 0000000000000..c01a0a377fc93 --- /dev/null +++ b/src/wp-includes/blocks/read-more.php @@ -0,0 +1,63 @@ +context['postId'] ) ) { + return ''; + } + + $post_ID = $block->context['postId']; + $post_title = get_the_title( $post_ID ); + if ( '' === $post_title ) { + $post_title = sprintf( + /* translators: %s is post ID to describe the link for screen readers. */ + __( 'untitled post %s' ), + $post_ID + ); + } + $screen_reader_text = sprintf( + /* translators: %s is either the post title or post ID to describe the link for screen readers. */ + __( ': %s' ), + $post_title + ); + $justify_class_name = empty( $attributes['justifyContent'] ) ? '' : "is-justified-{$attributes['justifyContent']}"; + $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $justify_class_name ) ); + $more_text = ! empty( $attributes['content'] ) ? wp_kses_post( $attributes['content'] ) : __( 'Read more' ); + return sprintf( + '%4s%5s', + $wrapper_attributes, + get_the_permalink( $post_ID ), + esc_attr( $attributes['linkTarget'] ), + $more_text, + $screen_reader_text + ); +} + +/** + * Registers the `core/read-more` block on the server. + * + * @since 6.0.0 + */ +function register_block_core_read_more() { + register_block_type_from_metadata( + __DIR__ . '/read-more', + array( + 'render_callback' => 'render_block_core_read_more', + ) + ); +} +add_action( 'init', 'register_block_core_read_more' ); diff --git a/src/wp-includes/blocks/read-more/block.json b/src/wp-includes/blocks/read-more/block.json new file mode 100644 index 0000000000000..084d46fa6936b --- /dev/null +++ b/src/wp-includes/blocks/read-more/block.json @@ -0,0 +1,61 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "core/read-more", + "title": "Read More", + "category": "theme", + "description": "Displays the link of a post, page, or any other content-type.", + "textdomain": "default", + "attributes": { + "content": { + "type": "string", + "role": "content" + }, + "linkTarget": { + "type": "string", + "default": "_self" + } + }, + "usesContext": [ "postId" ], + "supports": { + "anchor": true, + "html": false, + "color": { + "gradients": true, + "text": true + }, + "typography": { + "fontSize": true, + "lineHeight": true, + "__experimentalFontFamily": true, + "__experimentalFontWeight": true, + "__experimentalFontStyle": true, + "__experimentalTextTransform": true, + "__experimentalLetterSpacing": true, + "__experimentalTextDecoration": true, + "__experimentalDefaultControls": { + "fontSize": true, + "textDecoration": true + } + }, + "spacing": { + "margin": [ "top", "bottom" ], + "padding": true, + "__experimentalDefaultControls": { + "padding": true + } + }, + "__experimentalBorder": { + "color": true, + "radius": true, + "width": true, + "__experimentalDefaultControls": { + "width": true + } + }, + "interactivity": { + "clientNavigation": true + } + }, + "style": "wp-block-read-more" +} diff --git a/src/wp-includes/blocks/require-dynamic-blocks.php b/src/wp-includes/blocks/require-dynamic-blocks.php new file mode 100644 index 0000000000000..8da988339f172 --- /dev/null +++ b/src/wp-includes/blocks/require-dynamic-blocks.php @@ -0,0 +1,84 @@ +
      ' . __( 'Adding an RSS feed to this site’s homepage is not supported, as it could lead to a loop that slows down your site. Try using another block, like the Latest Posts block, to list posts from the site.' ) . '
      '; + } + + $rss = fetch_feed( $attributes['feedURL'] ); + + if ( is_wp_error( $rss ) ) { + return '
      ' . __( 'RSS Error:' ) . ' ' . esc_html( $rss->get_error_message() ) . '
      '; + } + + if ( ! $rss->get_item_quantity() ) { + return '
      ' . __( 'An error has occurred, which probably means the feed is down. Try again later.' ) . '
      '; + } + + $rss_items = $rss->get_items( 0, $attributes['itemsToShow'] ); + $list_items = ''; + + $open_in_new_tab = ! empty( $attributes['openInNewTab'] ); + $rel = ! empty( $attributes['rel'] ) ? trim( $attributes['rel'] ) : ''; + + $link_attributes = ''; + + if ( $open_in_new_tab ) { + $link_attributes .= ' target="_blank"'; + } + + if ( '' !== $rel ) { + $link_attributes .= ' rel="' . esc_attr( $rel ) . '"'; + } + + foreach ( $rss_items as $item ) { + $title = esc_html( trim( strip_tags( html_entity_decode( $item->get_title() ) ) ) ); + + if ( empty( $title ) ) { + $title = __( '(no title)' ); + } + $link = $item->get_link(); + $link = esc_url( $link ); + + if ( $link ) { + $title = "{$title}"; + } + $title = "
      {$title}
      "; + + $date_markup = ''; + if ( ! empty( $attributes['displayDate'] ) ) { + $timestamp = $item->get_date( 'U' ); + + if ( $timestamp ) { + $gmt_offset = get_option( 'gmt_offset' ); + $timestamp += (int) ( (float) $gmt_offset * HOUR_IN_SECONDS ); + + $date_markup = sprintf( + ' ', + esc_attr( date_i18n( 'c', $timestamp ) ), + esc_html( date_i18n( get_option( 'date_format' ), $timestamp ) ) + ); + } + } + + $author = ''; + if ( $attributes['displayAuthor'] ) { + $author = $item->get_author(); + if ( is_object( $author ) ) { + $author = $author->get_name(); + if ( ! empty( $author ) ) { + $author = '' . sprintf( + /* translators: byline. %s: author. */ + __( 'by %s' ), + esc_html( strip_tags( $author ) ) + ) . ''; + } + } + } + + $excerpt = ''; + $description = $item->get_description(); + if ( $attributes['displayExcerpt'] && ! empty( $description ) ) { + $excerpt = html_entity_decode( $description, ENT_QUOTES, get_option( 'blog_charset' ) ); + $excerpt = esc_attr( wp_trim_words( $excerpt, $attributes['excerptLength'], ' […]' ) ); + + // Change existing [...] to […]. + if ( '[...]' === substr( $excerpt, -5 ) ) { + $excerpt = substr( $excerpt, 0, -5 ) . '[…]'; + } + + $excerpt = '
      ' . esc_html( $excerpt ) . '
      '; + } + + $list_items .= "
    6. {$title}{$date_markup}{$author}{$excerpt}
    7. "; + } + + $classnames = array(); + if ( isset( $attributes['blockLayout'] ) && 'grid' === $attributes['blockLayout'] ) { + $classnames[] = 'is-grid'; + } + if ( isset( $attributes['columns'] ) && 'grid' === $attributes['blockLayout'] ) { + $classnames[] = 'columns-' . $attributes['columns']; + } + if ( $attributes['displayDate'] ) { + $classnames[] = 'has-dates'; + } + if ( $attributes['displayAuthor'] ) { + $classnames[] = 'has-authors'; + } + if ( $attributes['displayExcerpt'] ) { + $classnames[] = 'has-excerpts'; + } + + $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => implode( ' ', $classnames ) ) ); + + return sprintf( '
        %s
      ', $wrapper_attributes, $list_items ); +} + +/** + * Registers the `core/rss` block on server. + * + * @since 5.2.0 + */ +function register_block_core_rss() { + register_block_type_from_metadata( + __DIR__ . '/rss', + array( + 'render_callback' => 'render_block_core_rss', + ) + ); +} +add_action( 'init', 'register_block_core_rss' ); diff --git a/src/wp-includes/blocks/rss/block.json b/src/wp-includes/blocks/rss/block.json new file mode 100644 index 0000000000000..e16c0c62881c9 --- /dev/null +++ b/src/wp-includes/blocks/rss/block.json @@ -0,0 +1,82 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "core/rss", + "title": "RSS", + "category": "widgets", + "description": "Display entries from any RSS or Atom feed.", + "keywords": [ "atom", "feed" ], + "textdomain": "default", + "attributes": { + "columns": { + "type": "number", + "default": 2 + }, + "blockLayout": { + "type": "string", + "default": "list" + }, + "feedURL": { + "type": "string", + "default": "", + "role": "content" + }, + "itemsToShow": { + "type": "number", + "default": 5 + }, + "displayExcerpt": { + "type": "boolean", + "default": false + }, + "displayAuthor": { + "type": "boolean", + "default": false + }, + "displayDate": { + "type": "boolean", + "default": false + }, + "excerptLength": { + "type": "number", + "default": 55 + }, + "openInNewTab": { + "type": "boolean", + "default": false + }, + "rel": { + "type": "string" + } + }, + "supports": { + "anchor": true, + "align": true, + "html": false, + "interactivity": { + "clientNavigation": true + }, + "__experimentalBorder": { + "radius": true, + "color": true, + "width": true, + "style": true + }, + "spacing": { + "margin": true, + "padding": true, + "__experimentalDefaultControls": { + "padding": false, + "margin": false + } + }, + "color": { + "background": true, + "text": true, + "gradients": true, + "link": true + } + }, + "editorStyle": "wp-block-rss-editor", + "style": "wp-block-rss" +} diff --git a/src/wp-includes/blocks/search.php b/src/wp-includes/blocks/search.php new file mode 100644 index 0000000000000..7073d6ce8ab3f --- /dev/null +++ b/src/wp-includes/blocks/search.php @@ -0,0 +1,621 @@ +`. Support these by defaulting an undefined label and + // buttonText to `__( 'Search' )`. + $attributes = wp_parse_args( + $attributes, + array( + 'label' => __( 'Search' ), + 'buttonText' => __( 'Search' ), + ) + ); + + $input_id = wp_unique_id( 'wp-block-search__input-' ); + $classnames = classnames_for_block_core_search( $attributes ); + $show_label = ! empty( $attributes['showLabel'] ); + $use_icon_button = ! empty( $attributes['buttonUseIcon'] ); + $show_button = ( ! empty( $attributes['buttonPosition'] ) && 'no-button' === $attributes['buttonPosition'] ) ? false : true; + $button_position = $show_button ? $attributes['buttonPosition'] : null; + $query_params = ( ! empty( $attributes['query'] ) ) ? $attributes['query'] : array(); + $button = ''; + $query_params_markup = ''; + $inline_styles = styles_for_block_core_search( $attributes ); + $color_classes = get_color_classes_for_block_core_search( $attributes ); + $typography_classes = get_typography_classes_for_block_core_search( $attributes ); + $is_button_inside = ! empty( $attributes['buttonPosition'] ) && + 'button-inside' === $attributes['buttonPosition']; + // Border color classes need to be applied to the elements that have a border color. + $border_color_classes = get_border_color_classes_for_block_core_search( $attributes ); + // This variable is a constant and its value is always false at this moment. + // It is defined this way because some values depend on it, in case it changes in the future. + $open_by_default = false; + + $label_inner_html = empty( $attributes['label'] ) ? __( 'Search' ) : wp_kses_post( $attributes['label'] ); + $label = new WP_HTML_Tag_Processor( sprintf( '', $inline_styles['label'], $label_inner_html ) ); + if ( $label->next_tag() ) { + $label->set_attribute( 'for', $input_id ); + $label->add_class( 'wp-block-search__label' ); + if ( $show_label && ! empty( $attributes['label'] ) ) { + if ( ! empty( $typography_classes ) ) { + $label->add_class( $typography_classes ); + } + } else { + $label->add_class( 'screen-reader-text' ); + } + } + + $input = new WP_HTML_Tag_Processor( sprintf( '', $inline_styles['input'] ) ); + $input_classes = array( 'wp-block-search__input' ); + if ( ! $is_button_inside && ! empty( $border_color_classes ) ) { + $input_classes[] = $border_color_classes; + } + if ( ! empty( $typography_classes ) ) { + $input_classes[] = $typography_classes; + } + if ( $input->next_tag() ) { + $input->add_class( implode( ' ', $input_classes ) ); + $input->set_attribute( 'id', $input_id ); + $input->set_attribute( 'value', get_search_query() ); + $input->set_attribute( 'placeholder', $attributes['placeholder'] ); + + // If it's interactive, enqueue the script module and add the directives. + $is_expandable_searchfield = 'button-only' === $button_position; + if ( $is_expandable_searchfield ) { + wp_enqueue_script_module( '@wordpress/block-library/search/view' ); + + $input->set_attribute( 'data-wp-bind--aria-hidden', '!context.isSearchInputVisible' ); + $input->set_attribute( 'data-wp-bind--tabindex', 'state.tabindex' ); + + // Adding these attributes manually is needed until the Interactivity API + // SSR logic is added to core. + $input->set_attribute( 'aria-hidden', 'true' ); + $input->set_attribute( 'tabindex', '-1' ); + } + } + + if ( count( $query_params ) > 0 ) { + foreach ( $query_params as $param => $value ) { + $query_params_markup .= sprintf( + '', + esc_attr( $param ), + esc_attr( $value ) + ); + } + } + + if ( $show_button ) { + $button_classes = array( 'wp-block-search__button' ); + $button_internal_markup = ''; + if ( ! empty( $color_classes ) ) { + $button_classes[] = $color_classes; + } + if ( ! empty( $typography_classes ) ) { + $button_classes[] = $typography_classes; + } + + if ( ! $is_button_inside && ! empty( $border_color_classes ) ) { + $button_classes[] = $border_color_classes; + } + if ( ! $use_icon_button ) { + if ( ! empty( $attributes['buttonText'] ) ) { + $button_internal_markup = wp_kses_post( $attributes['buttonText'] ); + } + } else { + $button_classes[] = 'has-icon'; + $button_internal_markup = + ' + + '; + } + + // Include the button element class. + $button_classes[] = wp_theme_get_element_class_name( 'button' ); + $button = new WP_HTML_Tag_Processor( sprintf( '', $inline_styles['button'], $button_internal_markup ) ); + + if ( $button->next_tag() ) { + $button->add_class( implode( ' ', $button_classes ) ); + if ( 'button-only' === $attributes['buttonPosition'] ) { + $button->set_attribute( 'data-wp-bind--aria-label', 'state.ariaLabel' ); + $button->set_attribute( 'data-wp-bind--aria-controls', 'state.ariaControls' ); + $button->set_attribute( 'data-wp-bind--aria-expanded', 'context.isSearchInputVisible' ); + $button->set_attribute( 'data-wp-bind--type', 'state.type' ); + $button->set_attribute( 'data-wp-on--click', 'actions.openSearchInput' ); + + // Adding these attributes manually is needed until the Interactivity + // API SSR logic is added to core. + $button->set_attribute( 'aria-label', __( 'Expand search field' ) ); + $button->set_attribute( 'aria-controls', 'wp-block-search__input-' . $input_id ); + $button->set_attribute( 'aria-expanded', 'false' ); + $button->set_attribute( 'type', 'button' ); + } else { + $button->set_attribute( 'aria-label', wp_strip_all_tags( $attributes['buttonText'] ) ); + } + } + } + + $field_markup_classes = array( + 'wp-block-search__inside-wrapper', + ); + if ( $is_button_inside && ! empty( $border_color_classes ) ) { + $field_markup_classes[] = $border_color_classes; + } + $field_markup = sprintf( + '
      %s
      ', + esc_attr( implode( ' ', $field_markup_classes ) ), + $inline_styles['wrapper'], + $input . $query_params_markup . $button + ); + $wrapper_attributes = get_block_wrapper_attributes( + array( 'class' => $classnames ) + ); + $form_directives = ''; + + // If it's interactive, add the directives. + if ( $is_expandable_searchfield ) { + $aria_label_expanded = __( 'Submit Search' ); + $aria_label_collapsed = __( 'Expand search field' ); + $form_context = wp_interactivity_data_wp_context( + array( + 'isSearchInputVisible' => $open_by_default, + 'inputId' => $input_id, + 'ariaLabelExpanded' => $aria_label_expanded, + 'ariaLabelCollapsed' => $aria_label_collapsed, + ) + ); + $form_directives = ' + data-wp-interactive="core/search" + ' . $form_context . ' + data-wp-class--wp-block-search__searchfield-hidden="!context.isSearchInputVisible" + data-wp-on--keydown="actions.handleSearchKeydown" + data-wp-on--focusout="actions.handleSearchFocusout" + '; + } + + return sprintf( + '
      %4s
      ', + esc_url( home_url( '/' ) ), + $wrapper_attributes, + $form_directives, + $label . $field_markup + ); +} + +/** + * Registers the `core/search` block on the server. + * + * @since 5.2.0 + */ +function register_block_core_search() { + register_block_type_from_metadata( + __DIR__ . '/search', + array( + 'render_callback' => 'render_block_core_search', + ) + ); +} +add_action( 'init', 'register_block_core_search' ); + +/** + * Builds the correct top level classnames for the 'core/search' block. + * + * @since 5.6.0 + * + * @param array $attributes The block attributes. + * + * @return string The classnames used in the block. + */ +function classnames_for_block_core_search( $attributes ) { + $classnames = array(); + + if ( ! empty( $attributes['buttonPosition'] ) ) { + if ( 'button-inside' === $attributes['buttonPosition'] ) { + $classnames[] = 'wp-block-search__button-inside'; + } + + if ( 'button-outside' === $attributes['buttonPosition'] ) { + $classnames[] = 'wp-block-search__button-outside'; + } + + if ( 'no-button' === $attributes['buttonPosition'] ) { + $classnames[] = 'wp-block-search__no-button'; + } + + if ( 'button-only' === $attributes['buttonPosition'] ) { + $classnames[] = 'wp-block-search__button-only wp-block-search__searchfield-hidden'; + } + } + + if ( isset( $attributes['buttonUseIcon'] ) ) { + if ( ! empty( $attributes['buttonPosition'] ) && 'no-button' !== $attributes['buttonPosition'] ) { + if ( $attributes['buttonUseIcon'] ) { + $classnames[] = 'wp-block-search__icon-button'; + } else { + $classnames[] = 'wp-block-search__text-button'; + } + } + } + + return implode( ' ', $classnames ); +} + +/** + * This generates a CSS rule for the given border property and side if provided. + * Based on whether the Search block is configured to display the button inside + * or not, the generated rule is injected into the appropriate collection of + * styles for later application in the block's markup. + * + * @since 6.1.0 + * + * @param array $attributes The block attributes. + * @param string $property Border property to generate rule for e.g. width or color. + * @param string $side Optional side border. The dictates the value retrieved and final CSS property. + * @param array $wrapper_styles Current collection of wrapper styles. + * @param array $button_styles Current collection of button styles. + * @param array $input_styles Current collection of input styles. + */ +function apply_block_core_search_border_style( $attributes, $property, $side, &$wrapper_styles, &$button_styles, &$input_styles ) { + $is_button_inside = isset( $attributes['buttonPosition'] ) && 'button-inside' === $attributes['buttonPosition']; + + $path = array( 'style', 'border', $property ); + + if ( $side ) { + array_splice( $path, 2, 0, $side ); + } + + $value = _wp_array_get( $attributes, $path, false ); + + if ( empty( $value ) ) { + return; + } + + if ( 'color' === $property && $side ) { + $has_color_preset = str_contains( $value, 'var:preset|color|' ); + if ( $has_color_preset ) { + $named_color_value = substr( $value, strrpos( $value, '|' ) + 1 ); + $value = sprintf( 'var(--wp--preset--color--%s)', $named_color_value ); + } + } + + $property_suffix = $side ? sprintf( '%s-%s', $side, $property ) : $property; + + if ( $is_button_inside ) { + $wrapper_styles[] = sprintf( 'border-%s: %s;', $property_suffix, esc_attr( $value ) ); + } else { + $button_styles[] = sprintf( 'border-%s: %s;', $property_suffix, esc_attr( $value ) ); + $input_styles[] = sprintf( 'border-%s: %s;', $property_suffix, esc_attr( $value ) ); + } +} + +/** + * This adds CSS rules for a given border property e.g. width or color. It + * injects rules into the provided wrapper, button and input style arrays for + * uniform "flat" borders or those with individual sides configured. + * + * @since 6.1.0 + * + * @param array $attributes The block attributes. + * @param string $property Border property to generate rule for e.g. width or color. + * @param array $wrapper_styles Current collection of wrapper styles. + * @param array $button_styles Current collection of button styles. + * @param array $input_styles Current collection of input styles. + */ +function apply_block_core_search_border_styles( $attributes, $property, &$wrapper_styles, &$button_styles, &$input_styles ) { + apply_block_core_search_border_style( $attributes, $property, null, $wrapper_styles, $button_styles, $input_styles ); + apply_block_core_search_border_style( $attributes, $property, 'top', $wrapper_styles, $button_styles, $input_styles ); + apply_block_core_search_border_style( $attributes, $property, 'right', $wrapper_styles, $button_styles, $input_styles ); + apply_block_core_search_border_style( $attributes, $property, 'bottom', $wrapper_styles, $button_styles, $input_styles ); + apply_block_core_search_border_style( $attributes, $property, 'left', $wrapper_styles, $button_styles, $input_styles ); +} + +/** + * Builds an array of inline styles for the search block. + * + * The result will contain one entry for shared styles such as those for the + * inner input or button and a second for the inner wrapper should the block + * be positioning the button "inside". + * + * @since 5.8.0 + * + * @param array $attributes The block attributes. + * + * @return array Style HTML attribute. + */ +function styles_for_block_core_search( $attributes ) { + $wrapper_styles = array(); + $button_styles = array(); + $input_styles = array(); + $label_styles = array(); + $is_button_inside = ! empty( $attributes['buttonPosition'] ) && + 'button-inside' === $attributes['buttonPosition']; + $show_label = ( isset( $attributes['showLabel'] ) ) && false !== $attributes['showLabel']; + + // Add width styles. + $has_width = ! empty( $attributes['width'] ) && ! empty( $attributes['widthUnit'] ); + + if ( $has_width ) { + $wrapper_styles[] = sprintf( + 'width: %d%s;', + esc_attr( $attributes['width'] ), + esc_attr( $attributes['widthUnit'] ) + ); + } + + // Add border width and color styles. + apply_block_core_search_border_styles( $attributes, 'width', $wrapper_styles, $button_styles, $input_styles ); + apply_block_core_search_border_styles( $attributes, 'color', $wrapper_styles, $button_styles, $input_styles ); + apply_block_core_search_border_styles( $attributes, 'style', $wrapper_styles, $button_styles, $input_styles ); + + // Add border radius styles. + $has_border_radius = ! empty( $attributes['style']['border']['radius'] ); + + if ( $has_border_radius ) { + $default_padding = '4px'; + $border_radius = $attributes['style']['border']['radius']; + + if ( is_array( $border_radius ) ) { + // Apply styles for individual corner border radii. + foreach ( $border_radius as $key => $value ) { + // Get border-radius CSS variable from preset value if provided. + if ( is_string( $value ) && str_contains( $value, 'var:preset|border-radius|' ) ) { + $index_to_splice = strrpos( $value, '|' ) + 1; + $slug = _wp_to_kebab_case( substr( $value, $index_to_splice ) ); + $value = "var(--wp--preset--border-radius--$slug)"; + } + + if ( null !== $value ) { + // Convert camelCase key to kebab-case. + $name = strtolower( preg_replace( '/(? ! empty( $input_styles ) ? sprintf( ' style="%s"', esc_attr( safecss_filter_attr( implode( ' ', $input_styles ) ) ) ) : '', + 'button' => ! empty( $button_styles ) ? sprintf( ' style="%s"', esc_attr( safecss_filter_attr( implode( ' ', $button_styles ) ) ) ) : '', + 'wrapper' => ! empty( $wrapper_styles ) ? sprintf( ' style="%s"', esc_attr( safecss_filter_attr( implode( ' ', $wrapper_styles ) ) ) ) : '', + 'label' => ! empty( $label_styles ) ? sprintf( ' style="%s"', esc_attr( safecss_filter_attr( implode( ' ', $label_styles ) ) ) ) : '', + ); +} + +/** + * Returns typography classnames depending on whether there are named font sizes/families. + * + * @since 6.1.0 + * + * @param array $attributes The block attributes. + * + * @return string The typography color classnames to be applied to the block elements. + */ +function get_typography_classes_for_block_core_search( $attributes ) { + $typography_classes = array(); + $has_named_font_family = ! empty( $attributes['fontFamily'] ); + $has_named_font_size = ! empty( $attributes['fontSize'] ); + + if ( $has_named_font_size ) { + $typography_classes[] = sprintf( 'has-%s-font-size', esc_attr( $attributes['fontSize'] ) ); + } + + if ( $has_named_font_family ) { + $typography_classes[] = sprintf( 'has-%s-font-family', esc_attr( $attributes['fontFamily'] ) ); + } + + return implode( ' ', $typography_classes ); +} + +/** + * Returns typography styles to be included in an HTML style tag. + * This excludes text-decoration, which is applied only to the label and button elements of the search block. + * + * @since 6.1.0 + * + * @param array $attributes The block attributes. + * + * @return string A string of typography CSS declarations. + */ +function get_typography_styles_for_block_core_search( $attributes ) { + $typography_styles = array(); + + // Add typography styles. + if ( ! empty( $attributes['style']['typography']['fontSize'] ) ) { + $typography_styles[] = sprintf( + 'font-size: %s;', + wp_get_typography_font_size_value( + array( + 'size' => $attributes['style']['typography']['fontSize'], + ) + ) + ); + + } + + if ( ! empty( $attributes['style']['typography']['fontFamily'] ) ) { + $typography_styles[] = sprintf( 'font-family: %s;', $attributes['style']['typography']['fontFamily'] ); + } + + if ( ! empty( $attributes['style']['typography']['letterSpacing'] ) ) { + $typography_styles[] = sprintf( 'letter-spacing: %s;', $attributes['style']['typography']['letterSpacing'] ); + } + + if ( ! empty( $attributes['style']['typography']['fontWeight'] ) ) { + $typography_styles[] = sprintf( 'font-weight: %s;', $attributes['style']['typography']['fontWeight'] ); + } + + if ( ! empty( $attributes['style']['typography']['fontStyle'] ) ) { + $typography_styles[] = sprintf( 'font-style: %s;', $attributes['style']['typography']['fontStyle'] ); + } + + if ( ! empty( $attributes['style']['typography']['lineHeight'] ) ) { + $typography_styles[] = sprintf( 'line-height: %s;', $attributes['style']['typography']['lineHeight'] ); + } + + if ( ! empty( $attributes['style']['typography']['textTransform'] ) ) { + $typography_styles[] = sprintf( 'text-transform: %s;', $attributes['style']['typography']['textTransform'] ); + } + + return implode( '', $typography_styles ); +} + +/** + * Returns border color classnames depending on whether there are named or custom border colors. + * + * @since 5.9.0 + * + * @param array $attributes The block attributes. + * + * @return string The border color classnames to be applied to the block elements. + */ +function get_border_color_classes_for_block_core_search( $attributes ) { + $border_color_classes = array(); + $has_custom_border_color = ! empty( $attributes['style']['border']['color'] ); + $has_named_border_color = ! empty( $attributes['borderColor'] ); + + if ( $has_custom_border_color || $has_named_border_color ) { + $border_color_classes[] = 'has-border-color'; + } + + if ( $has_named_border_color ) { + $border_color_classes[] = sprintf( 'has-%s-border-color', esc_attr( $attributes['borderColor'] ) ); + } + + return implode( ' ', $border_color_classes ); +} + +/** + * Returns color classnames depending on whether there are named or custom text and background colors. + * + * @since 5.9.0 + * + * @param array $attributes The block attributes. + * + * @return string The color classnames to be applied to the block elements. + */ +function get_color_classes_for_block_core_search( $attributes ) { + $classnames = array(); + + // Text color. + $has_named_text_color = ! empty( $attributes['textColor'] ); + $has_custom_text_color = ! empty( $attributes['style']['color']['text'] ); + if ( $has_named_text_color ) { + $classnames[] = sprintf( 'has-text-color has-%s-color', $attributes['textColor'] ); + } elseif ( $has_custom_text_color ) { + // If a custom 'textColor' was selected instead of a preset, still add the generic `has-text-color` class. + $classnames[] = 'has-text-color'; + } + + // Background color. + $has_named_background_color = ! empty( $attributes['backgroundColor'] ); + $has_custom_background_color = ! empty( $attributes['style']['color']['background'] ); + $has_named_gradient = ! empty( $attributes['gradient'] ); + $has_custom_gradient = ! empty( $attributes['style']['color']['gradient'] ); + if ( + $has_named_background_color || + $has_custom_background_color || + $has_named_gradient || + $has_custom_gradient + ) { + $classnames[] = 'has-background'; + } + if ( $has_named_background_color ) { + $classnames[] = sprintf( 'has-%s-background-color', $attributes['backgroundColor'] ); + } + if ( $has_named_gradient ) { + $classnames[] = sprintf( 'has-%s-gradient-background', $attributes['gradient'] ); + } + + return implode( ' ', $classnames ); +} diff --git a/src/wp-includes/blocks/search/block.json b/src/wp-includes/blocks/search/block.json new file mode 100644 index 0000000000000..a6146d4404041 --- /dev/null +++ b/src/wp-includes/blocks/search/block.json @@ -0,0 +1,96 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "core/search", + "title": "Search", + "category": "widgets", + "description": "Help visitors find your content.", + "keywords": [ "find" ], + "textdomain": "default", + "attributes": { + "label": { + "type": "string", + "role": "content" + }, + "showLabel": { + "type": "boolean", + "default": true + }, + "placeholder": { + "type": "string", + "default": "", + "role": "content" + }, + "width": { + "type": "number" + }, + "widthUnit": { + "type": "string" + }, + "buttonText": { + "type": "string", + "role": "content" + }, + "buttonPosition": { + "type": "string", + "default": "button-outside" + }, + "buttonUseIcon": { + "type": "boolean", + "default": false + }, + "query": { + "type": "object", + "default": {} + }, + "isSearchFieldHidden": { + "type": "boolean", + "default": false + } + }, + "supports": { + "anchor": true, + "align": [ "left", "center", "right" ], + "color": { + "gradients": true, + "__experimentalSkipSerialization": true, + "__experimentalDefaultControls": { + "background": true, + "text": true + } + }, + "interactivity": true, + "typography": { + "__experimentalSkipSerialization": true, + "__experimentalSelector": ".wp-block-search__label, .wp-block-search__input, .wp-block-search__button", + "fontSize": true, + "lineHeight": true, + "__experimentalFontFamily": true, + "__experimentalFontWeight": true, + "__experimentalFontStyle": true, + "__experimentalTextTransform": true, + "__experimentalTextDecoration": true, + "__experimentalLetterSpacing": true, + "__experimentalDefaultControls": { + "fontSize": true + } + }, + "__experimentalBorder": { + "color": true, + "radius": true, + "width": true, + "__experimentalSkipSerialization": true, + "__experimentalDefaultControls": { + "color": true, + "radius": true, + "width": true + } + }, + "spacing": { + "margin": true + }, + "html": false + }, + "editorStyle": "wp-block-search-editor", + "style": "wp-block-search" +} diff --git a/src/wp-includes/blocks/separator/block.json b/src/wp-includes/blocks/separator/block.json new file mode 100644 index 0000000000000..926d978b7e4d5 --- /dev/null +++ b/src/wp-includes/blocks/separator/block.json @@ -0,0 +1,48 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "core/separator", + "title": "Separator", + "category": "design", + "description": "Create a break between ideas or sections with a horizontal separator.", + "keywords": [ "horizontal-line", "hr", "divider" ], + "textdomain": "default", + "attributes": { + "opacity": { + "type": "string", + "default": "alpha-channel" + }, + "tagName": { + "type": "string", + "enum": [ "hr", "div" ], + "default": "hr" + } + }, + "supports": { + "anchor": true, + "align": [ "center", "wide", "full" ], + "color": { + "enableContrastChecker": false, + "__experimentalSkipSerialization": true, + "gradients": true, + "background": true, + "text": false, + "__experimentalDefaultControls": { + "background": true + } + }, + "spacing": { + "margin": [ "top", "bottom" ] + }, + "interactivity": { + "clientNavigation": true + } + }, + "styles": [ + { "name": "default", "label": "Default", "isDefault": true }, + { "name": "wide", "label": "Wide Line" }, + { "name": "dots", "label": "Dots" } + ], + "editorStyle": "wp-block-separator-editor", + "style": "wp-block-separator" +} diff --git a/src/wp-includes/blocks/shortcode.php b/src/wp-includes/blocks/shortcode.php new file mode 100644 index 0000000000000..d96acfc55fa64 --- /dev/null +++ b/src/wp-includes/blocks/shortcode.php @@ -0,0 +1,35 @@ + 'render_block_core_shortcode', + ) + ); +} +add_action( 'init', 'register_block_core_shortcode' ); diff --git a/src/wp-includes/blocks/shortcode/block.json b/src/wp-includes/blocks/shortcode/block.json new file mode 100644 index 0000000000000..f97640bf8197d --- /dev/null +++ b/src/wp-includes/blocks/shortcode/block.json @@ -0,0 +1,23 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "core/shortcode", + "title": "Shortcode", + "category": "widgets", + "description": "Insert additional custom elements with a WordPress shortcode.", + "textdomain": "default", + "attributes": { + "text": { + "type": "string", + "source": "raw", + "role": "content" + } + }, + "supports": { + "className": false, + "customClassName": false, + "html": false, + "customCSS": false + }, + "editorStyle": "wp-block-shortcode-editor" +} diff --git a/src/wp-includes/blocks/site-logo.php b/src/wp-includes/blocks/site-logo.php new file mode 100644 index 0000000000000..915563461e30c --- /dev/null +++ b/src/wp-includes/blocks/site-logo.php @@ -0,0 +1,234 @@ +(.*?)#i', '\1', $custom_logo ); + } + + if ( $attributes['isLink'] && '_blank' === $attributes['linkTarget'] ) { + // Add the link target after the rel="home". + // Add an aria-label for informing that the page opens in a new tab. + $processor = new WP_HTML_Tag_Processor( $custom_logo ); + $processor->next_tag( 'a' ); + if ( 'home' === $processor->get_attribute( 'rel' ) ) { + $processor->set_attribute( 'aria-label', __( '(Home link, opens in a new tab)' ) ); + $processor->set_attribute( 'target', $attributes['linkTarget'] ); + } + $custom_logo = $processor->get_updated_html(); + } + + $classnames = array(); + if ( empty( $attributes['width'] ) ) { + $classnames[] = 'is-default-size'; + } + + $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => implode( ' ', $classnames ) ) ); + $html = sprintf( '
      %s
      ', $wrapper_attributes, $custom_logo ); + return $html; +} + +/** + * Register a core site setting for a site logo + * + * @since 5.8.0 + */ +function register_block_core_site_logo_setting() { + register_setting( + 'general', + 'site_logo', + array( + 'show_in_rest' => array( + 'name' => 'site_logo', + ), + 'type' => 'integer', + 'label' => __( 'Logo' ), + 'description' => __( 'Site logo.' ), + ) + ); +} + +add_action( 'rest_api_init', 'register_block_core_site_logo_setting', 10 ); + +/** + * Register a core site setting for a site icon + * + * @since 5.9.0 + */ +function register_block_core_site_icon_setting() { + register_setting( + 'general', + 'site_icon', + array( + 'show_in_rest' => true, + 'type' => 'integer', + 'label' => __( 'Icon' ), + 'description' => __( 'Site icon.' ), + ) + ); +} + +add_action( 'rest_api_init', 'register_block_core_site_icon_setting', 10 ); + +/** + * Registers the `core/site-logo` block on the server. + * + * @since 5.8.0 + */ +function register_block_core_site_logo() { + register_block_type_from_metadata( + __DIR__ . '/site-logo', + array( + 'render_callback' => 'render_block_core_site_logo', + ) + ); +} + +add_action( 'init', 'register_block_core_site_logo' ); + +/** + * Overrides the custom logo with a site logo, if the option is set. + * + * @since 5.8.0 + * + * @param string $custom_logo The custom logo set by a theme. + * + * @return string The site logo if set. + */ +function _override_custom_logo_theme_mod( $custom_logo ) { + $site_logo = get_option( 'site_logo' ); + return false === $site_logo ? $custom_logo : $site_logo; +} + +add_filter( 'theme_mod_custom_logo', '_override_custom_logo_theme_mod' ); + +/** + * Updates the site_logo option when the custom_logo theme-mod gets updated. + * + * @since 5.8.0 + * + * @param mixed $value Attachment ID of the custom logo or an empty value. + * @return mixed + */ +function _sync_custom_logo_to_site_logo( $value ) { + if ( empty( $value ) ) { + delete_option( 'site_logo' ); + } else { + update_option( 'site_logo', $value ); + } + + return $value; +} + +add_filter( 'pre_set_theme_mod_custom_logo', '_sync_custom_logo_to_site_logo' ); + +/** + * Deletes the site_logo when the custom_logo theme mod is removed. + * + * @since 5.8.0 + * + * @global array $_ignore_site_logo_changes + * + * @param array $old_value Previous theme mod settings. + * @param array $value Updated theme mod settings. + */ +function _delete_site_logo_on_remove_custom_logo( $old_value, $value ) { + global $_ignore_site_logo_changes; + + if ( $_ignore_site_logo_changes ) { + return; + } + + // If the custom_logo is being unset, it's being removed from theme mods. + if ( isset( $old_value['custom_logo'] ) && ! isset( $value['custom_logo'] ) ) { + delete_option( 'site_logo' ); + } +} + +/** + * Deletes the site logo when all theme mods are being removed. + * + * @since 5.8.0 + * + * @global array $_ignore_site_logo_changes + */ +function _delete_site_logo_on_remove_theme_mods() { + global $_ignore_site_logo_changes; + + if ( $_ignore_site_logo_changes ) { + return; + } + + if ( false !== get_theme_support( 'custom-logo' ) ) { + delete_option( 'site_logo' ); + } +} + +/** + * Hooks `_delete_site_logo_on_remove_custom_logo` in `update_option_theme_mods_$theme`. + * Hooks `_delete_site_logo_on_remove_theme_mods` in `delete_option_theme_mods_$theme`. + * + * Runs on `setup_theme` to account for dynamically-switched themes in the Customizer. + * + * @since 5.8.0 + */ +function _delete_site_logo_on_remove_custom_logo_on_setup_theme() { + $theme = get_option( 'stylesheet' ); + add_action( "update_option_theme_mods_$theme", '_delete_site_logo_on_remove_custom_logo', 10, 2 ); + add_action( "delete_option_theme_mods_$theme", '_delete_site_logo_on_remove_theme_mods' ); +} +add_action( 'setup_theme', '_delete_site_logo_on_remove_custom_logo_on_setup_theme', 11 ); + +/** + * Removes the custom_logo theme-mod when the site_logo option gets deleted. + * + * @since 5.9.0 + * + * @global array $_ignore_site_logo_changes + */ +function _delete_custom_logo_on_remove_site_logo() { + global $_ignore_site_logo_changes; + + // Prevent _delete_site_logo_on_remove_custom_logo and + // _delete_site_logo_on_remove_theme_mods from firing and causing an + // infinite loop. + $_ignore_site_logo_changes = true; + + // Remove the custom logo. + remove_theme_mod( 'custom_logo' ); + + $_ignore_site_logo_changes = false; +} +add_action( 'delete_option_site_logo', '_delete_custom_logo_on_remove_site_logo' ); diff --git a/src/wp-includes/blocks/site-logo/block.json b/src/wp-includes/blocks/site-logo/block.json new file mode 100644 index 0000000000000..e1cd662f60f3e --- /dev/null +++ b/src/wp-includes/blocks/site-logo/block.json @@ -0,0 +1,73 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "core/site-logo", + "title": "Site Logo", + "category": "theme", + "description": "Display an image to represent this site. Update this block and the changes apply everywhere.", + "textdomain": "default", + "attributes": { + "width": { + "type": "number" + }, + "isLink": { + "type": "boolean", + "default": true, + "role": "content" + }, + "linkTarget": { + "type": "string", + "default": "_self", + "role": "content" + }, + "shouldSyncIcon": { + "type": "boolean" + } + }, + "example": { + "viewportWidth": 500, + "attributes": { + "width": 350, + "className": "block-editor-block-types-list__site-logo-example" + } + }, + "supports": { + "anchor": true, + "html": false, + "align": true, + "alignWide": false, + "color": { + "text": false, + "background": false + }, + "spacing": { + "margin": true, + "padding": true, + "__experimentalDefaultControls": { + "margin": false, + "padding": false + } + }, + "interactivity": { + "clientNavigation": true + }, + "filter": { + "duotone": true + } + }, + "styles": [ + { + "name": "default", + "label": "Default", + "isDefault": true + }, + { "name": "rounded", "label": "Rounded" } + ], + "selectors": { + "filter": { + "duotone": ".wp-block-site-logo img, .wp-block-site-logo .components-placeholder__illustration, .wp-block-site-logo .components-placeholder::before" + } + }, + "editorStyle": "wp-block-site-logo-editor", + "style": "wp-block-site-logo" +} diff --git a/src/wp-includes/blocks/site-tagline.php b/src/wp-includes/blocks/site-tagline.php new file mode 100644 index 0000000000000..b59e1e556c320 --- /dev/null +++ b/src/wp-includes/blocks/site-tagline.php @@ -0,0 +1,53 @@ + $align_class_name ) ); + + if ( isset( $attributes['level'] ) && 0 !== $attributes['level'] ) { + $tag_name = 'h' . (int) $attributes['level']; + } + + return sprintf( + '<%1$s %2$s>%3$s', + $tag_name, + $wrapper_attributes, + $site_tagline + ); +} + +/** + * Registers the `core/site-tagline` block on the server. + * + * @since 5.8.0 + */ +function register_block_core_site_tagline() { + register_block_type_from_metadata( + __DIR__ . '/site-tagline', + array( + 'render_callback' => 'render_block_core_site_tagline', + ) + ); +} + +add_action( 'init', 'register_block_core_site_tagline' ); diff --git a/src/wp-includes/blocks/site-tagline/block.json b/src/wp-includes/blocks/site-tagline/block.json new file mode 100644 index 0000000000000..756b2dcb8183a --- /dev/null +++ b/src/wp-includes/blocks/site-tagline/block.json @@ -0,0 +1,75 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "core/site-tagline", + "title": "Site Tagline", + "category": "theme", + "description": "Describe in a few words what this site is about. This is important for search results, sharing on social media, and gives overall clarity to visitors.", + "keywords": [ "description" ], + "textdomain": "default", + "attributes": { + "textAlign": { + "type": "string" + }, + "level": { + "type": "number", + "default": 0 + }, + "levelOptions": { + "type": "array", + "default": [ 0, 1, 2, 3, 4, 5, 6 ] + } + }, + "example": { + "viewportWidth": 350, + "attributes": { + "textAlign": "center" + } + }, + "supports": { + "anchor": true, + "align": [ "wide", "full" ], + "html": false, + "color": { + "gradients": true, + "__experimentalDefaultControls": { + "background": true, + "text": true + } + }, + "contentRole": true, + "spacing": { + "margin": true, + "padding": true, + "__experimentalDefaultControls": { + "margin": false, + "padding": false + } + }, + "typography": { + "fontSize": true, + "lineHeight": true, + "__experimentalFontFamily": true, + "__experimentalTextTransform": true, + "__experimentalTextDecoration": true, + "__experimentalFontStyle": true, + "__experimentalFontWeight": true, + "__experimentalLetterSpacing": true, + "__experimentalWritingMode": true, + "__experimentalDefaultControls": { + "fontSize": true + } + }, + "interactivity": { + "clientNavigation": true + }, + "__experimentalBorder": { + "radius": true, + "color": true, + "width": true, + "style": true + } + }, + "editorStyle": "wp-block-site-tagline-editor", + "style": "wp-block-site-tagline" +} diff --git a/src/wp-includes/blocks/site-title.php b/src/wp-includes/blocks/site-title.php new file mode 100644 index 0000000000000..297d99894e104 --- /dev/null +++ b/src/wp-includes/blocks/site-title.php @@ -0,0 +1,69 @@ +%4$s', + esc_url( home_url() ), + esc_attr( $link_target ), + $aria_current, + esc_html( $site_title ) + ); + } + $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => trim( $classes ) ) ); + + return sprintf( + '<%1$s %2$s>%3$s', + $tag_name, + $wrapper_attributes, + // already pre-escaped if it is a link. + $attributes['isLink'] ? $site_title : esc_html( $site_title ) + ); +} + +/** + * Registers the `core/site-title` block on the server. + * + * @since 5.8.0 + */ +function register_block_core_site_title() { + register_block_type_from_metadata( + __DIR__ . '/site-title', + array( + 'render_callback' => 'render_block_core_site_title', + ) + ); +} +add_action( 'init', 'register_block_core_site_title' ); diff --git a/src/wp-includes/blocks/site-title/block.json b/src/wp-includes/blocks/site-title/block.json new file mode 100644 index 0000000000000..ac6a3c10e086a --- /dev/null +++ b/src/wp-includes/blocks/site-title/block.json @@ -0,0 +1,82 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "core/site-title", + "title": "Site Title", + "category": "theme", + "description": "Displays the name of this site. Update the block, and the changes apply everywhere it’s used. This will also appear in the browser title bar and in search results.", + "textdomain": "default", + "attributes": { + "level": { + "type": "number", + "default": 1 + }, + "levelOptions": { + "type": "array", + "default": [ 0, 1, 2, 3, 4, 5, 6 ] + }, + "textAlign": { + "type": "string" + }, + "isLink": { + "type": "boolean", + "default": true, + "role": "content" + }, + "linkTarget": { + "type": "string", + "default": "_self", + "role": "content" + } + }, + "example": { + "viewportWidth": 500 + }, + "supports": { + "anchor": true, + "align": [ "wide", "full" ], + "html": false, + "color": { + "gradients": true, + "link": true, + "__experimentalDefaultControls": { + "background": true, + "text": true, + "link": true + } + }, + "spacing": { + "padding": true, + "margin": true, + "__experimentalDefaultControls": { + "margin": false, + "padding": false + } + }, + "typography": { + "fontSize": true, + "lineHeight": true, + "__experimentalFontFamily": true, + "__experimentalTextTransform": true, + "__experimentalTextDecoration": true, + "__experimentalFontStyle": true, + "__experimentalFontWeight": true, + "__experimentalLetterSpacing": true, + "__experimentalWritingMode": true, + "__experimentalDefaultControls": { + "fontSize": true + } + }, + "interactivity": { + "clientNavigation": true + }, + "__experimentalBorder": { + "radius": true, + "color": true, + "width": true, + "style": true + } + }, + "editorStyle": "wp-block-site-title-editor", + "style": "wp-block-site-title" +} diff --git a/src/wp-includes/blocks/social-link.php b/src/wp-includes/blocks/social-link.php new file mode 100644 index 0000000000000..0225a14d7beb5 --- /dev/null +++ b/src/wp-includes/blocks/social-link.php @@ -0,0 +1,408 @@ +context['openInNewTab'] ?? false; + + $text = ! empty( $attributes['label'] ) ? trim( $attributes['label'] ) : ''; + + $service = $attributes['service'] ?? 'Icon'; + $url = $attributes['url'] ?? false; + $text = $text ? $text : block_core_social_link_get_name( $service ); + $rel = $attributes['rel'] ?? ''; + $show_labels = array_key_exists( 'showLabels', $block->context ) ? $block->context['showLabels'] : false; + + // Don't render a link if there is no URL set. + if ( ! $url ) { + return ''; + } + + /** + * Prepend emails with `mailto:` if not set. + * The `is_email` returns false for emails with schema. + */ + if ( is_email( $url ) ) { + $url = 'mailto:' . antispambot( $url ); + } + + /** + * Prepend URL with https:// if it doesn't appear to contain a scheme + * and it's not a relative link or a fragment. + */ + if ( ! parse_url( $url, PHP_URL_SCHEME ) && ! str_starts_with( $url, '//' ) && ! str_starts_with( $url, '#' ) ) { + $url = 'https://' . $url; + } + + $icon = block_core_social_link_get_icon( $service ); + $wrapper_attributes = get_block_wrapper_attributes( + array( + 'class' => 'wp-social-link wp-social-link-' . $service . block_core_social_link_get_color_classes( $block->context ), + 'style' => block_core_social_link_get_color_styles( $block->context ), + ) + ); + + $link = '
    8. '; + $link .= ''; + $link .= $icon; + $link .= '' . esc_html( $text ) . ''; + $link .= '
    9. '; + + $processor = new WP_HTML_Tag_Processor( $link ); + $processor->next_tag( 'a' ); + if ( $open_in_new_tab ) { + $processor->set_attribute( 'rel', trim( $rel . ' noopener nofollow' ) ); + $processor->set_attribute( 'target', '_blank' ); + } elseif ( '' !== $rel ) { + $processor->set_attribute( 'rel', trim( $rel ) ); + } + return $processor->get_updated_html(); +} + +/** + * Registers the `core/social-link` blocks. + * + * @since 5.4.0 + */ +function register_block_core_social_link() { + register_block_type_from_metadata( + __DIR__ . '/social-link', + array( + 'render_callback' => 'render_block_core_social_link', + ) + ); +} +add_action( 'init', 'register_block_core_social_link' ); + + +/** + * Returns the SVG for social link. + * + * @since 5.4.0 + * + * @param string $service The service icon. + * + * @return string SVG Element for service icon. + */ +function block_core_social_link_get_icon( $service ) { + $services = block_core_social_link_services(); + if ( isset( $services[ $service ] ) && isset( $services[ $service ]['icon'] ) ) { + return $services[ $service ]['icon']; + } + + return $services['share']['icon']; +} + +/** + * Returns the brand name for social link. + * + * @since 5.4.0 + * + * @param string $service The service icon. + * + * @return string Brand label. + */ +function block_core_social_link_get_name( $service ) { + $services = block_core_social_link_services(); + if ( isset( $services[ $service ] ) && isset( $services[ $service ]['name'] ) ) { + return $services[ $service ]['name']; + } + + return $services['share']['name']; +} + +/** + * Returns the SVG for social link. + * + * @since 5.4.0 + * + * @param string $service The service slug to extract data from. + * @param string $field The field ('name', 'icon', etc) to extract for a service. + * + * @return array|string + */ +function block_core_social_link_services( $service = '', $field = '' ) { + $services_data = array( + 'fivehundredpx' => array( + 'name' => _x( '500px', 'social link block variation name' ), + 'icon' => '', + ), + 'amazon' => array( + 'name' => _x( 'Amazon', 'social link block variation name' ), + 'icon' => '', + ), + 'bandcamp' => array( + 'name' => _x( 'Bandcamp', 'social link block variation name' ), + 'icon' => '', + ), + 'behance' => array( + 'name' => _x( 'Behance', 'social link block variation name' ), + 'icon' => '', + ), + 'bluesky' => array( + 'name' => _x( 'Bluesky', 'social link block variation name' ), + 'icon' => '', + ), + 'chain' => array( + 'name' => _x( 'Link', 'social link block variation name' ), + 'icon' => '', + ), + 'codepen' => array( + 'name' => _x( 'CodePen', 'social link block variation name' ), + 'icon' => '', + ), + 'deviantart' => array( + 'name' => _x( 'DeviantArt', 'social link block variation name' ), + 'icon' => '', + ), + 'discord' => array( + 'name' => _x( 'Discord', 'social link block variation name' ), + 'icon' => '', + ), + 'dribbble' => array( + 'name' => _x( 'Dribbble', 'social link block variation name' ), + 'icon' => '', + ), + 'dropbox' => array( + 'name' => _x( 'Dropbox', 'social link block variation name' ), + 'icon' => '', + ), + 'etsy' => array( + 'name' => _x( 'Etsy', 'social link block variation name' ), + 'icon' => '', + ), + 'facebook' => array( + 'name' => _x( 'Facebook', 'social link block variation name' ), + 'icon' => '', + ), + 'feed' => array( + 'name' => _x( 'RSS Feed', 'social link block variation name' ), + 'icon' => '', + ), + 'flickr' => array( + 'name' => _x( 'Flickr', 'social link block variation name' ), + 'icon' => '', + ), + 'foursquare' => array( + 'name' => _x( 'Foursquare', 'social link block variation name' ), + 'icon' => '', + ), + 'goodreads' => array( + 'name' => _x( 'Goodreads', 'social link block variation name' ), + 'icon' => '', + ), + 'google' => array( + 'name' => _x( 'Google', 'social link block variation name' ), + 'icon' => '', + ), + 'github' => array( + 'name' => _x( 'GitHub', 'social link block variation name' ), + 'icon' => '', + ), + 'gravatar' => array( + 'name' => _x( 'Gravatar', 'social link block variation name' ), + 'icon' => '', + ), + 'instagram' => array( + 'name' => _x( 'Instagram', 'social link block variation name' ), + 'icon' => '', + ), + 'lastfm' => array( + 'name' => _x( 'Last.fm', 'social link block variation name' ), + 'icon' => '', + ), + 'linkedin' => array( + 'name' => _x( 'LinkedIn', 'social link block variation name' ), + 'icon' => '', + ), + 'mail' => array( + 'name' => _x( 'Mail', 'social link block variation name' ), + 'icon' => '', + ), + 'mastodon' => array( + 'name' => _x( 'Mastodon', 'social link block variation name' ), + 'icon' => '', + ), + 'meetup' => array( + 'name' => _x( 'Meetup', 'social link block variation name' ), + 'icon' => '', + ), + 'medium' => array( + 'name' => _x( 'Medium', 'social link block variation name' ), + 'icon' => '', + ), + 'patreon' => array( + 'name' => _x( 'Patreon', 'social link block variation name' ), + 'icon' => '', + ), + 'pinterest' => array( + 'name' => _x( 'Pinterest', 'social link block variation name' ), + 'icon' => '', + ), + 'pocket' => array( + 'name' => _x( 'Pocket', 'social link block variation name' ), + 'icon' => '', + ), + 'reddit' => array( + 'name' => _x( 'Reddit', 'social link block variation name' ), + 'icon' => '', + ), + 'share' => array( + 'name' => _x( 'Share Icon', 'social link block variation name' ), + 'icon' => '', + ), + 'skype' => array( + 'name' => _x( 'Skype', 'social link block variation name' ), + 'icon' => '', + ), + 'snapchat' => array( + 'name' => _x( 'Snapchat', 'social link block variation name' ), + 'icon' => '', + ), + 'soundcloud' => array( + 'name' => _x( 'SoundCloud', 'social link block variation name' ), + 'icon' => '', + ), + 'spotify' => array( + 'name' => _x( 'Spotify', 'social link block variation name' ), + 'icon' => '', + ), + 'telegram' => array( + 'name' => _x( 'Telegram', 'social link block variation name' ), + 'icon' => '', + ), + 'threads' => array( + 'name' => _x( 'Threads', 'social link block variation name' ), + 'icon' => '', + ), + 'tiktok' => array( + 'name' => _x( 'TikTok', 'social link block variation name' ), + 'icon' => '', + ), + 'tumblr' => array( + 'name' => _x( 'Tumblr', 'social link block variation name' ), + 'icon' => '
      ', + ), + 'twitch' => array( + 'name' => _x( 'Twitch', 'social link block variation name' ), + 'icon' => '', + ), + 'twitter' => array( + 'name' => _x( 'Twitter', 'social link block variation name' ), + 'icon' => '', + ), + 'vimeo' => array( + 'name' => _x( 'Vimeo', 'social link block variation name' ), + 'icon' => '', + ), + 'vk' => array( + 'name' => _x( 'VK', 'social link block variation name' ), + 'icon' => '', + ), + 'wordpress' => array( + 'name' => _x( 'WordPress', 'social link block variation name' ), + 'icon' => '', + ), + 'whatsapp' => array( + 'name' => _x( 'WhatsApp', 'social link block variation name' ), + 'icon' => '', + ), + 'x' => array( + 'name' => _x( 'X', 'social link block variation name' ), + 'icon' => '', + ), + 'yelp' => array( + 'name' => _x( 'Yelp', 'social link block variation name' ), + 'icon' => '', + ), + 'youtube' => array( + 'name' => _x( 'YouTube', 'social link block variation name' ), + 'icon' => '', + ), + ); + + /** + * Filter the list of available social service. + * + * This can be used to change icons or add custom icons (additionally to variations in the editor). + * Icons should be directly renderable - therefore SVGs work best. + * + * @since 6.9.0 + * + * @param array $services_data The list of services. Each item is an array containing a 'name' and 'icon' key. + * @return array The list of social services. + */ + $services_data = apply_filters( 'block_core_social_link_get_services', $services_data ); + + if ( ! empty( $service ) + && ! empty( $field ) + && isset( $services_data[ $service ] ) + && ( 'icon' === $field || 'name' === $field ) + ) { + return $services_data[ $service ][ $field ]; + } elseif ( ! empty( $service ) && isset( $services_data[ $service ] ) ) { + return $services_data[ $service ]; + } + + return $services_data; +} + +/** + * Returns CSS styles for icon and icon background colors. + * + * @since 5.7.0 + * + * @param array $context Block context passed to Social Link. + * + * @return string Inline CSS styles for link's icon and background colors. + */ +function block_core_social_link_get_color_styles( $context ) { + $styles = array(); + + if ( array_key_exists( 'iconColorValue', $context ) ) { + $styles[] = 'color:' . $context['iconColorValue'] . ';'; + } + + if ( array_key_exists( 'iconBackgroundColorValue', $context ) ) { + $styles[] = 'background-color:' . $context['iconBackgroundColorValue'] . ';'; + } + + return implode( '', $styles ); +} + +/** + * Returns CSS classes for icon and icon background colors. + * + * @since 6.3.0 + * + * @param array $context Block context passed to Social Sharing Link. + * + * @return string CSS classes for link's icon and background colors. + */ +function block_core_social_link_get_color_classes( $context ) { + $classes = array(); + + if ( array_key_exists( 'iconColor', $context ) ) { + $classes[] = 'has-' . $context['iconColor'] . '-color'; + } + + if ( array_key_exists( 'iconBackgroundColor', $context ) ) { + $classes[] = 'has-' . $context['iconBackgroundColor'] . '-background-color'; + } + + return ' ' . implode( ' ', $classes ); +} diff --git a/src/wp-includes/blocks/social-link/block.json b/src/wp-includes/blocks/social-link/block.json new file mode 100644 index 0000000000000..db59656abb1c0 --- /dev/null +++ b/src/wp-includes/blocks/social-link/block.json @@ -0,0 +1,43 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "core/social-link", + "title": "Social Icon", + "category": "widgets", + "parent": [ "core/social-links" ], + "description": "Display an icon linking to a social profile or site.", + "textdomain": "default", + "attributes": { + "url": { + "type": "string", + "role": "content" + }, + "service": { + "type": "string" + }, + "label": { + "type": "string", + "role": "content" + }, + "rel": { + "type": "string" + } + }, + "usesContext": [ + "openInNewTab", + "showLabels", + "iconColor", + "iconColorValue", + "iconBackgroundColor", + "iconBackgroundColorValue" + ], + "supports": { + "anchor": true, + "reusable": false, + "html": false, + "interactivity": { + "clientNavigation": true + } + }, + "editorStyle": "wp-block-social-link-editor" +} diff --git a/src/wp-includes/blocks/social-links/block.json b/src/wp-includes/blocks/social-links/block.json new file mode 100644 index 0000000000000..fb137d1d6c3cd --- /dev/null +++ b/src/wp-includes/blocks/social-links/block.json @@ -0,0 +1,108 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "core/social-links", + "title": "Social Icons", + "category": "widgets", + "allowedBlocks": [ "core/social-link" ], + "description": "Display icons linking to your social profiles or sites.", + "keywords": [ "links" ], + "textdomain": "default", + "attributes": { + "iconColor": { + "type": "string" + }, + "customIconColor": { + "type": "string" + }, + "iconColorValue": { + "type": "string" + }, + "iconBackgroundColor": { + "type": "string" + }, + "customIconBackgroundColor": { + "type": "string" + }, + "iconBackgroundColorValue": { + "type": "string" + }, + "openInNewTab": { + "type": "boolean", + "default": false + }, + "showLabels": { + "type": "boolean", + "default": false + }, + "size": { + "type": "string" + } + }, + "providesContext": { + "openInNewTab": "openInNewTab", + "showLabels": "showLabels", + "iconColor": "iconColor", + "iconColorValue": "iconColorValue", + "iconBackgroundColor": "iconBackgroundColor", + "iconBackgroundColorValue": "iconBackgroundColorValue" + }, + "supports": { + "align": [ "left", "center", "right" ], + "anchor": true, + "html": false, + "__experimentalExposeControlsToChildren": true, + "layout": { + "allowSwitching": false, + "allowInheriting": false, + "allowVerticalAlignment": false, + "default": { + "type": "flex" + } + }, + "color": { + "enableContrastChecker": false, + "background": true, + "gradients": true, + "text": false, + "__experimentalDefaultControls": { + "background": false + } + }, + "spacing": { + "blockGap": [ "horizontal", "vertical" ], + "margin": true, + "padding": true, + "units": [ "px", "em", "rem", "vh", "vw" ], + "__experimentalDefaultControls": { + "blockGap": true, + "margin": true, + "padding": false + } + }, + "interactivity": { + "clientNavigation": true + }, + "__experimentalBorder": { + "radius": true, + "color": true, + "width": true, + "style": true, + "__experimentalDefaultControls": { + "radius": true, + "color": true, + "width": true, + "style": true + } + }, + "contentRole": true, + "listView": true + }, + "styles": [ + { "name": "default", "label": "Default", "isDefault": true }, + { "name": "logos-only", "label": "Logos Only" }, + { "name": "pill-shape", "label": "Pill Shape" } + ], + "editorStyle": "wp-block-social-links-editor", + "style": "wp-block-social-links" +} diff --git a/src/wp-includes/blocks/spacer/block.json b/src/wp-includes/blocks/spacer/block.json new file mode 100644 index 0000000000000..447ea99cc0b67 --- /dev/null +++ b/src/wp-includes/blocks/spacer/block.json @@ -0,0 +1,33 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "core/spacer", + "title": "Spacer", + "category": "design", + "description": "Add white space between blocks and customize its height.", + "textdomain": "default", + "attributes": { + "height": { + "type": "string", + "default": "100px" + }, + "width": { + "type": "string" + } + }, + "usesContext": [ "orientation" ], + "supports": { + "anchor": true, + "spacing": { + "margin": [ "top", "bottom" ], + "__experimentalDefaultControls": { + "margin": true + } + }, + "interactivity": { + "clientNavigation": true + } + }, + "editorStyle": "wp-block-spacer-editor", + "style": "wp-block-spacer" +} diff --git a/src/wp-includes/blocks/table/block.json b/src/wp-includes/blocks/table/block.json new file mode 100644 index 0000000000000..84f2783d3ff8c --- /dev/null +++ b/src/wp-includes/blocks/table/block.json @@ -0,0 +1,220 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "core/table", + "title": "Table", + "category": "text", + "description": "Create structured content in rows and columns to display information.", + "textdomain": "default", + "attributes": { + "hasFixedLayout": { + "type": "boolean", + "default": true + }, + "caption": { + "type": "rich-text", + "source": "rich-text", + "selector": "figcaption", + "role": "content" + }, + "head": { + "type": "array", + "default": [], + "source": "query", + "selector": "thead tr", + "query": { + "cells": { + "type": "array", + "default": [], + "source": "query", + "selector": "td,th", + "query": { + "content": { + "type": "rich-text", + "source": "rich-text", + "role": "content" + }, + "tag": { + "type": "string", + "default": "td", + "source": "tag" + }, + "scope": { + "type": "string", + "source": "attribute", + "attribute": "scope" + }, + "align": { + "type": "string", + "source": "attribute", + "attribute": "data-align" + }, + "colspan": { + "type": "string", + "source": "attribute", + "attribute": "colspan" + }, + "rowspan": { + "type": "string", + "source": "attribute", + "attribute": "rowspan" + } + } + } + } + }, + "body": { + "type": "array", + "default": [], + "source": "query", + "selector": "tbody tr", + "query": { + "cells": { + "type": "array", + "default": [], + "source": "query", + "selector": "td,th", + "query": { + "content": { + "type": "rich-text", + "source": "rich-text", + "role": "content" + }, + "tag": { + "type": "string", + "default": "td", + "source": "tag" + }, + "scope": { + "type": "string", + "source": "attribute", + "attribute": "scope" + }, + "align": { + "type": "string", + "source": "attribute", + "attribute": "data-align" + }, + "colspan": { + "type": "string", + "source": "attribute", + "attribute": "colspan" + }, + "rowspan": { + "type": "string", + "source": "attribute", + "attribute": "rowspan" + } + } + } + } + }, + "foot": { + "type": "array", + "default": [], + "source": "query", + "selector": "tfoot tr", + "query": { + "cells": { + "type": "array", + "default": [], + "source": "query", + "selector": "td,th", + "query": { + "content": { + "type": "rich-text", + "source": "rich-text", + "role": "content" + }, + "tag": { + "type": "string", + "default": "td", + "source": "tag" + }, + "scope": { + "type": "string", + "source": "attribute", + "attribute": "scope" + }, + "align": { + "type": "string", + "source": "attribute", + "attribute": "data-align" + }, + "colspan": { + "type": "string", + "source": "attribute", + "attribute": "colspan" + }, + "rowspan": { + "type": "string", + "source": "attribute", + "attribute": "rowspan" + } + } + } + } + } + }, + "supports": { + "anchor": true, + "align": true, + "color": { + "__experimentalSkipSerialization": true, + "gradients": true, + "__experimentalDefaultControls": { + "background": true, + "text": true + } + }, + "spacing": { + "margin": true, + "padding": true, + "__experimentalDefaultControls": { + "margin": false, + "padding": false + } + }, + "typography": { + "fontSize": true, + "lineHeight": true, + "__experimentalFontFamily": true, + "__experimentalFontStyle": true, + "__experimentalFontWeight": true, + "__experimentalLetterSpacing": true, + "__experimentalTextTransform": true, + "__experimentalTextDecoration": true, + "__experimentalDefaultControls": { + "fontSize": true + } + }, + "__experimentalBorder": { + "__experimentalSkipSerialization": true, + "color": true, + "style": true, + "width": true, + "__experimentalDefaultControls": { + "color": true, + "style": true, + "width": true + } + }, + "interactivity": { + "clientNavigation": true + } + }, + "selectors": { + "root": ".wp-block-table > table", + "spacing": ".wp-block-table" + }, + "styles": [ + { + "name": "regular", + "label": "Default", + "isDefault": true + }, + { "name": "stripes", "label": "Stripes" } + ], + "editorStyle": "wp-block-table-editor", + "style": "wp-block-table" +} diff --git a/src/wp-includes/blocks/tag-cloud.php b/src/wp-includes/blocks/tag-cloud.php new file mode 100644 index 0000000000000..8949dd8e5b11f --- /dev/null +++ b/src/wp-includes/blocks/tag-cloud.php @@ -0,0 +1,63 @@ +[a-z%]+)$/i', $smallest_font_size, $m ) ? $m['unit'] : 'pt' ); + + $args = array( + 'echo' => false, + 'unit' => $unit, + 'taxonomy' => $attributes['taxonomy'], + 'show_count' => $attributes['showTagCounts'], + 'number' => $attributes['numberOfTags'], + 'smallest' => floatVal( $attributes['smallestFontSize'] ), + 'largest' => floatVal( $attributes['largestFontSize'] ), + ); + $tag_cloud = wp_tag_cloud( $args ); + + if ( empty( $tag_cloud ) ) { + // Display placeholder content when there are no tags only in editor. + if ( wp_is_serving_rest_request() ) { + $tag_cloud = __( 'There’s no content to show here yet.' ); + } else { + return ''; + } + } + + $wrapper_attributes = get_block_wrapper_attributes(); + + return sprintf( + '

      %2$s

      ', + $wrapper_attributes, + $tag_cloud + ); +} + +/** + * Registers the `core/tag-cloud` block on server. + * + * @since 5.2.0 + */ +function register_block_core_tag_cloud() { + register_block_type_from_metadata( + __DIR__ . '/tag-cloud', + array( + 'render_callback' => 'render_block_core_tag_cloud', + ) + ); +} +add_action( 'init', 'register_block_core_tag_cloud' ); diff --git a/src/wp-includes/blocks/tag-cloud/block.json b/src/wp-includes/blocks/tag-cloud/block.json new file mode 100644 index 0000000000000..b91f7d8d028b5 --- /dev/null +++ b/src/wp-includes/blocks/tag-cloud/block.json @@ -0,0 +1,69 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "core/tag-cloud", + "title": "Tag Cloud", + "category": "widgets", + "description": "A cloud of popular keywords, each sized by how often it appears.", + "textdomain": "default", + "attributes": { + "numberOfTags": { + "type": "number", + "default": 45, + "minimum": 1, + "maximum": 100 + }, + "taxonomy": { + "type": "string", + "default": "post_tag" + }, + "showTagCounts": { + "type": "boolean", + "default": false + }, + "smallestFontSize": { + "type": "string", + "default": "8pt" + }, + "largestFontSize": { + "type": "string", + "default": "22pt" + } + }, + "styles": [ + { "name": "default", "label": "Default", "isDefault": true }, + { "name": "outline", "label": "Outline" } + ], + "supports": { + "anchor": true, + "html": false, + "align": true, + "spacing": { + "margin": true, + "padding": true + }, + "typography": { + "lineHeight": true, + "__experimentalFontFamily": true, + "__experimentalFontWeight": true, + "__experimentalFontStyle": true, + "__experimentalTextTransform": true, + "__experimentalLetterSpacing": true + }, + "interactivity": { + "clientNavigation": true + }, + "__experimentalBorder": { + "radius": true, + "color": true, + "width": true, + "style": true, + "__experimentalDefaultControls": { + "radius": true, + "color": true, + "width": true, + "style": true + } + } + } +} diff --git a/src/wp-includes/blocks/template-part.php b/src/wp-includes/blocks/template-part.php new file mode 100644 index 0000000000000..25ba4e4a99624 --- /dev/null +++ b/src/wp-includes/blocks/template-part.php @@ -0,0 +1,314 @@ + 'wp_template_part', + 'post_status' => 'publish', + 'post_name__in' => array( $attributes['slug'] ), + 'tax_query' => array( + array( + 'taxonomy' => 'wp_theme', + 'field' => 'name', + 'terms' => $theme, + ), + ), + 'posts_per_page' => 1, + 'no_found_rows' => true, + 'lazy_load_term_meta' => false, // Do not lazy load term meta, as template parts only have one term. + ) + ); + $template_part_post = $template_part_query->have_posts() ? $template_part_query->next_post() : null; + if ( $template_part_post ) { + // A published post might already exist if this template part was customized elsewhere + // or if it's part of a customized template. + $block_template = _build_block_template_result_from_post( $template_part_post ); + $content = $block_template->content; + if ( isset( $block_template->area ) ) { + $area = $block_template->area; + } + /** + * Fires when a block template part is loaded from a template post stored in the database. + * + * @since 5.9.0 + * + * @param string $template_part_id The requested template part namespaced to the theme. + * @param array $attributes The block attributes. + * @param WP_Post $template_part_post The template part post object. + * @param string $content The template part content. + */ + do_action( 'render_block_core_template_part_post', $template_part_id, $attributes, $template_part_post, $content ); + } else { + $template_part_file_path = ''; + // Else, if the template part was provided by the active theme, + // render the corresponding file content. + if ( 0 === validate_file( $attributes['slug'] ) ) { + $block_template = get_block_file_template( $template_part_id, 'wp_template_part' ); + + if ( isset( $block_template->content ) ) { + $content = $block_template->content; + } + if ( isset( $block_template->area ) ) { + $area = $block_template->area; + } + + // Needed for the `render_block_core_template_part_file` and `render_block_core_template_part_none` actions below. + $block_template_file = _get_block_template_file( 'wp_template_part', $attributes['slug'] ); + if ( $block_template_file ) { + $template_part_file_path = $block_template_file['path']; + } + } + + if ( '' !== $content && null !== $content ) { + /** + * Fires when a block template part is loaded from a template part in the theme. + * + * @since 5.9.0 + * + * @param string $template_part_id The requested template part namespaced to the theme. + * @param array $attributes The block attributes. + * @param string $template_part_file_path Absolute path to the template path. + * @param string $content The template part content. + */ + do_action( 'render_block_core_template_part_file', $template_part_id, $attributes, $template_part_file_path, $content ); + } else { + /** + * Fires when a requested block template part does not exist in the database nor in the theme. + * + * @since 5.9.0 + * + * @param string $template_part_id The requested template part namespaced to the theme. + * @param array $attributes The block attributes. + * @param string $template_part_file_path Absolute path to the not found template path. + */ + do_action( 'render_block_core_template_part_none', $template_part_id, $attributes, $template_part_file_path ); + } + } + } + + // WP_DEBUG_DISPLAY must only be honored when WP_DEBUG. This precedent + // is set in `wp_debug_mode()`. + $is_debug = WP_DEBUG && WP_DEBUG_DISPLAY; + + if ( is_null( $content ) ) { + if ( $is_debug && isset( $attributes['slug'] ) ) { + return sprintf( + /* translators: %s: Template part slug. */ + __( 'Template part has been deleted or is unavailable: %s' ), + $attributes['slug'] + ); + } + + return ''; + } + + if ( isset( $seen_ids[ $template_part_id ] ) ) { + return $is_debug ? + // translators: Visible only in the front end, this warning takes the place of a faulty block. + __( '[block rendering halted]' ) : + ''; + } + + // Look up area definition. + $area_definition = null; + $defined_areas = get_allowed_block_template_part_areas(); + foreach ( $defined_areas as $defined_area ) { + if ( $defined_area['area'] === $area ) { + $area_definition = $defined_area; + break; + } + } + + // If $area is not allowed, set it back to the uncategorized default. + if ( ! $area_definition ) { + $area = WP_TEMPLATE_PART_AREA_UNCATEGORIZED; + } + + // Run through the actions that are typically taken on the_content. + $content = shortcode_unautop( $content ); + $content = do_shortcode( $content ); + $seen_ids[ $template_part_id ] = true; + $content = do_blocks( $content ); + unset( $seen_ids[ $template_part_id ] ); + $content = wptexturize( $content ); + $content = convert_smilies( $content ); + $content = wp_filter_content_tags( $content, "template_part_{$area}" ); + + /** + * Handle embeds for block template parts. + * + * @global WP_Embed $wp_embed WordPress Embed object. + */ + global $wp_embed; + $content = $wp_embed->autoembed( $content ); + + if ( empty( $attributes['tagName'] ) || tag_escape( $attributes['tagName'] ) !== $attributes['tagName'] ) { + $area_tag = 'div'; + if ( $area_definition && isset( $area_definition['area_tag'] ) ) { + $area_tag = $area_definition['area_tag']; + } + $html_tag = $area_tag; + } else { + $html_tag = esc_attr( $attributes['tagName'] ); + } + $wrapper_attributes = get_block_wrapper_attributes(); + + return "<$html_tag $wrapper_attributes>" . str_replace( ']]>', ']]>', $content ) . ""; +} + +/** + * Returns an array of area variation objects for the template part block. + * + * @since 6.1.0 + * + * @param array $instance_variations The variations for instances. + * + * @return array Array containing the block variation objects. + */ +function build_template_part_block_area_variations( $instance_variations ) { + $variations = array(); + $defined_areas = get_allowed_block_template_part_areas(); + + foreach ( $defined_areas as $area ) { + if ( 'uncategorized' !== $area['area'] && 'navigation-overlay' !== $area['area'] ) { + $has_instance_for_area = false; + foreach ( $instance_variations as $variation ) { + if ( $variation['attributes']['area'] === $area['area'] ) { + $has_instance_for_area = true; + break; + } + } + + $scope = $has_instance_for_area ? array() : array( 'inserter' ); + + $variations[] = array( + 'name' => 'area_' . $area['area'], + 'title' => $area['label'], + 'description' => $area['description'], + 'attributes' => array( + 'area' => $area['area'], + ), + 'scope' => $scope, + 'icon' => $area['icon'], + ); + } + } + return $variations; +} + +/** + * Returns an array of instance variation objects for the template part block + * + * @since 6.1.0 + * + * @return array Array containing the block variation objects. + */ +function build_template_part_block_instance_variations() { + // Block themes are unavailable during installation. + if ( wp_installing() ) { + return array(); + } + + if ( ! current_theme_supports( 'block-templates' ) && ! current_theme_supports( 'block-template-parts' ) ) { + return array(); + } + + $variations = array(); + $template_parts = get_block_templates( + array( + 'post_type' => 'wp_template_part', + ), + 'wp_template_part' + ); + + $defined_areas = get_allowed_block_template_part_areas(); + $icon_by_area = array_combine( array_column( $defined_areas, 'area' ), array_column( $defined_areas, 'icon' ) ); + + foreach ( $template_parts as $template_part ) { + // Navigation overlay template parts should not appear in the + // general inserter. They are managed through the Navigation + // block's overlay template part selector. + $scope = ( 'navigation-overlay' === $template_part->area ) + ? array() + : array( 'inserter' ); + + $variations[] = array( + 'name' => 'instance_' . sanitize_title( $template_part->slug ), + 'title' => $template_part->title, + // If there's no description for the template part don't show the + // block description. This is a bit hacky, but prevent the fallback + // by using a non-breaking space so that the value of description + // isn't falsey. + 'description' => $template_part->description || ' ', + 'attributes' => array( + 'slug' => $template_part->slug, + 'theme' => $template_part->theme, + 'area' => $template_part->area, + ), + 'scope' => $scope, + 'icon' => $icon_by_area[ $template_part->area ] ?? null, + 'example' => array( + 'attributes' => array( + 'slug' => $template_part->slug, + 'theme' => $template_part->theme, + 'area' => $template_part->area, + ), + ), + ); + } + return $variations; +} + +/** + * Returns an array of all template part block variations. + * + * @since 5.9.0 + * + * @return array Array containing the block variation objects. + */ +function build_template_part_block_variations() { + $instance_variations = build_template_part_block_instance_variations(); + $area_variations = build_template_part_block_area_variations( $instance_variations ); + return array_merge( $area_variations, $instance_variations ); +} + +/** + * Registers the `core/template-part` block on the server. + * + * @since 5.9.0 + */ +function register_block_core_template_part() { + register_block_type_from_metadata( + __DIR__ . '/template-part', + array( + 'render_callback' => 'render_block_core_template_part', + 'variation_callback' => 'build_template_part_block_variations', + ) + ); +} +add_action( 'init', 'register_block_core_template_part' ); diff --git a/src/wp-includes/blocks/template-part/block.json b/src/wp-includes/blocks/template-part/block.json new file mode 100644 index 0000000000000..9710bdeee2e53 --- /dev/null +++ b/src/wp-includes/blocks/template-part/block.json @@ -0,0 +1,33 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "core/template-part", + "title": "Template Part", + "category": "theme", + "description": "Edit the different global regions of your site, like the header, footer, sidebar, or create your own.", + "textdomain": "default", + "attributes": { + "slug": { + "type": "string" + }, + "theme": { + "type": "string" + }, + "tagName": { + "type": "string" + }, + "area": { + "type": "string" + } + }, + "supports": { + "align": true, + "html": false, + "reusable": false, + "renaming": false, + "interactivity": { + "clientNavigation": true + } + }, + "editorStyle": "wp-block-template-part-editor" +} diff --git a/src/wp-includes/blocks/term-count.php b/src/wp-includes/blocks/term-count.php new file mode 100644 index 0000000000000..9794896524eb4 --- /dev/null +++ b/src/wp-includes/blocks/term-count.php @@ -0,0 +1,80 @@ +context['termId'] ) && isset( $block->context['taxonomy'] ) ) { + $term = get_term( $block->context['termId'], $block->context['taxonomy'] ); + } else { + $term = get_queried_object(); + if ( ! $term instanceof WP_Term ) { + $term = null; + } + } + + if ( ! $term || is_wp_error( $term ) ) { + return ''; + } + + $term_count = $term->count; + + // Format the term count based on bracket type. + switch ( $attributes['bracketType'] ) { + case 'none': + // No formatting needed. + break; + case 'round': + $term_count = "({$term_count})"; + break; + case 'square': + $term_count = "[{$term_count}]"; + break; + case 'curly': + $term_count = "{{$term_count}}"; + break; + case 'angle': + $term_count = "<{$term_count}>"; + break; + default: + // Default to no formatting for unknown types. + break; + } + + $wrapper_attributes = get_block_wrapper_attributes(); + + return sprintf( + '
      %2$s
      ', + $wrapper_attributes, + $term_count + ); +} + +/** + * Registers the `core/term-count` block on the server. + * + * @since 6.9.0 + */ +function register_block_core_term_count() { + register_block_type_from_metadata( + __DIR__ . '/term-count', + array( + 'render_callback' => 'render_block_core_term_count', + ) + ); +} +add_action( 'init', 'register_block_core_term_count' ); diff --git a/src/wp-includes/blocks/term-count/block.json b/src/wp-includes/blocks/term-count/block.json new file mode 100644 index 0000000000000..4a7c578bb0b5b --- /dev/null +++ b/src/wp-includes/blocks/term-count/block.json @@ -0,0 +1,59 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "core/term-count", + "title": "Term Count", + "category": "theme", + "description": "Displays the post count of a taxonomy term.", + "textdomain": "default", + "usesContext": [ "termId", "taxonomy" ], + "attributes": { + "bracketType": { + "type": "string", + "enum": [ "none", "round", "square", "curly", "angle" ], + "default": "round" + } + }, + "supports": { + "anchor": true, + "html": false, + "color": { + "gradients": true, + "__experimentalDefaultControls": { + "background": true, + "text": true + } + }, + "spacing": { + "padding": true + }, + "typography": { + "fontSize": true, + "lineHeight": true, + "__experimentalFontFamily": true, + "__experimentalFontWeight": true, + "__experimentalFontStyle": true, + "__experimentalTextTransform": true, + "__experimentalTextDecoration": true, + "__experimentalLetterSpacing": true, + "__experimentalDefaultControls": { + "fontSize": true + } + }, + "interactivity": { + "clientNavigation": true + }, + "__experimentalBorder": { + "radius": true, + "color": true, + "width": true, + "style": true, + "__experimentalDefaultControls": { + "color": true, + "width": true, + "style": true + } + } + }, + "style": "wp-block-term-count" +} diff --git a/src/wp-includes/blocks/term-description.php b/src/wp-includes/blocks/term-description.php new file mode 100644 index 0000000000000..9f61dbba07fbc --- /dev/null +++ b/src/wp-includes/blocks/term-description.php @@ -0,0 +1,61 @@ +context['termId'] ) && isset( $block->context['taxonomy'] ) ) { + $term = get_term( $block->context['termId'], $block->context['taxonomy'] ); + if ( $term && ! is_wp_error( $term ) ) { + $term_description = $term->description; + } + } elseif ( is_category() || is_tag() || is_tax() ) { + $term_description = term_description(); + } + + if ( empty( $term_description ) ) { + return ''; + } + + $classes = array(); + if ( isset( $attributes['textAlign'] ) ) { + $classes[] = 'has-text-align-' . $attributes['textAlign']; + } + if ( isset( $attributes['style']['elements']['link']['color']['text'] ) ) { + $classes[] = 'has-link-color'; + } + $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => implode( ' ', $classes ) ) ); + + return '
      ' . $term_description . '
      '; +} + +/** + * Registers the `core/term-description` block on the server. + * + * @since 5.9.0 + */ +function register_block_core_term_description() { + register_block_type_from_metadata( + __DIR__ . '/term-description', + array( + 'render_callback' => 'render_block_core_term_description', + ) + ); +} +add_action( 'init', 'register_block_core_term_description' ); diff --git a/src/wp-includes/blocks/term-description/block.json b/src/wp-includes/blocks/term-description/block.json new file mode 100644 index 0000000000000..c0894ec0fb46d --- /dev/null +++ b/src/wp-includes/blocks/term-description/block.json @@ -0,0 +1,55 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "core/term-description", + "title": "Term Description", + "category": "theme", + "description": "Display the description of categories, tags and custom taxonomies when viewing an archive.", + "textdomain": "default", + "usesContext": [ "termId", "taxonomy" ], + "supports": { + "anchor": true, + "align": [ "wide", "full" ], + "html": false, + "color": { + "link": true, + "__experimentalDefaultControls": { + "background": true, + "text": true + } + }, + "spacing": { + "padding": true, + "margin": true + }, + "typography": { + "fontSize": true, + "lineHeight": true, + "textAlign": true, + "__experimentalFontFamily": true, + "__experimentalFontWeight": true, + "__experimentalFontStyle": true, + "__experimentalTextTransform": true, + "__experimentalTextDecoration": true, + "__experimentalLetterSpacing": true, + "__experimentalDefaultControls": { + "fontSize": true + } + }, + "interactivity": { + "clientNavigation": true + }, + "__experimentalBorder": { + "radius": true, + "color": true, + "width": true, + "style": true, + "__experimentalDefaultControls": { + "radius": true, + "color": true, + "width": true, + "style": true + } + } + } +} diff --git a/src/wp-includes/blocks/term-name.php b/src/wp-includes/blocks/term-name.php new file mode 100644 index 0000000000000..a583371f7e1eb --- /dev/null +++ b/src/wp-includes/blocks/term-name.php @@ -0,0 +1,81 @@ +context['termId'] ) && isset( $block->context['taxonomy'] ) ) { + $term = get_term( $block->context['termId'], $block->context['taxonomy'] ); + } else { + $term = get_queried_object(); + if ( ! $term instanceof WP_Term ) { + $term = null; + } + } + + if ( ! $term || is_wp_error( $term ) ) { + return ''; + } + + $term_name = $term->name; + $level = $attributes['level'] ?? 0; + $tag_name = 0 === $level ? 'p' : 'h' . (int) $level; + + if ( isset( $attributes['isLink'] ) && $attributes['isLink'] ) { + $term_link = get_term_link( $term ); + if ( ! is_wp_error( $term_link ) ) { + $term_name = sprintf( + '%2$s', + esc_url( $term_link ), + $term_name + ); + } + } + + $classes = array(); + if ( isset( $attributes['textAlign'] ) ) { + $classes[] = 'has-text-align-' . $attributes['textAlign']; + } + if ( isset( $attributes['style']['elements']['link']['color']['text'] ) ) { + $classes[] = 'has-link-color'; + } + $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => implode( ' ', $classes ) ) ); + + return sprintf( + '<%1$s %2$s>%3$s', + $tag_name, + $wrapper_attributes, + $term_name + ); +} + +/** + * Registers the `core/term-name` block on the server. + * + * @since 6.9.0 + */ +function register_block_core_term_name() { + register_block_type_from_metadata( + __DIR__ . '/term-name', + array( + 'render_callback' => 'render_block_core_term_name', + ) + ); +} +add_action( 'init', 'register_block_core_term_name' ); diff --git a/src/wp-includes/blocks/term-name/block.json b/src/wp-includes/blocks/term-name/block.json new file mode 100644 index 0000000000000..44a063303dd70 --- /dev/null +++ b/src/wp-includes/blocks/term-name/block.json @@ -0,0 +1,72 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "core/term-name", + "title": "Term Name", + "category": "theme", + "description": "Displays the name of a taxonomy term.", + "keywords": [ "term title" ], + "textdomain": "default", + "usesContext": [ "termId", "taxonomy" ], + "attributes": { + "textAlign": { + "type": "string" + }, + "level": { + "type": "number", + "default": 0 + }, + "isLink": { + "type": "boolean", + "default": false + }, + "levelOptions": { + "type": "array" + } + }, + "supports": { + "anchor": true, + "align": [ "wide", "full" ], + "html": false, + "color": { + "gradients": true, + "link": true, + "__experimentalDefaultControls": { + "background": true, + "text": true, + "link": true + } + }, + "spacing": { + "padding": true + }, + "typography": { + "fontSize": true, + "lineHeight": true, + "__experimentalFontFamily": true, + "__experimentalFontWeight": true, + "__experimentalFontStyle": true, + "__experimentalTextTransform": true, + "__experimentalTextDecoration": true, + "__experimentalLetterSpacing": true, + "__experimentalDefaultControls": { + "fontSize": true + } + }, + "interactivity": { + "clientNavigation": true + }, + "__experimentalBorder": { + "radius": true, + "color": true, + "width": true, + "style": true, + "__experimentalDefaultControls": { + "color": true, + "width": true, + "style": true + } + } + }, + "style": "wp-block-term-name" +} diff --git a/src/wp-includes/blocks/term-template.php b/src/wp-includes/blocks/term-template.php new file mode 100644 index 0000000000000..c6fa390c4ec47 --- /dev/null +++ b/src/wp-includes/blocks/term-template.php @@ -0,0 +1,137 @@ +context ) || empty( $block->context['termQuery'] ) ) { + return ''; + } + + $query = $block->context['termQuery']; + + $query_args = array( + 'number' => $query['perPage'], + 'order' => $query['order'], + 'orderby' => $query['orderBy'], + 'hide_empty' => $query['hideEmpty'], + ); + + $inherit_query = isset( $query['inherit'] ) + && $query['inherit'] + && ( is_tax() || is_category() || is_tag() ); + + if ( $inherit_query ) { + // Get the current term and taxonomy from the queried object. + $queried_object = get_queried_object(); + + // For hierarchical taxonomies, show children of the current term. + // For non-hierarchical taxonomies, show all terms (don't set parent). + if ( is_taxonomy_hierarchical( $queried_object->taxonomy ) ) { + // If showNested is true, use child_of to include nested terms. + // Otherwise, use parent to show only direct children. + if ( ! empty( $query['showNested'] ) ) { + $query_args['child_of'] = $queried_object->term_id; + } else { + $query_args['parent'] = $queried_object->term_id; + } + } + $query_args['taxonomy'] = $queried_object->taxonomy; + } else { + // If not inheriting set `taxonomy` from the block attribute. + $query_args['taxonomy'] = $query['taxonomy']; + + // If we are including specific terms we ignore `showNested` argument. + if ( ! empty( $query['include'] ) ) { + $query_args['include'] = array_unique( array_map( 'intval', $query['include'] ) ); + $query_args['orderby'] = 'include'; + $query_args['order'] = 'asc'; + } elseif ( is_taxonomy_hierarchical( $query['taxonomy'] ) && empty( $query['showNested'] ) ) { + // We set parent only when inheriting from the taxonomy archive context or not + // showing nested terms, otherwise nested terms are not displayed. + $query_args['parent'] = 0; + } + } + + $terms_query = new WP_Term_Query( $query_args ); + $terms = $terms_query->get_terms(); + + if ( ! $terms || is_wp_error( $terms ) ) { + return ''; + } + + $content = ''; + foreach ( $terms as $term ) { + // Get an instance of the current Term Template block. + $block_instance = $block->parsed_block; + + // Set the block name to one that does not correspond to an existing registered block. + // This ensures that for the inner instances of the Term Template block, we do not render any block supports. + $block_instance['blockName'] = 'core/null'; + + $term_id = $term->term_id; + $taxonomy = $term->taxonomy; + + $filter_block_context = static function ( $context ) use ( $term_id, $taxonomy ) { + $context['termId'] = $term_id; + $context['taxonomy'] = $taxonomy; + return $context; + }; + + // Use an early priority to so that other 'render_block_context' filters have access to the values. + add_filter( 'render_block_context', $filter_block_context, 1 ); + + // Render the inner blocks of the Term Template block with `dynamic` set to `false` to prevent calling + // `render_callback` and ensure that no wrapper markup is included. + $block_content = ( new WP_Block( $block_instance ) )->render( array( 'dynamic' => false ) ); + + remove_filter( 'render_block_context', $filter_block_context, 1 ); + + // Wrap the render inner blocks in a `li` element with the appropriate term classes. + $term_classes = "wp-block-term term-{$term->term_id} {$term->taxonomy} taxonomy-{$term->taxonomy}"; + + $content .= '
    10. ' . $block_content . '
    11. '; + } + + $classnames = ''; + + if ( isset( $attributes['style']['elements']['link']['color']['text'] ) ) { + $classnames .= 'has-link-color'; + } + + $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => trim( $classnames ) ) ); + + return sprintf( + '
        %s
      ', + $wrapper_attributes, + $content + ); +} + +/** + * Registers the `core/term-template` block on the server. + * + * @since 6.9.0 + */ +function register_block_core_term_template() { + register_block_type_from_metadata( + __DIR__ . '/term-template', + array( + 'render_callback' => 'render_block_core_term_template', + ) + ); +} +add_action( 'init', 'register_block_core_term_template' ); diff --git a/src/wp-includes/blocks/term-template/block.json b/src/wp-includes/blocks/term-template/block.json new file mode 100644 index 0000000000000..8914bf6376aa7 --- /dev/null +++ b/src/wp-includes/blocks/term-template/block.json @@ -0,0 +1,62 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "core/term-template", + "title": "Term Template", + "category": "theme", + "ancestor": [ "core/terms-query" ], + "description": "Contains the block elements used to render a taxonomy term, like the name, description, and more.", + "textdomain": "default", + "usesContext": [ "termQuery" ], + "supports": { + "anchor": true, + "reusable": false, + "html": false, + "align": [ "wide", "full" ], + "layout": true, + "color": { + "gradients": true, + "link": true, + "__experimentalDefaultControls": { + "background": true, + "text": true + } + }, + "typography": { + "fontSize": true, + "lineHeight": true, + "__experimentalFontFamily": true, + "__experimentalFontWeight": true, + "__experimentalFontStyle": true, + "__experimentalTextTransform": true, + "__experimentalTextDecoration": true, + "__experimentalLetterSpacing": true, + "__experimentalDefaultControls": { + "fontSize": true + } + }, + "spacing": { + "margin": true, + "padding": true, + "blockGap": { + "__experimentalDefault": "1.25em" + }, + "__experimentalDefaultControls": { + "blockGap": true, + "padding": false, + "margin": false + } + }, + "interactivity": { + "clientNavigation": true + }, + "__experimentalBorder": { + "radius": true, + "color": true, + "width": true, + "style": true + } + }, + "style": "wp-block-term-template", + "editorStyle": "wp-block-term-template-editor" +} diff --git a/src/wp-includes/blocks/terms-query/block.json b/src/wp-includes/blocks/terms-query/block.json new file mode 100644 index 0000000000000..1741de5e5b2fd --- /dev/null +++ b/src/wp-includes/blocks/terms-query/block.json @@ -0,0 +1,40 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "core/terms-query", + "title": "Terms Query", + "category": "theme", + "description": "An advanced block that allows displaying taxonomy terms based on different query parameters and visual configurations.", + "keywords": [ "terms", "taxonomy", "categories", "tags", "list" ], + "textdomain": "default", + "attributes": { + "termQuery": { + "type": "object", + "default": { + "perPage": 10, + "taxonomy": "category", + "order": "asc", + "orderBy": "name", + "include": [], + "hideEmpty": true, + "showNested": false, + "inherit": false + } + }, + "tagName": { + "type": "string", + "default": "div" + } + }, + "usesContext": [ "templateSlug" ], + "providesContext": { + "termQuery": "termQuery" + }, + "supports": { + "anchor": true, + "align": [ "wide", "full" ], + "html": false, + "layout": true, + "interactivity": true + } +} diff --git a/src/wp-includes/blocks/text-columns/block.json b/src/wp-includes/blocks/text-columns/block.json new file mode 100644 index 0000000000000..2599df111d34b --- /dev/null +++ b/src/wp-includes/blocks/text-columns/block.json @@ -0,0 +1,39 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "core/text-columns", + "title": "Text Columns (deprecated)", + "icon": "columns", + "category": "design", + "description": "This block is deprecated. Please use the Columns block instead.", + "textdomain": "default", + "attributes": { + "content": { + "type": "array", + "source": "query", + "selector": "p", + "query": { + "children": { + "type": "string", + "source": "html" + } + }, + "default": [ {}, {} ] + }, + "columns": { + "type": "number", + "default": 2 + }, + "width": { + "type": "string" + } + }, + "supports": { + "inserter": false, + "interactivity": { + "clientNavigation": true + } + }, + "editorStyle": "wp-block-text-columns-editor", + "style": "wp-block-text-columns" +} diff --git a/src/wp-includes/blocks/verse/block.json b/src/wp-includes/blocks/verse/block.json new file mode 100644 index 0000000000000..b9915711a7993 --- /dev/null +++ b/src/wp-includes/blocks/verse/block.json @@ -0,0 +1,77 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "core/verse", + "title": "Poetry", + "category": "text", + "description": "Insert poetry. Use special spacing formats. Or quote song lyrics.", + "keywords": [ "poetry", "poem", "verse", "stanza", "song", "lyrics" ], + "textdomain": "default", + "attributes": { + "content": { + "type": "rich-text", + "source": "rich-text", + "selector": "pre", + "__unstablePreserveWhiteSpace": true, + "role": "content" + } + }, + "supports": { + "anchor": true, + "background": { + "backgroundImage": true, + "backgroundSize": true, + "__experimentalDefaultControls": { + "backgroundImage": true + } + }, + "color": { + "gradients": true, + "link": true, + "__experimentalDefaultControls": { + "background": true, + "text": true + } + }, + "dimensions": { + "minHeight": true, + "__experimentalDefaultControls": { + "minHeight": false + } + }, + "typography": { + "fontSize": true, + "__experimentalFontFamily": true, + "lineHeight": true, + "textAlign": true, + "__experimentalFontStyle": true, + "__experimentalFontWeight": true, + "__experimentalLetterSpacing": true, + "__experimentalTextTransform": true, + "__experimentalTextDecoration": true, + "__experimentalWritingMode": true, + "__experimentalDefaultControls": { + "fontSize": true + } + }, + "spacing": { + "margin": true, + "padding": true, + "__experimentalDefaultControls": { + "margin": false, + "padding": false + } + }, + "__experimentalBorder": { + "radius": true, + "width": true, + "color": true, + "style": true + }, + "interactivity": { + "clientNavigation": true + } + }, + "style": "wp-block-verse", + "editorStyle": "wp-block-verse-editor" +} diff --git a/src/wp-includes/blocks/video.php b/src/wp-includes/blocks/video.php new file mode 100644 index 0000000000000..3696bdca3b2e8 --- /dev/null +++ b/src/wp-includes/blocks/video.php @@ -0,0 +1,91 @@ + 0 && $metadata['height'] > 0 ) + ) { + return $content; + } + + // Locate the VIDEO tag to add the dimensions. + $p = new WP_HTML_Tag_Processor( $content ); + if ( ! $p->next_tag( array( 'tag_name' => 'VIDEO' ) ) ) { + return $content; + } + + $p->set_attribute( 'width', (string) $metadata['width'] ); + $p->set_attribute( 'height', (string) $metadata['height'] ); + + /* + * The aspect-ratio style is needed due to an issue with the CSS spec: . + * Note that a style rule using attr() like the following cannot currently be used: + * + * .wp-block-video video[width][height] { + * aspect-ratio: attr(width type()) / attr(height type()); + * } + * + * This is because this attr() is yet only implemented in Chromium: . + */ + $style = $p->get_attribute( 'style' ); + if ( ! is_string( $style ) ) { + $style = ''; + } + $aspect_ratio_style = sprintf( 'aspect-ratio: %d / %d;', $metadata['width'], $metadata['height'] ); + $p->set_attribute( 'style', $aspect_ratio_style . $style ); + + return $p->get_updated_html(); +} + +/** + * Registers the `core/video` block on server. + * + * @since 6.9.0 + */ +function register_block_core_video(): void { + register_block_type_from_metadata( + __DIR__ . '/video', + array( + 'render_callback' => 'render_block_core_video', + ) + ); +} +add_action( 'init', 'register_block_core_video' ); diff --git a/src/wp-includes/blocks/video/block.json b/src/wp-includes/blocks/video/block.json new file mode 100644 index 0000000000000..d2dcd95365c3b --- /dev/null +++ b/src/wp-includes/blocks/video/block.json @@ -0,0 +1,102 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "core/video", + "title": "Video", + "category": "media", + "description": "Embed a video from your media library or upload a new one.", + "keywords": [ "movie" ], + "textdomain": "default", + "attributes": { + "autoplay": { + "type": "boolean", + "source": "attribute", + "selector": "video", + "attribute": "autoplay" + }, + "caption": { + "type": "rich-text", + "source": "rich-text", + "selector": "figcaption", + "role": "content" + }, + "controls": { + "type": "boolean", + "source": "attribute", + "selector": "video", + "attribute": "controls", + "default": true + }, + "id": { + "type": "number", + "role": "content" + }, + "loop": { + "type": "boolean", + "source": "attribute", + "selector": "video", + "attribute": "loop" + }, + "muted": { + "type": "boolean", + "source": "attribute", + "selector": "video", + "attribute": "muted" + }, + "poster": { + "type": "string", + "source": "attribute", + "selector": "video", + "attribute": "poster" + }, + "preload": { + "type": "string", + "source": "attribute", + "selector": "video", + "attribute": "preload", + "default": "metadata" + }, + "blob": { + "type": "string", + "role": "local" + }, + "src": { + "type": "string", + "source": "attribute", + "selector": "video", + "attribute": "src", + "role": "content" + }, + "playsInline": { + "type": "boolean", + "source": "attribute", + "selector": "video", + "attribute": "playsinline" + }, + "tracks": { + "role": "content", + "type": "array", + "items": { + "type": "object" + }, + "default": [] + } + }, + "supports": { + "anchor": true, + "align": true, + "spacing": { + "margin": true, + "padding": true, + "__experimentalDefaultControls": { + "margin": false, + "padding": false + } + }, + "interactivity": { + "clientNavigation": true + } + }, + "editorStyle": "wp-block-video-editor", + "style": "wp-block-video" +} diff --git a/src/wp-includes/blocks/widget-group.php b/src/wp-includes/blocks/widget-group.php new file mode 100644 index 0000000000000..e8769612a2f17 --- /dev/null +++ b/src/wp-includes/blocks/widget-group.php @@ -0,0 +1,93 @@ +'; + $after_title = ''; + } + + $html = ''; + + if ( ! empty( $attributes['title'] ) ) { + $html .= $before_title . esc_html( $attributes['title'] ) . $after_title; + } + + $html .= '
      '; + foreach ( $block->inner_blocks as $inner_block ) { + $html .= $inner_block->render(); + } + $html .= '
      '; + + return $html; +} + +/** + * Registers the 'core/widget-group' block. + * + * @since 5.9.0 + */ +function register_block_core_widget_group() { + register_block_type_from_metadata( + __DIR__ . '/widget-group', + array( + 'render_callback' => 'render_block_core_widget_group', + ) + ); +} + +add_action( 'init', 'register_block_core_widget_group' ); + +/** + * Make a note of the sidebar being rendered before WordPress starts rendering + * it. This lets us get to the current sidebar in + * render_block_core_widget_group(). + * + * @since 5.9.0 + * + * @global int|string $_sidebar_being_rendered + * + * @param int|string $index Index, name, or ID of the dynamic sidebar. + */ +function note_sidebar_being_rendered( $index ) { + global $_sidebar_being_rendered; + $_sidebar_being_rendered = $index; +} +add_action( 'dynamic_sidebar_before', 'note_sidebar_being_rendered' ); + +/** + * Clear whatever we set in note_sidebar_being_rendered() after WordPress + * finishes rendering a sidebar. + * + * @since 5.9.0 + * + * @global int|string $_sidebar_being_rendered + */ +function discard_sidebar_being_rendered() { + global $_sidebar_being_rendered; + unset( $_sidebar_being_rendered ); +} +add_action( 'dynamic_sidebar_after', 'discard_sidebar_being_rendered' ); diff --git a/src/wp-includes/blocks/widget-group/block.json b/src/wp-includes/blocks/widget-group/block.json new file mode 100644 index 0000000000000..6e7ba57b38dbc --- /dev/null +++ b/src/wp-includes/blocks/widget-group/block.json @@ -0,0 +1,20 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "core/widget-group", + "title": "Widget Group", + "category": "widgets", + "attributes": { + "title": { + "type": "string" + } + }, + "supports": { + "html": false, + "inserter": true, + "customClassName": true, + "reusable": false + }, + "editorStyle": "wp-block-widget-group-editor", + "style": "wp-block-widget-group" +} diff --git a/src/wp-includes/icons/library/accordion-heading.svg b/src/wp-includes/icons/library/accordion-heading.svg new file mode 100644 index 0000000000000..490a55584a8f6 --- /dev/null +++ b/src/wp-includes/icons/library/accordion-heading.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/wp-includes/icons/library/accordion-item.svg b/src/wp-includes/icons/library/accordion-item.svg new file mode 100644 index 0000000000000..7bb8649f9b15b --- /dev/null +++ b/src/wp-includes/icons/library/accordion-item.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/wp-includes/icons/library/accordion.svg b/src/wp-includes/icons/library/accordion.svg new file mode 100644 index 0000000000000..909d9150cfa79 --- /dev/null +++ b/src/wp-includes/icons/library/accordion.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/wp-includes/icons/library/add-card.svg b/src/wp-includes/icons/library/add-card.svg new file mode 100644 index 0000000000000..91a4565df6934 --- /dev/null +++ b/src/wp-includes/icons/library/add-card.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/add-submenu.svg b/src/wp-includes/icons/library/add-submenu.svg new file mode 100644 index 0000000000000..19f9b28f6366d --- /dev/null +++ b/src/wp-includes/icons/library/add-submenu.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/add-template.svg b/src/wp-includes/icons/library/add-template.svg new file mode 100644 index 0000000000000..31b6107afcb62 --- /dev/null +++ b/src/wp-includes/icons/library/add-template.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/align-center.svg b/src/wp-includes/icons/library/align-center.svg new file mode 100644 index 0000000000000..4a859d45cc2a0 --- /dev/null +++ b/src/wp-includes/icons/library/align-center.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/align-justify.svg b/src/wp-includes/icons/library/align-justify.svg new file mode 100644 index 0000000000000..52c22e430d43a --- /dev/null +++ b/src/wp-includes/icons/library/align-justify.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/align-left.svg b/src/wp-includes/icons/library/align-left.svg new file mode 100644 index 0000000000000..5b26154484352 --- /dev/null +++ b/src/wp-includes/icons/library/align-left.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/align-none.svg b/src/wp-includes/icons/library/align-none.svg new file mode 100644 index 0000000000000..30942087145e5 --- /dev/null +++ b/src/wp-includes/icons/library/align-none.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/align-right.svg b/src/wp-includes/icons/library/align-right.svg new file mode 100644 index 0000000000000..6ad90bdb89678 --- /dev/null +++ b/src/wp-includes/icons/library/align-right.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/archive.svg b/src/wp-includes/icons/library/archive.svg new file mode 100644 index 0000000000000..661a9782231ef --- /dev/null +++ b/src/wp-includes/icons/library/archive.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/arrow-down-left.svg b/src/wp-includes/icons/library/arrow-down-left.svg new file mode 100644 index 0000000000000..7ae619122cb18 --- /dev/null +++ b/src/wp-includes/icons/library/arrow-down-left.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/arrow-down-right.svg b/src/wp-includes/icons/library/arrow-down-right.svg new file mode 100644 index 0000000000000..96f3eaaa341f3 --- /dev/null +++ b/src/wp-includes/icons/library/arrow-down-right.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/arrow-down.svg b/src/wp-includes/icons/library/arrow-down.svg new file mode 100644 index 0000000000000..eec68fd0379db --- /dev/null +++ b/src/wp-includes/icons/library/arrow-down.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/arrow-left.svg b/src/wp-includes/icons/library/arrow-left.svg new file mode 100644 index 0000000000000..f0ad62990499b --- /dev/null +++ b/src/wp-includes/icons/library/arrow-left.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/arrow-right.svg b/src/wp-includes/icons/library/arrow-right.svg new file mode 100644 index 0000000000000..b1d35eb42725a --- /dev/null +++ b/src/wp-includes/icons/library/arrow-right.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/arrow-up-left.svg b/src/wp-includes/icons/library/arrow-up-left.svg new file mode 100644 index 0000000000000..ace24ff41421c --- /dev/null +++ b/src/wp-includes/icons/library/arrow-up-left.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/arrow-up-right.svg b/src/wp-includes/icons/library/arrow-up-right.svg new file mode 100644 index 0000000000000..ff9807df94919 --- /dev/null +++ b/src/wp-includes/icons/library/arrow-up-right.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/arrow-up.svg b/src/wp-includes/icons/library/arrow-up.svg new file mode 100644 index 0000000000000..bc68d5bee25ba --- /dev/null +++ b/src/wp-includes/icons/library/arrow-up.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/aspect-ratio.svg b/src/wp-includes/icons/library/aspect-ratio.svg new file mode 100644 index 0000000000000..8d83f7635ebd7 --- /dev/null +++ b/src/wp-includes/icons/library/aspect-ratio.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/at-symbol.svg b/src/wp-includes/icons/library/at-symbol.svg new file mode 100644 index 0000000000000..d7280813c6a9c --- /dev/null +++ b/src/wp-includes/icons/library/at-symbol.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/audio.svg b/src/wp-includes/icons/library/audio.svg new file mode 100644 index 0000000000000..3cdbe1181dc10 --- /dev/null +++ b/src/wp-includes/icons/library/audio.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/background.svg b/src/wp-includes/icons/library/background.svg new file mode 100644 index 0000000000000..166c1db70dd50 --- /dev/null +++ b/src/wp-includes/icons/library/background.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/backup.svg b/src/wp-includes/icons/library/backup.svg new file mode 100644 index 0000000000000..4abf701d41fed --- /dev/null +++ b/src/wp-includes/icons/library/backup.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/bell-unread.svg b/src/wp-includes/icons/library/bell-unread.svg new file mode 100644 index 0000000000000..efdedbf25d4b3 --- /dev/null +++ b/src/wp-includes/icons/library/bell-unread.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/wp-includes/icons/library/bell.svg b/src/wp-includes/icons/library/bell.svg new file mode 100644 index 0000000000000..c1bccda2275e7 --- /dev/null +++ b/src/wp-includes/icons/library/bell.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/block-default.svg b/src/wp-includes/icons/library/block-default.svg new file mode 100644 index 0000000000000..5c8e11103d994 --- /dev/null +++ b/src/wp-includes/icons/library/block-default.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/block-meta.svg b/src/wp-includes/icons/library/block-meta.svg new file mode 100644 index 0000000000000..81dfc1d3684d4 --- /dev/null +++ b/src/wp-includes/icons/library/block-meta.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/block-table.svg b/src/wp-includes/icons/library/block-table.svg new file mode 100644 index 0000000000000..44d91172e4c10 --- /dev/null +++ b/src/wp-includes/icons/library/block-table.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/border.svg b/src/wp-includes/icons/library/border.svg new file mode 100644 index 0000000000000..344181dccd79a --- /dev/null +++ b/src/wp-includes/icons/library/border.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/box.svg b/src/wp-includes/icons/library/box.svg new file mode 100644 index 0000000000000..396c4471cf40b --- /dev/null +++ b/src/wp-includes/icons/library/box.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/breadcrumbs.svg b/src/wp-includes/icons/library/breadcrumbs.svg new file mode 100644 index 0000000000000..96919bd87fe6c --- /dev/null +++ b/src/wp-includes/icons/library/breadcrumbs.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/brush.svg b/src/wp-includes/icons/library/brush.svg new file mode 100644 index 0000000000000..18dffa96f6993 --- /dev/null +++ b/src/wp-includes/icons/library/brush.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/bug.svg b/src/wp-includes/icons/library/bug.svg new file mode 100644 index 0000000000000..92ca3b18be2d8 --- /dev/null +++ b/src/wp-includes/icons/library/bug.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/button.svg b/src/wp-includes/icons/library/button.svg new file mode 100644 index 0000000000000..cbc2b05e75dcb --- /dev/null +++ b/src/wp-includes/icons/library/button.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/buttons.svg b/src/wp-includes/icons/library/buttons.svg new file mode 100644 index 0000000000000..fdc79c2b1b71d --- /dev/null +++ b/src/wp-includes/icons/library/buttons.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/calendar.svg b/src/wp-includes/icons/library/calendar.svg new file mode 100644 index 0000000000000..982890efb37a8 --- /dev/null +++ b/src/wp-includes/icons/library/calendar.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/cancel-circle-filled.svg b/src/wp-includes/icons/library/cancel-circle-filled.svg new file mode 100644 index 0000000000000..63dce97f38000 --- /dev/null +++ b/src/wp-includes/icons/library/cancel-circle-filled.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/caption.svg b/src/wp-includes/icons/library/caption.svg new file mode 100644 index 0000000000000..0fff644fb6176 --- /dev/null +++ b/src/wp-includes/icons/library/caption.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/capture-photo.svg b/src/wp-includes/icons/library/capture-photo.svg new file mode 100644 index 0000000000000..9322db371f060 --- /dev/null +++ b/src/wp-includes/icons/library/capture-photo.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/capture-video.svg b/src/wp-includes/icons/library/capture-video.svg new file mode 100644 index 0000000000000..5fde23efb3d04 --- /dev/null +++ b/src/wp-includes/icons/library/capture-video.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/cart.svg b/src/wp-includes/icons/library/cart.svg new file mode 100644 index 0000000000000..5bf6f6d45f559 --- /dev/null +++ b/src/wp-includes/icons/library/cart.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/category.svg b/src/wp-includes/icons/library/category.svg new file mode 100644 index 0000000000000..3b36e4f2fc00c --- /dev/null +++ b/src/wp-includes/icons/library/category.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/caution-filled.svg b/src/wp-includes/icons/library/caution-filled.svg new file mode 100644 index 0000000000000..6b35a8ea4d022 --- /dev/null +++ b/src/wp-includes/icons/library/caution-filled.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/caution.svg b/src/wp-includes/icons/library/caution.svg new file mode 100644 index 0000000000000..3e6c70c263b9a --- /dev/null +++ b/src/wp-includes/icons/library/caution.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/chart-bar.svg b/src/wp-includes/icons/library/chart-bar.svg new file mode 100644 index 0000000000000..c2bcf26f58a35 --- /dev/null +++ b/src/wp-includes/icons/library/chart-bar.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/check.svg b/src/wp-includes/icons/library/check.svg new file mode 100644 index 0000000000000..af0a393450169 --- /dev/null +++ b/src/wp-includes/icons/library/check.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/chevron-down-small.svg b/src/wp-includes/icons/library/chevron-down-small.svg new file mode 100644 index 0000000000000..c8fb1bfffa2f0 --- /dev/null +++ b/src/wp-includes/icons/library/chevron-down-small.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/chevron-down.svg b/src/wp-includes/icons/library/chevron-down.svg new file mode 100644 index 0000000000000..bd3f8fb059df5 --- /dev/null +++ b/src/wp-includes/icons/library/chevron-down.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/chevron-left-small.svg b/src/wp-includes/icons/library/chevron-left-small.svg new file mode 100644 index 0000000000000..b2ca179d1a59e --- /dev/null +++ b/src/wp-includes/icons/library/chevron-left-small.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/chevron-left.svg b/src/wp-includes/icons/library/chevron-left.svg new file mode 100644 index 0000000000000..6276e30f924a8 --- /dev/null +++ b/src/wp-includes/icons/library/chevron-left.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/chevron-right-small.svg b/src/wp-includes/icons/library/chevron-right-small.svg new file mode 100644 index 0000000000000..956ca53c66147 --- /dev/null +++ b/src/wp-includes/icons/library/chevron-right-small.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/chevron-right.svg b/src/wp-includes/icons/library/chevron-right.svg new file mode 100644 index 0000000000000..d4b7d6dac2b96 --- /dev/null +++ b/src/wp-includes/icons/library/chevron-right.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/chevron-up-down.svg b/src/wp-includes/icons/library/chevron-up-down.svg new file mode 100644 index 0000000000000..7cdd5d61d0497 --- /dev/null +++ b/src/wp-includes/icons/library/chevron-up-down.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/chevron-up-small.svg b/src/wp-includes/icons/library/chevron-up-small.svg new file mode 100644 index 0000000000000..e6be7bd3b841e --- /dev/null +++ b/src/wp-includes/icons/library/chevron-up-small.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/chevron-up.svg b/src/wp-includes/icons/library/chevron-up.svg new file mode 100644 index 0000000000000..59db09c28b612 --- /dev/null +++ b/src/wp-includes/icons/library/chevron-up.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/classic.svg b/src/wp-includes/icons/library/classic.svg new file mode 100644 index 0000000000000..d27703521a3cf --- /dev/null +++ b/src/wp-includes/icons/library/classic.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/close-small.svg b/src/wp-includes/icons/library/close-small.svg new file mode 100644 index 0000000000000..5ba16b5c710f7 --- /dev/null +++ b/src/wp-includes/icons/library/close-small.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/close.svg b/src/wp-includes/icons/library/close.svg new file mode 100644 index 0000000000000..75be939490410 --- /dev/null +++ b/src/wp-includes/icons/library/close.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/cloud-download.svg b/src/wp-includes/icons/library/cloud-download.svg new file mode 100644 index 0000000000000..6d2125241572b --- /dev/null +++ b/src/wp-includes/icons/library/cloud-download.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/cloud-upload.svg b/src/wp-includes/icons/library/cloud-upload.svg new file mode 100644 index 0000000000000..513159068a773 --- /dev/null +++ b/src/wp-includes/icons/library/cloud-upload.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/cloud.svg b/src/wp-includes/icons/library/cloud.svg new file mode 100644 index 0000000000000..9fb89b1aac649 --- /dev/null +++ b/src/wp-includes/icons/library/cloud.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/code.svg b/src/wp-includes/icons/library/code.svg new file mode 100644 index 0000000000000..24d4bdccbd5a2 --- /dev/null +++ b/src/wp-includes/icons/library/code.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/cog.svg b/src/wp-includes/icons/library/cog.svg new file mode 100644 index 0000000000000..d8b4b82c02c2d --- /dev/null +++ b/src/wp-includes/icons/library/cog.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/color.svg b/src/wp-includes/icons/library/color.svg new file mode 100644 index 0000000000000..07e1a13011a10 --- /dev/null +++ b/src/wp-includes/icons/library/color.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/column.svg b/src/wp-includes/icons/library/column.svg new file mode 100644 index 0000000000000..bd7e1e71e696a --- /dev/null +++ b/src/wp-includes/icons/library/column.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/columns.svg b/src/wp-includes/icons/library/columns.svg new file mode 100644 index 0000000000000..dc376abf5013d --- /dev/null +++ b/src/wp-includes/icons/library/columns.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/comment-author-avatar.svg b/src/wp-includes/icons/library/comment-author-avatar.svg new file mode 100644 index 0000000000000..d26ae18218da4 --- /dev/null +++ b/src/wp-includes/icons/library/comment-author-avatar.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/comment-author-name.svg b/src/wp-includes/icons/library/comment-author-name.svg new file mode 100644 index 0000000000000..260be0a635ba0 --- /dev/null +++ b/src/wp-includes/icons/library/comment-author-name.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/wp-includes/icons/library/comment-content.svg b/src/wp-includes/icons/library/comment-content.svg new file mode 100644 index 0000000000000..7094932f8e9cb --- /dev/null +++ b/src/wp-includes/icons/library/comment-content.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/comment-edit-link.svg b/src/wp-includes/icons/library/comment-edit-link.svg new file mode 100644 index 0000000000000..db400e2e871d9 --- /dev/null +++ b/src/wp-includes/icons/library/comment-edit-link.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/comment-reply-link.svg b/src/wp-includes/icons/library/comment-reply-link.svg new file mode 100644 index 0000000000000..49c79270c08a1 --- /dev/null +++ b/src/wp-includes/icons/library/comment-reply-link.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/comment.svg b/src/wp-includes/icons/library/comment.svg new file mode 100644 index 0000000000000..c95cfe7421875 --- /dev/null +++ b/src/wp-includes/icons/library/comment.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/connection.svg b/src/wp-includes/icons/library/connection.svg new file mode 100644 index 0000000000000..2193bd27a5f2c --- /dev/null +++ b/src/wp-includes/icons/library/connection.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/contents.svg b/src/wp-includes/icons/library/contents.svg new file mode 100644 index 0000000000000..c0e26159bef0f --- /dev/null +++ b/src/wp-includes/icons/library/contents.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/copy-small.svg b/src/wp-includes/icons/library/copy-small.svg new file mode 100644 index 0000000000000..40439846218e6 --- /dev/null +++ b/src/wp-includes/icons/library/copy-small.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/copy.svg b/src/wp-includes/icons/library/copy.svg new file mode 100644 index 0000000000000..8acb3bf068658 --- /dev/null +++ b/src/wp-includes/icons/library/copy.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/corner-all.svg b/src/wp-includes/icons/library/corner-all.svg new file mode 100644 index 0000000000000..455870f0f0127 --- /dev/null +++ b/src/wp-includes/icons/library/corner-all.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/corner-bottom-left.svg b/src/wp-includes/icons/library/corner-bottom-left.svg new file mode 100644 index 0000000000000..73ae5297c8fca --- /dev/null +++ b/src/wp-includes/icons/library/corner-bottom-left.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/wp-includes/icons/library/corner-bottom-right.svg b/src/wp-includes/icons/library/corner-bottom-right.svg new file mode 100644 index 0000000000000..9d8416abc5c8a --- /dev/null +++ b/src/wp-includes/icons/library/corner-bottom-right.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/wp-includes/icons/library/corner-top-left.svg b/src/wp-includes/icons/library/corner-top-left.svg new file mode 100644 index 0000000000000..d1c72c1b9d6c3 --- /dev/null +++ b/src/wp-includes/icons/library/corner-top-left.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/wp-includes/icons/library/corner-top-right.svg b/src/wp-includes/icons/library/corner-top-right.svg new file mode 100644 index 0000000000000..bf806bb899a3c --- /dev/null +++ b/src/wp-includes/icons/library/corner-top-right.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/wp-includes/icons/library/cover.svg b/src/wp-includes/icons/library/cover.svg new file mode 100644 index 0000000000000..d625a018cda7f --- /dev/null +++ b/src/wp-includes/icons/library/cover.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/create.svg b/src/wp-includes/icons/library/create.svg new file mode 100644 index 0000000000000..3e96b8596ee47 --- /dev/null +++ b/src/wp-includes/icons/library/create.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/crop.svg b/src/wp-includes/icons/library/crop.svg new file mode 100644 index 0000000000000..b56abed30292b --- /dev/null +++ b/src/wp-includes/icons/library/crop.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/currency-dollar.svg b/src/wp-includes/icons/library/currency-dollar.svg new file mode 100644 index 0000000000000..80089d8d68c35 --- /dev/null +++ b/src/wp-includes/icons/library/currency-dollar.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/currency-euro.svg b/src/wp-includes/icons/library/currency-euro.svg new file mode 100644 index 0000000000000..2e57f3726ec9e --- /dev/null +++ b/src/wp-includes/icons/library/currency-euro.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/currency-pound.svg b/src/wp-includes/icons/library/currency-pound.svg new file mode 100644 index 0000000000000..5a86fa25075e9 --- /dev/null +++ b/src/wp-includes/icons/library/currency-pound.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/custom-link.svg b/src/wp-includes/icons/library/custom-link.svg new file mode 100644 index 0000000000000..6294804a2acc9 --- /dev/null +++ b/src/wp-includes/icons/library/custom-link.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/custom-post-type.svg b/src/wp-includes/icons/library/custom-post-type.svg new file mode 100644 index 0000000000000..7c91be9bf21b2 --- /dev/null +++ b/src/wp-includes/icons/library/custom-post-type.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/dashboard.svg b/src/wp-includes/icons/library/dashboard.svg new file mode 100644 index 0000000000000..374d5ba916f7b --- /dev/null +++ b/src/wp-includes/icons/library/dashboard.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/desktop.svg b/src/wp-includes/icons/library/desktop.svg new file mode 100644 index 0000000000000..9d8a699f91834 --- /dev/null +++ b/src/wp-includes/icons/library/desktop.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/details.svg b/src/wp-includes/icons/library/details.svg new file mode 100644 index 0000000000000..cdc6d8cbdf2b3 --- /dev/null +++ b/src/wp-includes/icons/library/details.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/wp-includes/icons/library/download.svg b/src/wp-includes/icons/library/download.svg new file mode 100644 index 0000000000000..9d3fbe682d25b --- /dev/null +++ b/src/wp-includes/icons/library/download.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/drafts.svg b/src/wp-includes/icons/library/drafts.svg new file mode 100644 index 0000000000000..4cd55eee757b5 --- /dev/null +++ b/src/wp-includes/icons/library/drafts.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/drag-handle.svg b/src/wp-includes/icons/library/drag-handle.svg new file mode 100644 index 0000000000000..e8012fd7721f9 --- /dev/null +++ b/src/wp-includes/icons/library/drag-handle.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/drawer-left.svg b/src/wp-includes/icons/library/drawer-left.svg new file mode 100644 index 0000000000000..c0fd465b61f40 --- /dev/null +++ b/src/wp-includes/icons/library/drawer-left.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/drawer-right.svg b/src/wp-includes/icons/library/drawer-right.svg new file mode 100644 index 0000000000000..7b22105ae5a5d --- /dev/null +++ b/src/wp-includes/icons/library/drawer-right.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/envelope.svg b/src/wp-includes/icons/library/envelope.svg new file mode 100644 index 0000000000000..f41c0a915ba60 --- /dev/null +++ b/src/wp-includes/icons/library/envelope.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/error.svg b/src/wp-includes/icons/library/error.svg new file mode 100644 index 0000000000000..006d6aec28ca2 --- /dev/null +++ b/src/wp-includes/icons/library/error.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/external.svg b/src/wp-includes/icons/library/external.svg new file mode 100644 index 0000000000000..aa3348828b006 --- /dev/null +++ b/src/wp-includes/icons/library/external.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/file.svg b/src/wp-includes/icons/library/file.svg new file mode 100644 index 0000000000000..0144266c4425e --- /dev/null +++ b/src/wp-includes/icons/library/file.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/filter.svg b/src/wp-includes/icons/library/filter.svg new file mode 100644 index 0000000000000..6e83e036d0856 --- /dev/null +++ b/src/wp-includes/icons/library/filter.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/flip-horizontal.svg b/src/wp-includes/icons/library/flip-horizontal.svg new file mode 100644 index 0000000000000..62464773c0a76 --- /dev/null +++ b/src/wp-includes/icons/library/flip-horizontal.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/flip-vertical.svg b/src/wp-includes/icons/library/flip-vertical.svg new file mode 100644 index 0000000000000..a9ca7edc29bd7 --- /dev/null +++ b/src/wp-includes/icons/library/flip-vertical.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/footer.svg b/src/wp-includes/icons/library/footer.svg new file mode 100644 index 0000000000000..e888b893caf61 --- /dev/null +++ b/src/wp-includes/icons/library/footer.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/format-bold.svg b/src/wp-includes/icons/library/format-bold.svg new file mode 100644 index 0000000000000..89b84e8810fb2 --- /dev/null +++ b/src/wp-includes/icons/library/format-bold.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/format-capitalize.svg b/src/wp-includes/icons/library/format-capitalize.svg new file mode 100644 index 0000000000000..9dda39c17d68e --- /dev/null +++ b/src/wp-includes/icons/library/format-capitalize.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/format-indent-rtl.svg b/src/wp-includes/icons/library/format-indent-rtl.svg new file mode 100644 index 0000000000000..c85346d08b5fc --- /dev/null +++ b/src/wp-includes/icons/library/format-indent-rtl.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/format-indent.svg b/src/wp-includes/icons/library/format-indent.svg new file mode 100644 index 0000000000000..a89e7d313d386 --- /dev/null +++ b/src/wp-includes/icons/library/format-indent.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/format-italic.svg b/src/wp-includes/icons/library/format-italic.svg new file mode 100644 index 0000000000000..fc2c5380a8d3e --- /dev/null +++ b/src/wp-includes/icons/library/format-italic.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/format-list-bullets-rtl.svg b/src/wp-includes/icons/library/format-list-bullets-rtl.svg new file mode 100644 index 0000000000000..ecbcd95ee849b --- /dev/null +++ b/src/wp-includes/icons/library/format-list-bullets-rtl.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/format-list-bullets.svg b/src/wp-includes/icons/library/format-list-bullets.svg new file mode 100644 index 0000000000000..7c855d82938ce --- /dev/null +++ b/src/wp-includes/icons/library/format-list-bullets.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/format-list-numbered-rtl.svg b/src/wp-includes/icons/library/format-list-numbered-rtl.svg new file mode 100644 index 0000000000000..e976b85248f19 --- /dev/null +++ b/src/wp-includes/icons/library/format-list-numbered-rtl.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/format-list-numbered.svg b/src/wp-includes/icons/library/format-list-numbered.svg new file mode 100644 index 0000000000000..4febed3ea87a0 --- /dev/null +++ b/src/wp-includes/icons/library/format-list-numbered.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/format-lowercase.svg b/src/wp-includes/icons/library/format-lowercase.svg new file mode 100644 index 0000000000000..ccb9e2f07a7a4 --- /dev/null +++ b/src/wp-includes/icons/library/format-lowercase.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/format-ltr.svg b/src/wp-includes/icons/library/format-ltr.svg new file mode 100644 index 0000000000000..efc114919be8d --- /dev/null +++ b/src/wp-includes/icons/library/format-ltr.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/format-outdent-rtl.svg b/src/wp-includes/icons/library/format-outdent-rtl.svg new file mode 100644 index 0000000000000..c09ce6e45b511 --- /dev/null +++ b/src/wp-includes/icons/library/format-outdent-rtl.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/format-outdent.svg b/src/wp-includes/icons/library/format-outdent.svg new file mode 100644 index 0000000000000..87a656789531a --- /dev/null +++ b/src/wp-includes/icons/library/format-outdent.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/format-rtl.svg b/src/wp-includes/icons/library/format-rtl.svg new file mode 100644 index 0000000000000..e2438fb7ca237 --- /dev/null +++ b/src/wp-includes/icons/library/format-rtl.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/format-strikethrough.svg b/src/wp-includes/icons/library/format-strikethrough.svg new file mode 100644 index 0000000000000..e4b87f5dbe1fe --- /dev/null +++ b/src/wp-includes/icons/library/format-strikethrough.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/format-underline.svg b/src/wp-includes/icons/library/format-underline.svg new file mode 100644 index 0000000000000..be2f1b5cb4f87 --- /dev/null +++ b/src/wp-includes/icons/library/format-underline.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/format-uppercase.svg b/src/wp-includes/icons/library/format-uppercase.svg new file mode 100644 index 0000000000000..6521cb22e029a --- /dev/null +++ b/src/wp-includes/icons/library/format-uppercase.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/full-height.svg b/src/wp-includes/icons/library/full-height.svg new file mode 100644 index 0000000000000..cbe69cfb604a3 --- /dev/null +++ b/src/wp-includes/icons/library/full-height.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/fullscreen.svg b/src/wp-includes/icons/library/fullscreen.svg new file mode 100644 index 0000000000000..18dde7bea3e75 --- /dev/null +++ b/src/wp-includes/icons/library/fullscreen.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/funnel.svg b/src/wp-includes/icons/library/funnel.svg new file mode 100644 index 0000000000000..903a7ec4ab215 --- /dev/null +++ b/src/wp-includes/icons/library/funnel.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/gallery.svg b/src/wp-includes/icons/library/gallery.svg new file mode 100644 index 0000000000000..389a918817fcb --- /dev/null +++ b/src/wp-includes/icons/library/gallery.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/gift.svg b/src/wp-includes/icons/library/gift.svg new file mode 100644 index 0000000000000..39727cb9fa491 --- /dev/null +++ b/src/wp-includes/icons/library/gift.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/globe.svg b/src/wp-includes/icons/library/globe.svg new file mode 100644 index 0000000000000..5c1274db85467 --- /dev/null +++ b/src/wp-includes/icons/library/globe.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/grid.svg b/src/wp-includes/icons/library/grid.svg new file mode 100644 index 0000000000000..62617fcb82680 --- /dev/null +++ b/src/wp-includes/icons/library/grid.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/group.svg b/src/wp-includes/icons/library/group.svg new file mode 100644 index 0000000000000..8f00bd1d043d2 --- /dev/null +++ b/src/wp-includes/icons/library/group.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/handle.svg b/src/wp-includes/icons/library/handle.svg new file mode 100644 index 0000000000000..3dd7cb09a490b --- /dev/null +++ b/src/wp-includes/icons/library/handle.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/header.svg b/src/wp-includes/icons/library/header.svg new file mode 100644 index 0000000000000..5d051294f2802 --- /dev/null +++ b/src/wp-includes/icons/library/header.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/heading-level-1.svg b/src/wp-includes/icons/library/heading-level-1.svg new file mode 100644 index 0000000000000..8cfb64f53f8f8 --- /dev/null +++ b/src/wp-includes/icons/library/heading-level-1.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/heading-level-2.svg b/src/wp-includes/icons/library/heading-level-2.svg new file mode 100644 index 0000000000000..cf38f4d17adef --- /dev/null +++ b/src/wp-includes/icons/library/heading-level-2.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/heading-level-3.svg b/src/wp-includes/icons/library/heading-level-3.svg new file mode 100644 index 0000000000000..03d52fee98d61 --- /dev/null +++ b/src/wp-includes/icons/library/heading-level-3.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/heading-level-4.svg b/src/wp-includes/icons/library/heading-level-4.svg new file mode 100644 index 0000000000000..556d57faa256c --- /dev/null +++ b/src/wp-includes/icons/library/heading-level-4.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/heading-level-5.svg b/src/wp-includes/icons/library/heading-level-5.svg new file mode 100644 index 0000000000000..6f4858ef0bc5f --- /dev/null +++ b/src/wp-includes/icons/library/heading-level-5.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/heading-level-6.svg b/src/wp-includes/icons/library/heading-level-6.svg new file mode 100644 index 0000000000000..511099d84a27a --- /dev/null +++ b/src/wp-includes/icons/library/heading-level-6.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/heading.svg b/src/wp-includes/icons/library/heading.svg new file mode 100644 index 0000000000000..51f90adaa39c2 --- /dev/null +++ b/src/wp-includes/icons/library/heading.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/help-filled.svg b/src/wp-includes/icons/library/help-filled.svg new file mode 100644 index 0000000000000..9c8cf7e6b5c07 --- /dev/null +++ b/src/wp-includes/icons/library/help-filled.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/help.svg b/src/wp-includes/icons/library/help.svg new file mode 100644 index 0000000000000..ae2167edb7ce5 --- /dev/null +++ b/src/wp-includes/icons/library/help.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/home-button.svg b/src/wp-includes/icons/library/home-button.svg new file mode 100644 index 0000000000000..c9798175aa921 --- /dev/null +++ b/src/wp-includes/icons/library/home-button.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/home.svg b/src/wp-includes/icons/library/home.svg new file mode 100644 index 0000000000000..bedfb6e00f593 --- /dev/null +++ b/src/wp-includes/icons/library/home.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/html.svg b/src/wp-includes/icons/library/html.svg new file mode 100644 index 0000000000000..da3eafd242cf3 --- /dev/null +++ b/src/wp-includes/icons/library/html.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/image.svg b/src/wp-includes/icons/library/image.svg new file mode 100644 index 0000000000000..e14678e2cf4ab --- /dev/null +++ b/src/wp-includes/icons/library/image.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/inbox.svg b/src/wp-includes/icons/library/inbox.svg new file mode 100644 index 0000000000000..af82f9eb05e2a --- /dev/null +++ b/src/wp-includes/icons/library/inbox.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/info.svg b/src/wp-includes/icons/library/info.svg new file mode 100644 index 0000000000000..9d7afc85fae83 --- /dev/null +++ b/src/wp-includes/icons/library/info.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/insert-after.svg b/src/wp-includes/icons/library/insert-after.svg new file mode 100644 index 0000000000000..6743fe8043803 --- /dev/null +++ b/src/wp-includes/icons/library/insert-after.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/insert-before.svg b/src/wp-includes/icons/library/insert-before.svg new file mode 100644 index 0000000000000..90ceb9c31fb7a --- /dev/null +++ b/src/wp-includes/icons/library/insert-before.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/institution.svg b/src/wp-includes/icons/library/institution.svg new file mode 100644 index 0000000000000..fa5e94b06cf04 --- /dev/null +++ b/src/wp-includes/icons/library/institution.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/justify-bottom.svg b/src/wp-includes/icons/library/justify-bottom.svg new file mode 100644 index 0000000000000..983f354b08d9d --- /dev/null +++ b/src/wp-includes/icons/library/justify-bottom.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/justify-center-vertical.svg b/src/wp-includes/icons/library/justify-center-vertical.svg new file mode 100644 index 0000000000000..09fa620daedc5 --- /dev/null +++ b/src/wp-includes/icons/library/justify-center-vertical.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/justify-center.svg b/src/wp-includes/icons/library/justify-center.svg new file mode 100644 index 0000000000000..17eb01f512295 --- /dev/null +++ b/src/wp-includes/icons/library/justify-center.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/justify-left.svg b/src/wp-includes/icons/library/justify-left.svg new file mode 100644 index 0000000000000..f3913733ecf92 --- /dev/null +++ b/src/wp-includes/icons/library/justify-left.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/justify-right.svg b/src/wp-includes/icons/library/justify-right.svg new file mode 100644 index 0000000000000..6238f51099b5f --- /dev/null +++ b/src/wp-includes/icons/library/justify-right.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/justify-space-between-vertical.svg b/src/wp-includes/icons/library/justify-space-between-vertical.svg new file mode 100644 index 0000000000000..1fb2a4145c22f --- /dev/null +++ b/src/wp-includes/icons/library/justify-space-between-vertical.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/justify-space-between.svg b/src/wp-includes/icons/library/justify-space-between.svg new file mode 100644 index 0000000000000..f562659d010a0 --- /dev/null +++ b/src/wp-includes/icons/library/justify-space-between.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/justify-stretch-vertical.svg b/src/wp-includes/icons/library/justify-stretch-vertical.svg new file mode 100644 index 0000000000000..cff13e239deac --- /dev/null +++ b/src/wp-includes/icons/library/justify-stretch-vertical.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/justify-stretch.svg b/src/wp-includes/icons/library/justify-stretch.svg new file mode 100644 index 0000000000000..5e7d892b5b717 --- /dev/null +++ b/src/wp-includes/icons/library/justify-stretch.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/justify-top.svg b/src/wp-includes/icons/library/justify-top.svg new file mode 100644 index 0000000000000..2e0bfacd43dd9 --- /dev/null +++ b/src/wp-includes/icons/library/justify-top.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/key.svg b/src/wp-includes/icons/library/key.svg new file mode 100644 index 0000000000000..b04dde57aa7fa --- /dev/null +++ b/src/wp-includes/icons/library/key.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/keyboard-close.svg b/src/wp-includes/icons/library/keyboard-close.svg new file mode 100644 index 0000000000000..db193d038e347 --- /dev/null +++ b/src/wp-includes/icons/library/keyboard-close.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/keyboard-return.svg b/src/wp-includes/icons/library/keyboard-return.svg new file mode 100644 index 0000000000000..db53403b3db6a --- /dev/null +++ b/src/wp-includes/icons/library/keyboard-return.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/keyboard.svg b/src/wp-includes/icons/library/keyboard.svg new file mode 100644 index 0000000000000..34fcf1a2e5fa4 --- /dev/null +++ b/src/wp-includes/icons/library/keyboard.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/wp-includes/icons/library/language.svg b/src/wp-includes/icons/library/language.svg new file mode 100644 index 0000000000000..42b3b549824f2 --- /dev/null +++ b/src/wp-includes/icons/library/language.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/layout.svg b/src/wp-includes/icons/library/layout.svg new file mode 100644 index 0000000000000..9179ce8e9b1db --- /dev/null +++ b/src/wp-includes/icons/library/layout.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/level-up.svg b/src/wp-includes/icons/library/level-up.svg new file mode 100644 index 0000000000000..fbd9a5d69c483 --- /dev/null +++ b/src/wp-includes/icons/library/level-up.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/lifesaver.svg b/src/wp-includes/icons/library/lifesaver.svg new file mode 100644 index 0000000000000..766784ed531bd --- /dev/null +++ b/src/wp-includes/icons/library/lifesaver.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/line-dashed.svg b/src/wp-includes/icons/library/line-dashed.svg new file mode 100644 index 0000000000000..0fff9b3f2bfe5 --- /dev/null +++ b/src/wp-includes/icons/library/line-dashed.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/line-dotted.svg b/src/wp-includes/icons/library/line-dotted.svg new file mode 100644 index 0000000000000..ba9ff4a2b299e --- /dev/null +++ b/src/wp-includes/icons/library/line-dotted.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/line-solid.svg b/src/wp-includes/icons/library/line-solid.svg new file mode 100644 index 0000000000000..95aa7137b5bdb --- /dev/null +++ b/src/wp-includes/icons/library/line-solid.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/link-off.svg b/src/wp-includes/icons/library/link-off.svg new file mode 100644 index 0000000000000..bb22938f6522a --- /dev/null +++ b/src/wp-includes/icons/library/link-off.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/link.svg b/src/wp-includes/icons/library/link.svg new file mode 100644 index 0000000000000..5be28f494efe5 --- /dev/null +++ b/src/wp-includes/icons/library/link.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/list-item.svg b/src/wp-includes/icons/library/list-item.svg new file mode 100644 index 0000000000000..96f60ae5cf213 --- /dev/null +++ b/src/wp-includes/icons/library/list-item.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/list-view.svg b/src/wp-includes/icons/library/list-view.svg new file mode 100644 index 0000000000000..3df1c41cbffeb --- /dev/null +++ b/src/wp-includes/icons/library/list-view.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/list.svg b/src/wp-includes/icons/library/list.svg new file mode 100644 index 0000000000000..1178564a6b81d --- /dev/null +++ b/src/wp-includes/icons/library/list.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/lock-outline.svg b/src/wp-includes/icons/library/lock-outline.svg new file mode 100644 index 0000000000000..aae2b8e0d25dd --- /dev/null +++ b/src/wp-includes/icons/library/lock-outline.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/lock-small.svg b/src/wp-includes/icons/library/lock-small.svg new file mode 100644 index 0000000000000..68c43b0e94e45 --- /dev/null +++ b/src/wp-includes/icons/library/lock-small.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/lock.svg b/src/wp-includes/icons/library/lock.svg new file mode 100644 index 0000000000000..4c51bf5efc8a4 --- /dev/null +++ b/src/wp-includes/icons/library/lock.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/login.svg b/src/wp-includes/icons/library/login.svg new file mode 100644 index 0000000000000..220c8635b92cc --- /dev/null +++ b/src/wp-includes/icons/library/login.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/loop.svg b/src/wp-includes/icons/library/loop.svg new file mode 100644 index 0000000000000..eaf69f00a6d41 --- /dev/null +++ b/src/wp-includes/icons/library/loop.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/map-marker.svg b/src/wp-includes/icons/library/map-marker.svg new file mode 100644 index 0000000000000..09102ac0ce2bc --- /dev/null +++ b/src/wp-includes/icons/library/map-marker.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/math.svg b/src/wp-includes/icons/library/math.svg new file mode 100644 index 0000000000000..eeda5f831717e --- /dev/null +++ b/src/wp-includes/icons/library/math.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/media-and-text.svg b/src/wp-includes/icons/library/media-and-text.svg new file mode 100644 index 0000000000000..d63b328cb4abe --- /dev/null +++ b/src/wp-includes/icons/library/media-and-text.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/media.svg b/src/wp-includes/icons/library/media.svg new file mode 100644 index 0000000000000..c529ab8413db1 --- /dev/null +++ b/src/wp-includes/icons/library/media.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/wp-includes/icons/library/megaphone.svg b/src/wp-includes/icons/library/megaphone.svg new file mode 100644 index 0000000000000..0a76cbd05a5c7 --- /dev/null +++ b/src/wp-includes/icons/library/megaphone.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/menu.svg b/src/wp-includes/icons/library/menu.svg new file mode 100644 index 0000000000000..58c9c4d2701c9 --- /dev/null +++ b/src/wp-includes/icons/library/menu.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/mobile.svg b/src/wp-includes/icons/library/mobile.svg new file mode 100644 index 0000000000000..90410b38463b2 --- /dev/null +++ b/src/wp-includes/icons/library/mobile.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/more-horizontal.svg b/src/wp-includes/icons/library/more-horizontal.svg new file mode 100644 index 0000000000000..9abb19ec73607 --- /dev/null +++ b/src/wp-includes/icons/library/more-horizontal.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/more-vertical.svg b/src/wp-includes/icons/library/more-vertical.svg new file mode 100644 index 0000000000000..469a873d1f01f --- /dev/null +++ b/src/wp-includes/icons/library/more-vertical.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/more.svg b/src/wp-includes/icons/library/more.svg new file mode 100644 index 0000000000000..f1264ebba4fc2 --- /dev/null +++ b/src/wp-includes/icons/library/more.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/move-to.svg b/src/wp-includes/icons/library/move-to.svg new file mode 100644 index 0000000000000..26cf713a06c36 --- /dev/null +++ b/src/wp-includes/icons/library/move-to.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/navigation-overlay.svg b/src/wp-includes/icons/library/navigation-overlay.svg new file mode 100644 index 0000000000000..83425951477b7 --- /dev/null +++ b/src/wp-includes/icons/library/navigation-overlay.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/navigation.svg b/src/wp-includes/icons/library/navigation.svg new file mode 100644 index 0000000000000..9897b55a11927 --- /dev/null +++ b/src/wp-includes/icons/library/navigation.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/next.svg b/src/wp-includes/icons/library/next.svg new file mode 100644 index 0000000000000..c4a9b1b454b38 --- /dev/null +++ b/src/wp-includes/icons/library/next.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/not-allowed.svg b/src/wp-includes/icons/library/not-allowed.svg new file mode 100644 index 0000000000000..4550385ac2e3a --- /dev/null +++ b/src/wp-includes/icons/library/not-allowed.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/not-found.svg b/src/wp-includes/icons/library/not-found.svg new file mode 100644 index 0000000000000..a436d883f5ac7 --- /dev/null +++ b/src/wp-includes/icons/library/not-found.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/offline.svg b/src/wp-includes/icons/library/offline.svg new file mode 100644 index 0000000000000..ddd432987997f --- /dev/null +++ b/src/wp-includes/icons/library/offline.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/overlay-text.svg b/src/wp-includes/icons/library/overlay-text.svg new file mode 100644 index 0000000000000..0b15b071b67a6 --- /dev/null +++ b/src/wp-includes/icons/library/overlay-text.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/page-break.svg b/src/wp-includes/icons/library/page-break.svg new file mode 100644 index 0000000000000..0f9dd1f1b7a2f --- /dev/null +++ b/src/wp-includes/icons/library/page-break.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/page.svg b/src/wp-includes/icons/library/page.svg new file mode 100644 index 0000000000000..ce1918e963dd6 --- /dev/null +++ b/src/wp-includes/icons/library/page.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/wp-includes/icons/library/pages.svg b/src/wp-includes/icons/library/pages.svg new file mode 100644 index 0000000000000..4cfedd8e91f01 --- /dev/null +++ b/src/wp-includes/icons/library/pages.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/wp-includes/icons/library/paragraph.svg b/src/wp-includes/icons/library/paragraph.svg new file mode 100644 index 0000000000000..a5945a65500e6 --- /dev/null +++ b/src/wp-includes/icons/library/paragraph.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/payment.svg b/src/wp-includes/icons/library/payment.svg new file mode 100644 index 0000000000000..305e1e2495e9c --- /dev/null +++ b/src/wp-includes/icons/library/payment.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/pencil.svg b/src/wp-includes/icons/library/pencil.svg new file mode 100644 index 0000000000000..6a6fccc85deed --- /dev/null +++ b/src/wp-includes/icons/library/pencil.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/pending.svg b/src/wp-includes/icons/library/pending.svg new file mode 100644 index 0000000000000..ef3b154b2240f --- /dev/null +++ b/src/wp-includes/icons/library/pending.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/people.svg b/src/wp-includes/icons/library/people.svg new file mode 100644 index 0000000000000..352a6410e30bc --- /dev/null +++ b/src/wp-includes/icons/library/people.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/percent.svg b/src/wp-includes/icons/library/percent.svg new file mode 100644 index 0000000000000..bb1bf2a134d49 --- /dev/null +++ b/src/wp-includes/icons/library/percent.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/pin-small.svg b/src/wp-includes/icons/library/pin-small.svg new file mode 100644 index 0000000000000..25a36f5e6a801 --- /dev/null +++ b/src/wp-includes/icons/library/pin-small.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/pin.svg b/src/wp-includes/icons/library/pin.svg new file mode 100644 index 0000000000000..a61c2cafad05e --- /dev/null +++ b/src/wp-includes/icons/library/pin.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/plugins.svg b/src/wp-includes/icons/library/plugins.svg new file mode 100644 index 0000000000000..a74ce8910aac1 --- /dev/null +++ b/src/wp-includes/icons/library/plugins.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/plus-circle-filled.svg b/src/wp-includes/icons/library/plus-circle-filled.svg new file mode 100644 index 0000000000000..e46a7e178e589 --- /dev/null +++ b/src/wp-includes/icons/library/plus-circle-filled.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/plus-circle.svg b/src/wp-includes/icons/library/plus-circle.svg new file mode 100644 index 0000000000000..9ab6d1bbd7fee --- /dev/null +++ b/src/wp-includes/icons/library/plus-circle.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/plus.svg b/src/wp-includes/icons/library/plus.svg new file mode 100644 index 0000000000000..09776c79ee92a --- /dev/null +++ b/src/wp-includes/icons/library/plus.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/position-center.svg b/src/wp-includes/icons/library/position-center.svg new file mode 100644 index 0000000000000..ab9a1990373c3 --- /dev/null +++ b/src/wp-includes/icons/library/position-center.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/position-left.svg b/src/wp-includes/icons/library/position-left.svg new file mode 100644 index 0000000000000..a1b96ae2f92f3 --- /dev/null +++ b/src/wp-includes/icons/library/position-left.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/position-right.svg b/src/wp-includes/icons/library/position-right.svg new file mode 100644 index 0000000000000..1abb237622be8 --- /dev/null +++ b/src/wp-includes/icons/library/position-right.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/post-author.svg b/src/wp-includes/icons/library/post-author.svg new file mode 100644 index 0000000000000..acbf5f1383c1c --- /dev/null +++ b/src/wp-includes/icons/library/post-author.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/post-categories.svg b/src/wp-includes/icons/library/post-categories.svg new file mode 100644 index 0000000000000..22471982de366 --- /dev/null +++ b/src/wp-includes/icons/library/post-categories.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/post-comments-count.svg b/src/wp-includes/icons/library/post-comments-count.svg new file mode 100644 index 0000000000000..55caa3b60a080 --- /dev/null +++ b/src/wp-includes/icons/library/post-comments-count.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/post-comments-form.svg b/src/wp-includes/icons/library/post-comments-form.svg new file mode 100644 index 0000000000000..ecbdd4766e127 --- /dev/null +++ b/src/wp-includes/icons/library/post-comments-form.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/post-comments.svg b/src/wp-includes/icons/library/post-comments.svg new file mode 100644 index 0000000000000..b05d4bf1a167a --- /dev/null +++ b/src/wp-includes/icons/library/post-comments.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/post-content.svg b/src/wp-includes/icons/library/post-content.svg new file mode 100644 index 0000000000000..82a7c427a11a9 --- /dev/null +++ b/src/wp-includes/icons/library/post-content.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/post-date.svg b/src/wp-includes/icons/library/post-date.svg new file mode 100644 index 0000000000000..84bc05d2549fa --- /dev/null +++ b/src/wp-includes/icons/library/post-date.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/wp-includes/icons/library/post-excerpt.svg b/src/wp-includes/icons/library/post-excerpt.svg new file mode 100644 index 0000000000000..8dca8a3ab16f7 --- /dev/null +++ b/src/wp-includes/icons/library/post-excerpt.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/post-featured-image.svg b/src/wp-includes/icons/library/post-featured-image.svg new file mode 100644 index 0000000000000..d5c88159e5843 --- /dev/null +++ b/src/wp-includes/icons/library/post-featured-image.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/post-list.svg b/src/wp-includes/icons/library/post-list.svg new file mode 100644 index 0000000000000..008b1dc86a66e --- /dev/null +++ b/src/wp-includes/icons/library/post-list.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/post-terms.svg b/src/wp-includes/icons/library/post-terms.svg new file mode 100644 index 0000000000000..1df12e6e31d53 --- /dev/null +++ b/src/wp-includes/icons/library/post-terms.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/post.svg b/src/wp-includes/icons/library/post.svg new file mode 100644 index 0000000000000..be934e242a1cd --- /dev/null +++ b/src/wp-includes/icons/library/post.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/preformatted.svg b/src/wp-includes/icons/library/preformatted.svg new file mode 100644 index 0000000000000..231d6e77a5fcd --- /dev/null +++ b/src/wp-includes/icons/library/preformatted.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/previous.svg b/src/wp-includes/icons/library/previous.svg new file mode 100644 index 0000000000000..ea03926c3aa11 --- /dev/null +++ b/src/wp-includes/icons/library/previous.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/published.svg b/src/wp-includes/icons/library/published.svg new file mode 100644 index 0000000000000..13dfc4bb18164 --- /dev/null +++ b/src/wp-includes/icons/library/published.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/pull-left.svg b/src/wp-includes/icons/library/pull-left.svg new file mode 100644 index 0000000000000..016da89b0afc1 --- /dev/null +++ b/src/wp-includes/icons/library/pull-left.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/pull-right.svg b/src/wp-includes/icons/library/pull-right.svg new file mode 100644 index 0000000000000..688280c37fbc7 --- /dev/null +++ b/src/wp-includes/icons/library/pull-right.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/pullquote.svg b/src/wp-includes/icons/library/pullquote.svg new file mode 100644 index 0000000000000..6fe0e1447936b --- /dev/null +++ b/src/wp-includes/icons/library/pullquote.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/query-pagination-next.svg b/src/wp-includes/icons/library/query-pagination-next.svg new file mode 100644 index 0000000000000..8925c33bfd4fb --- /dev/null +++ b/src/wp-includes/icons/library/query-pagination-next.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/query-pagination-numbers.svg b/src/wp-includes/icons/library/query-pagination-numbers.svg new file mode 100644 index 0000000000000..7fdff964d8a86 --- /dev/null +++ b/src/wp-includes/icons/library/query-pagination-numbers.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/query-pagination-previous.svg b/src/wp-includes/icons/library/query-pagination-previous.svg new file mode 100644 index 0000000000000..c8bc7eb8e032d --- /dev/null +++ b/src/wp-includes/icons/library/query-pagination-previous.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/query-pagination.svg b/src/wp-includes/icons/library/query-pagination.svg new file mode 100644 index 0000000000000..6c6cb0cfed672 --- /dev/null +++ b/src/wp-includes/icons/library/query-pagination.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/quote.svg b/src/wp-includes/icons/library/quote.svg new file mode 100644 index 0000000000000..655bd131dfe3f --- /dev/null +++ b/src/wp-includes/icons/library/quote.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/receipt.svg b/src/wp-includes/icons/library/receipt.svg new file mode 100644 index 0000000000000..def9c8118f0fc --- /dev/null +++ b/src/wp-includes/icons/library/receipt.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/redo.svg b/src/wp-includes/icons/library/redo.svg new file mode 100644 index 0000000000000..8adb40ee5d946 --- /dev/null +++ b/src/wp-includes/icons/library/redo.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/remove-bug.svg b/src/wp-includes/icons/library/remove-bug.svg new file mode 100644 index 0000000000000..07fc6c0b05a76 --- /dev/null +++ b/src/wp-includes/icons/library/remove-bug.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/remove-submenu.svg b/src/wp-includes/icons/library/remove-submenu.svg new file mode 100644 index 0000000000000..e57bd6f94bed2 --- /dev/null +++ b/src/wp-includes/icons/library/remove-submenu.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/replace.svg b/src/wp-includes/icons/library/replace.svg new file mode 100644 index 0000000000000..c4629ecaf869d --- /dev/null +++ b/src/wp-includes/icons/library/replace.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/reset.svg b/src/wp-includes/icons/library/reset.svg new file mode 100644 index 0000000000000..660c39b49123c --- /dev/null +++ b/src/wp-includes/icons/library/reset.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/resize-corner-n-e.svg b/src/wp-includes/icons/library/resize-corner-n-e.svg new file mode 100644 index 0000000000000..764fec3b29bde --- /dev/null +++ b/src/wp-includes/icons/library/resize-corner-n-e.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/reusable-block.svg b/src/wp-includes/icons/library/reusable-block.svg new file mode 100644 index 0000000000000..e6879cc660bc4 --- /dev/null +++ b/src/wp-includes/icons/library/reusable-block.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/rotate-left.svg b/src/wp-includes/icons/library/rotate-left.svg new file mode 100644 index 0000000000000..262ab29a96648 --- /dev/null +++ b/src/wp-includes/icons/library/rotate-left.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/rotate-right.svg b/src/wp-includes/icons/library/rotate-right.svg new file mode 100644 index 0000000000000..deb8cc272a1b3 --- /dev/null +++ b/src/wp-includes/icons/library/rotate-right.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/row.svg b/src/wp-includes/icons/library/row.svg new file mode 100644 index 0000000000000..1ce7a6a417ac7 --- /dev/null +++ b/src/wp-includes/icons/library/row.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/rss.svg b/src/wp-includes/icons/library/rss.svg new file mode 100644 index 0000000000000..47af92eca26a6 --- /dev/null +++ b/src/wp-includes/icons/library/rss.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/scheduled.svg b/src/wp-includes/icons/library/scheduled.svg new file mode 100644 index 0000000000000..1a1e769092211 --- /dev/null +++ b/src/wp-includes/icons/library/scheduled.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/search.svg b/src/wp-includes/icons/library/search.svg new file mode 100644 index 0000000000000..fe24af8e80dec --- /dev/null +++ b/src/wp-includes/icons/library/search.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/seen.svg b/src/wp-includes/icons/library/seen.svg new file mode 100644 index 0000000000000..b8bf2575dc8a4 --- /dev/null +++ b/src/wp-includes/icons/library/seen.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/send.svg b/src/wp-includes/icons/library/send.svg new file mode 100644 index 0000000000000..31444a297e420 --- /dev/null +++ b/src/wp-includes/icons/library/send.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/separator.svg b/src/wp-includes/icons/library/separator.svg new file mode 100644 index 0000000000000..f2ec17aea2a29 --- /dev/null +++ b/src/wp-includes/icons/library/separator.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/settings.svg b/src/wp-includes/icons/library/settings.svg new file mode 100644 index 0000000000000..a6b1d86540ad9 --- /dev/null +++ b/src/wp-includes/icons/library/settings.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/wp-includes/icons/library/shadow.svg b/src/wp-includes/icons/library/shadow.svg new file mode 100644 index 0000000000000..41a5c2cac7f09 --- /dev/null +++ b/src/wp-includes/icons/library/shadow.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/share.svg b/src/wp-includes/icons/library/share.svg new file mode 100644 index 0000000000000..2ed89feccf56b --- /dev/null +++ b/src/wp-includes/icons/library/share.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/shield.svg b/src/wp-includes/icons/library/shield.svg new file mode 100644 index 0000000000000..33e45e6228de5 --- /dev/null +++ b/src/wp-includes/icons/library/shield.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/shipping.svg b/src/wp-includes/icons/library/shipping.svg new file mode 100644 index 0000000000000..f987d40c9725f --- /dev/null +++ b/src/wp-includes/icons/library/shipping.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/shortcode.svg b/src/wp-includes/icons/library/shortcode.svg new file mode 100644 index 0000000000000..f0e3b412d73f8 --- /dev/null +++ b/src/wp-includes/icons/library/shortcode.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/shuffle.svg b/src/wp-includes/icons/library/shuffle.svg new file mode 100644 index 0000000000000..2683ef13fb50a --- /dev/null +++ b/src/wp-includes/icons/library/shuffle.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/sidebar.svg b/src/wp-includes/icons/library/sidebar.svg new file mode 100644 index 0000000000000..15d5880d3fe93 --- /dev/null +++ b/src/wp-includes/icons/library/sidebar.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/sides-all.svg b/src/wp-includes/icons/library/sides-all.svg new file mode 100644 index 0000000000000..afbf1775bb9b8 --- /dev/null +++ b/src/wp-includes/icons/library/sides-all.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/sides-axial.svg b/src/wp-includes/icons/library/sides-axial.svg new file mode 100644 index 0000000000000..08f202cfa6d16 --- /dev/null +++ b/src/wp-includes/icons/library/sides-axial.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/sides-bottom.svg b/src/wp-includes/icons/library/sides-bottom.svg new file mode 100644 index 0000000000000..7e477e5d6d7af --- /dev/null +++ b/src/wp-includes/icons/library/sides-bottom.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/wp-includes/icons/library/sides-horizontal.svg b/src/wp-includes/icons/library/sides-horizontal.svg new file mode 100644 index 0000000000000..df651421e339e --- /dev/null +++ b/src/wp-includes/icons/library/sides-horizontal.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/wp-includes/icons/library/sides-left.svg b/src/wp-includes/icons/library/sides-left.svg new file mode 100644 index 0000000000000..c546c042fba39 --- /dev/null +++ b/src/wp-includes/icons/library/sides-left.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/wp-includes/icons/library/sides-right.svg b/src/wp-includes/icons/library/sides-right.svg new file mode 100644 index 0000000000000..689698d85d0dc --- /dev/null +++ b/src/wp-includes/icons/library/sides-right.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/wp-includes/icons/library/sides-top.svg b/src/wp-includes/icons/library/sides-top.svg new file mode 100644 index 0000000000000..a413488ac3fca --- /dev/null +++ b/src/wp-includes/icons/library/sides-top.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/wp-includes/icons/library/sides-vertical.svg b/src/wp-includes/icons/library/sides-vertical.svg new file mode 100644 index 0000000000000..1e64f408855fb --- /dev/null +++ b/src/wp-includes/icons/library/sides-vertical.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/wp-includes/icons/library/site-logo.svg b/src/wp-includes/icons/library/site-logo.svg new file mode 100644 index 0000000000000..26b6cfb4ce689 --- /dev/null +++ b/src/wp-includes/icons/library/site-logo.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/square.svg b/src/wp-includes/icons/library/square.svg new file mode 100644 index 0000000000000..3b66d51854cb1 --- /dev/null +++ b/src/wp-includes/icons/library/square.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/stack.svg b/src/wp-includes/icons/library/stack.svg new file mode 100644 index 0000000000000..c4d9aef31e5c0 --- /dev/null +++ b/src/wp-includes/icons/library/stack.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/star-empty.svg b/src/wp-includes/icons/library/star-empty.svg new file mode 100644 index 0000000000000..75cd0e122d458 --- /dev/null +++ b/src/wp-includes/icons/library/star-empty.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/star-filled.svg b/src/wp-includes/icons/library/star-filled.svg new file mode 100644 index 0000000000000..2b32a6424776a --- /dev/null +++ b/src/wp-includes/icons/library/star-filled.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/star-half.svg b/src/wp-includes/icons/library/star-half.svg new file mode 100644 index 0000000000000..fe0f1b5ca0b16 --- /dev/null +++ b/src/wp-includes/icons/library/star-half.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/store.svg b/src/wp-includes/icons/library/store.svg new file mode 100644 index 0000000000000..af15718d7f908 --- /dev/null +++ b/src/wp-includes/icons/library/store.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/stretch-full-width.svg b/src/wp-includes/icons/library/stretch-full-width.svg new file mode 100644 index 0000000000000..02a5f5c0cb644 --- /dev/null +++ b/src/wp-includes/icons/library/stretch-full-width.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/stretch-wide.svg b/src/wp-includes/icons/library/stretch-wide.svg new file mode 100644 index 0000000000000..ff3031ef9bd74 --- /dev/null +++ b/src/wp-includes/icons/library/stretch-wide.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/styles.svg b/src/wp-includes/icons/library/styles.svg new file mode 100644 index 0000000000000..377fa2e6bb458 --- /dev/null +++ b/src/wp-includes/icons/library/styles.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/subscript.svg b/src/wp-includes/icons/library/subscript.svg new file mode 100644 index 0000000000000..632317fe7536c --- /dev/null +++ b/src/wp-includes/icons/library/subscript.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/superscript.svg b/src/wp-includes/icons/library/superscript.svg new file mode 100644 index 0000000000000..ca60e0e1133f2 --- /dev/null +++ b/src/wp-includes/icons/library/superscript.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/swatch.svg b/src/wp-includes/icons/library/swatch.svg new file mode 100644 index 0000000000000..af21de80a183b --- /dev/null +++ b/src/wp-includes/icons/library/swatch.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/symbol-filled.svg b/src/wp-includes/icons/library/symbol-filled.svg new file mode 100644 index 0000000000000..608a9e8ee96b2 --- /dev/null +++ b/src/wp-includes/icons/library/symbol-filled.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/symbol.svg b/src/wp-includes/icons/library/symbol.svg new file mode 100644 index 0000000000000..58f92a5cc93c6 --- /dev/null +++ b/src/wp-includes/icons/library/symbol.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/tab.svg b/src/wp-includes/icons/library/tab.svg new file mode 100644 index 0000000000000..a6444a9739efd --- /dev/null +++ b/src/wp-includes/icons/library/tab.svg @@ -0,0 +1 @@ + diff --git a/src/wp-includes/icons/library/table-column-after.svg b/src/wp-includes/icons/library/table-column-after.svg new file mode 100644 index 0000000000000..bfbf79eefb306 --- /dev/null +++ b/src/wp-includes/icons/library/table-column-after.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/table-column-before.svg b/src/wp-includes/icons/library/table-column-before.svg new file mode 100644 index 0000000000000..6966550159ef2 --- /dev/null +++ b/src/wp-includes/icons/library/table-column-before.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/table-column-delete.svg b/src/wp-includes/icons/library/table-column-delete.svg new file mode 100644 index 0000000000000..a23314d76e897 --- /dev/null +++ b/src/wp-includes/icons/library/table-column-delete.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/table-of-contents.svg b/src/wp-includes/icons/library/table-of-contents.svg new file mode 100644 index 0000000000000..09a6e26ec72b1 --- /dev/null +++ b/src/wp-includes/icons/library/table-of-contents.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/wp-includes/icons/library/table-row-after.svg b/src/wp-includes/icons/library/table-row-after.svg new file mode 100644 index 0000000000000..f20db5ac4c884 --- /dev/null +++ b/src/wp-includes/icons/library/table-row-after.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/table-row-before.svg b/src/wp-includes/icons/library/table-row-before.svg new file mode 100644 index 0000000000000..ab0c02e9dce58 --- /dev/null +++ b/src/wp-includes/icons/library/table-row-before.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/table-row-delete.svg b/src/wp-includes/icons/library/table-row-delete.svg new file mode 100644 index 0000000000000..110a6a9fb80e8 --- /dev/null +++ b/src/wp-includes/icons/library/table-row-delete.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/table.svg b/src/wp-includes/icons/library/table.svg new file mode 100644 index 0000000000000..64e387e683d62 --- /dev/null +++ b/src/wp-includes/icons/library/table.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/tablet.svg b/src/wp-includes/icons/library/tablet.svg new file mode 100644 index 0000000000000..fa36e90de69cd --- /dev/null +++ b/src/wp-includes/icons/library/tablet.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/tabs-menu-item.svg b/src/wp-includes/icons/library/tabs-menu-item.svg new file mode 100644 index 0000000000000..2e8102d5d7f9b --- /dev/null +++ b/src/wp-includes/icons/library/tabs-menu-item.svg @@ -0,0 +1 @@ + diff --git a/src/wp-includes/icons/library/tabs-menu.svg b/src/wp-includes/icons/library/tabs-menu.svg new file mode 100644 index 0000000000000..d42453416b532 --- /dev/null +++ b/src/wp-includes/icons/library/tabs-menu.svg @@ -0,0 +1 @@ + diff --git a/src/wp-includes/icons/library/tabs.svg b/src/wp-includes/icons/library/tabs.svg new file mode 100644 index 0000000000000..9740dca50ff48 --- /dev/null +++ b/src/wp-includes/icons/library/tabs.svg @@ -0,0 +1 @@ + diff --git a/src/wp-includes/icons/library/tag.svg b/src/wp-includes/icons/library/tag.svg new file mode 100644 index 0000000000000..a2a52b7541ed8 --- /dev/null +++ b/src/wp-includes/icons/library/tag.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/term-count.svg b/src/wp-includes/icons/library/term-count.svg new file mode 100644 index 0000000000000..8b333407a02ef --- /dev/null +++ b/src/wp-includes/icons/library/term-count.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/wp-includes/icons/library/term-description.svg b/src/wp-includes/icons/library/term-description.svg new file mode 100644 index 0000000000000..5a00b07073134 --- /dev/null +++ b/src/wp-includes/icons/library/term-description.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/term-name.svg b/src/wp-includes/icons/library/term-name.svg new file mode 100644 index 0000000000000..c4135c2511de2 --- /dev/null +++ b/src/wp-includes/icons/library/term-name.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/wp-includes/icons/library/text-color.svg b/src/wp-includes/icons/library/text-color.svg new file mode 100644 index 0000000000000..a6096517801ad --- /dev/null +++ b/src/wp-includes/icons/library/text-color.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/text-horizontal.svg b/src/wp-includes/icons/library/text-horizontal.svg new file mode 100644 index 0000000000000..faf6150751bba --- /dev/null +++ b/src/wp-includes/icons/library/text-horizontal.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/text-vertical.svg b/src/wp-includes/icons/library/text-vertical.svg new file mode 100644 index 0000000000000..64ec893f7f0f2 --- /dev/null +++ b/src/wp-includes/icons/library/text-vertical.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/thumbs-down.svg b/src/wp-includes/icons/library/thumbs-down.svg new file mode 100644 index 0000000000000..72c96f5b5693e --- /dev/null +++ b/src/wp-includes/icons/library/thumbs-down.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/thumbs-up.svg b/src/wp-includes/icons/library/thumbs-up.svg new file mode 100644 index 0000000000000..79fb58752a32a --- /dev/null +++ b/src/wp-includes/icons/library/thumbs-up.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/time-to-read.svg b/src/wp-includes/icons/library/time-to-read.svg new file mode 100644 index 0000000000000..fd368c5e4fc80 --- /dev/null +++ b/src/wp-includes/icons/library/time-to-read.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/tip.svg b/src/wp-includes/icons/library/tip.svg new file mode 100644 index 0000000000000..212885ca47e50 --- /dev/null +++ b/src/wp-includes/icons/library/tip.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/title.svg b/src/wp-includes/icons/library/title.svg new file mode 100644 index 0000000000000..28e8fa6921378 --- /dev/null +++ b/src/wp-includes/icons/library/title.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/tool.svg b/src/wp-includes/icons/library/tool.svg new file mode 100644 index 0000000000000..1c9cc50018fcf --- /dev/null +++ b/src/wp-includes/icons/library/tool.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/trash.svg b/src/wp-includes/icons/library/trash.svg new file mode 100644 index 0000000000000..fddfcfeb44883 --- /dev/null +++ b/src/wp-includes/icons/library/trash.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/trending-down.svg b/src/wp-includes/icons/library/trending-down.svg new file mode 100644 index 0000000000000..66f297ade96fc --- /dev/null +++ b/src/wp-includes/icons/library/trending-down.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/trending-up.svg b/src/wp-includes/icons/library/trending-up.svg new file mode 100644 index 0000000000000..b7644d8f2b52f --- /dev/null +++ b/src/wp-includes/icons/library/trending-up.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/typography.svg b/src/wp-includes/icons/library/typography.svg new file mode 100644 index 0000000000000..c81ee1fad6551 --- /dev/null +++ b/src/wp-includes/icons/library/typography.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/undo.svg b/src/wp-includes/icons/library/undo.svg new file mode 100644 index 0000000000000..2a66cab0267f1 --- /dev/null +++ b/src/wp-includes/icons/library/undo.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/ungroup.svg b/src/wp-includes/icons/library/ungroup.svg new file mode 100644 index 0000000000000..9e8339598f228 --- /dev/null +++ b/src/wp-includes/icons/library/ungroup.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/unlock.svg b/src/wp-includes/icons/library/unlock.svg new file mode 100644 index 0000000000000..59785ed29f86d --- /dev/null +++ b/src/wp-includes/icons/library/unlock.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/unseen.svg b/src/wp-includes/icons/library/unseen.svg new file mode 100644 index 0000000000000..661725a3048de --- /dev/null +++ b/src/wp-includes/icons/library/unseen.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/update.svg b/src/wp-includes/icons/library/update.svg new file mode 100644 index 0000000000000..e69e11c4e2a1f --- /dev/null +++ b/src/wp-includes/icons/library/update.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/upload.svg b/src/wp-includes/icons/library/upload.svg new file mode 100644 index 0000000000000..27578edddddc3 --- /dev/null +++ b/src/wp-includes/icons/library/upload.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/verse.svg b/src/wp-includes/icons/library/verse.svg new file mode 100644 index 0000000000000..3ad231a950a52 --- /dev/null +++ b/src/wp-includes/icons/library/verse.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/video.svg b/src/wp-includes/icons/library/video.svg new file mode 100644 index 0000000000000..4b80f689b0efb --- /dev/null +++ b/src/wp-includes/icons/library/video.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/widget.svg b/src/wp-includes/icons/library/widget.svg new file mode 100644 index 0000000000000..987e201641fef --- /dev/null +++ b/src/wp-includes/icons/library/widget.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/word-count.svg b/src/wp-includes/icons/library/word-count.svg new file mode 100644 index 0000000000000..0d1dfd33f82c8 --- /dev/null +++ b/src/wp-includes/icons/library/word-count.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/library/wordpress.svg b/src/wp-includes/icons/library/wordpress.svg new file mode 100644 index 0000000000000..56be7255c7482 --- /dev/null +++ b/src/wp-includes/icons/library/wordpress.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/wp-includes/icons/manifest.php b/src/wp-includes/icons/manifest.php new file mode 100644 index 0000000000000..b15ff4b5fd9f0 --- /dev/null +++ b/src/wp-includes/icons/manifest.php @@ -0,0 +1,360 @@ + array( + 'label' => _x( 'Arrow Down Left', 'icon label' ), + 'filePath' => 'library/arrow-down-left.svg', + ), + 'arrow-down-right' => array( + 'label' => _x( 'Arrow Down Right', 'icon label' ), + 'filePath' => 'library/arrow-down-right.svg', + ), + 'arrow-down' => array( + 'label' => _x( 'Arrow Down', 'icon label' ), + 'filePath' => 'library/arrow-down.svg', + ), + 'arrow-left' => array( + 'label' => _x( 'Arrow Left', 'icon label' ), + 'filePath' => 'library/arrow-left.svg', + ), + 'arrow-right' => array( + 'label' => _x( 'Arrow Right', 'icon label' ), + 'filePath' => 'library/arrow-right.svg', + ), + 'arrow-up-left' => array( + 'label' => _x( 'Arrow Up Left', 'icon label' ), + 'filePath' => 'library/arrow-up-left.svg', + ), + 'arrow-up-right' => array( + 'label' => _x( 'Arrow Up Right', 'icon label' ), + 'filePath' => 'library/arrow-up-right.svg', + ), + 'arrow-up' => array( + 'label' => _x( 'Arrow Up', 'icon label' ), + 'filePath' => 'library/arrow-up.svg', + ), + 'at-symbol' => array( + 'label' => _x( 'At Symbol (@)', 'icon label' ), + 'filePath' => 'library/at-symbol.svg', + ), + 'audio' => array( + 'label' => _x( 'Audio', 'icon label' ), + 'filePath' => 'library/audio.svg', + ), + 'bell' => array( + 'label' => _x( 'Bell', 'icon label' ), + 'filePath' => 'library/bell.svg', + ), + 'block-default' => array( + 'label' => _x( 'Block Default', 'icon label' ), + 'filePath' => 'library/block-default.svg', + ), + 'block-meta' => array( + 'label' => _x( 'Block Meta', 'icon label' ), + 'filePath' => 'library/block-meta.svg', + ), + 'block-table' => array( + 'label' => _x( 'Block Table', 'icon label' ), + 'filePath' => 'library/block-table.svg', + ), + 'calendar' => array( + 'label' => _x( 'Calendar', 'icon label' ), + 'filePath' => 'library/calendar.svg', + ), + 'capture-photo' => array( + 'label' => _x( 'Capture Photo', 'icon label' ), + 'filePath' => 'library/capture-photo.svg', + ), + 'capture-video' => array( + 'label' => _x( 'Capture Video', 'icon label' ), + 'filePath' => 'library/capture-video.svg', + ), + 'cart' => array( + 'label' => _x( 'Cart', 'icon label' ), + 'filePath' => 'library/cart.svg', + ), + 'category' => array( + 'label' => _x( 'Category', 'icon label' ), + 'filePath' => 'library/category.svg', + ), + 'caution' => array( + 'label' => _x( 'Caution', 'icon label' ), + 'filePath' => 'library/caution.svg', + ), + 'chart-bar' => array( + 'label' => _x( 'Chart Bar', 'icon label' ), + 'filePath' => 'library/chart-bar.svg', + ), + 'check' => array( + 'label' => _x( 'Check', 'icon label' ), + 'filePath' => 'library/check.svg', + ), + 'chevron-down' => array( + 'label' => _x( 'Chevron Down', 'icon label' ), + 'filePath' => 'library/chevron-down.svg', + ), + 'chevron-down-small' => array( + 'label' => _x( 'Chevron Down Small', 'icon label' ), + 'filePath' => 'library/chevron-down-small.svg', + ), + 'chevron-left' => array( + 'label' => _x( 'Chevron Left', 'icon label' ), + 'filePath' => 'library/chevron-left.svg', + ), + 'chevron-left-small' => array( + 'label' => _x( 'Chevron Left Small', 'icon label' ), + 'filePath' => 'library/chevron-left-small.svg', + ), + 'chevron-right' => array( + 'label' => _x( 'Chevron Right', 'icon label' ), + 'filePath' => 'library/chevron-right.svg', + ), + 'chevron-right-small' => array( + 'label' => _x( 'Chevron Right Small', 'icon label' ), + 'filePath' => 'library/chevron-right-small.svg', + ), + 'chevron-up' => array( + 'label' => _x( 'Chevron Up', 'icon label' ), + 'filePath' => 'library/chevron-up.svg', + ), + 'chevron-up-down' => array( + 'label' => _x( 'Chevron Up Down', 'icon label' ), + 'filePath' => 'library/chevron-up-down.svg', + ), + 'chevron-up-small' => array( + 'label' => _x( 'Chevron Up Small', 'icon label' ), + 'filePath' => 'library/chevron-up-small.svg', + ), + 'comment' => array( + 'label' => _x( 'Comment', 'icon label' ), + 'filePath' => 'library/comment.svg', + ), + 'cover' => array( + 'label' => _x( 'Cover', 'icon label' ), + 'filePath' => 'library/cover.svg', + ), + 'create' => array( + 'label' => _x( 'Create', 'icon label' ), + 'filePath' => 'library/create.svg', + ), + 'desktop' => array( + 'label' => _x( 'Desktop', 'icon label' ), + 'filePath' => 'library/desktop.svg', + ), + 'download' => array( + 'label' => _x( 'Download', 'icon label' ), + 'filePath' => 'library/download.svg', + ), + 'drawer-left' => array( + 'label' => _x( 'Drawer Left', 'icon label' ), + 'filePath' => 'library/drawer-left.svg', + ), + 'drawer-right' => array( + 'label' => _x( 'Drawer Right', 'icon label' ), + 'filePath' => 'library/drawer-right.svg', + ), + 'envelope' => array( + 'label' => _x( 'Envelope', 'icon label' ), + 'filePath' => 'library/envelope.svg', + ), + 'error' => array( + 'label' => _x( 'Error', 'icon label' ), + 'filePath' => 'library/error.svg', + ), + 'external' => array( + 'label' => _x( 'External', 'icon label' ), + 'filePath' => 'library/external.svg', + ), + 'file' => array( + 'label' => _x( 'File', 'icon label' ), + 'filePath' => 'library/file.svg', + ), + 'gallery' => array( + 'label' => _x( 'Gallery', 'icon label' ), + 'filePath' => 'library/gallery.svg', + ), + 'group' => array( + 'label' => _x( 'Group', 'icon label' ), + 'filePath' => 'library/group.svg', + ), + 'heading' => array( + 'label' => _x( 'Heading', 'icon label' ), + 'filePath' => 'library/heading.svg', + ), + 'help' => array( + 'label' => _x( 'Help', 'icon label' ), + 'filePath' => 'library/help.svg', + ), + 'home' => array( + 'label' => _x( 'Home', 'icon label' ), + 'filePath' => 'library/home.svg', + ), + 'image' => array( + 'label' => _x( 'Image', 'icon label' ), + 'filePath' => 'library/image.svg', + ), + 'info' => array( + 'label' => _x( 'Info', 'icon label' ), + 'filePath' => 'library/info.svg', + ), + 'key' => array( + 'label' => _x( 'Key', 'icon label' ), + 'filePath' => 'library/key.svg', + ), + 'language' => array( + 'label' => _x( 'Language', 'icon label' ), + 'filePath' => 'library/language.svg', + ), + 'map-marker' => array( + 'label' => _x( 'Map Marker', 'icon label' ), + 'filePath' => 'library/map-marker.svg', + ), + 'menu' => array( + 'label' => _x( 'Menu', 'icon label' ), + 'filePath' => 'library/menu.svg', + ), + 'mobile' => array( + 'label' => _x( 'Mobile', 'icon label' ), + 'filePath' => 'library/mobile.svg', + ), + 'more-horizontal' => array( + 'label' => _x( 'More Horizontal', 'icon label' ), + 'filePath' => 'library/more-horizontal.svg', + ), + 'more-vertical' => array( + 'label' => _x( 'More Vertical', 'icon label' ), + 'filePath' => 'library/more-vertical.svg', + ), + 'next' => array( + 'label' => _x( 'Next', 'icon label' ), + 'filePath' => 'library/next.svg', + ), + 'paragraph' => array( + 'label' => _x( 'Paragraph', 'icon label' ), + 'filePath' => 'library/paragraph.svg', + ), + 'payment' => array( + 'label' => _x( 'Payment', 'icon label' ), + 'filePath' => 'library/payment.svg', + ), + 'pencil' => array( + 'label' => _x( 'Pencil', 'icon label' ), + 'filePath' => 'library/pencil.svg', + ), + 'people' => array( + 'label' => _x( 'People', 'icon label' ), + 'filePath' => 'library/people.svg', + ), + 'plus' => array( + 'label' => _x( 'Plus', 'icon label' ), + 'filePath' => 'library/plus.svg', + ), + 'plus-circle' => array( + 'label' => _x( 'Plus Circle', 'icon label' ), + 'filePath' => 'library/plus-circle.svg', + ), + 'previous' => array( + 'label' => _x( 'Previous', 'icon label' ), + 'filePath' => 'library/previous.svg', + ), + 'published' => array( + 'label' => _x( 'Published', 'icon label' ), + 'filePath' => 'library/published.svg', + ), + 'quote' => array( + 'label' => _x( 'Quote', 'icon label' ), + 'filePath' => 'library/quote.svg', + ), + 'receipt' => array( + 'label' => _x( 'Receipt', 'icon label' ), + 'filePath' => 'library/receipt.svg', + ), + 'rss' => array( + 'label' => _x( 'RSS', 'icon label' ), + 'filePath' => 'library/rss.svg', + ), + 'scheduled' => array( + 'label' => _x( 'Scheduled', 'icon label' ), + 'filePath' => 'library/scheduled.svg', + ), + 'search' => array( + 'label' => _x( 'Search', 'icon label' ), + 'filePath' => 'library/search.svg', + ), + 'settings' => array( + 'label' => _x( 'Settings', 'icon label' ), + 'filePath' => 'library/settings.svg', + ), + 'shadow' => array( + 'label' => _x( 'Shadow', 'icon label' ), + 'filePath' => 'library/shadow.svg', + ), + 'share' => array( + 'label' => _x( 'Share', 'icon label' ), + 'filePath' => 'library/share.svg', + ), + 'shield' => array( + 'label' => _x( 'Shield', 'icon label' ), + 'filePath' => 'library/shield.svg', + ), + 'shuffle' => array( + 'label' => _x( 'Shuffle', 'icon label' ), + 'filePath' => 'library/shuffle.svg', + ), + 'star-empty' => array( + 'label' => _x( 'Star Empty', 'icon label' ), + 'filePath' => 'library/star-empty.svg', + ), + 'star-filled' => array( + 'label' => _x( 'Star Filled', 'icon label' ), + 'filePath' => 'library/star-filled.svg', + ), + 'star-half' => array( + 'label' => _x( 'Star Half', 'icon label' ), + 'filePath' => 'library/star-half.svg', + ), + 'store' => array( + 'label' => _x( 'Store', 'icon label' ), + 'filePath' => 'library/store.svg', + ), + 'styles' => array( + 'label' => _x( 'Styles', 'icon label' ), + 'filePath' => 'library/styles.svg', + ), + 'symbol' => array( + 'label' => _x( 'Symbol', 'icon label' ), + 'filePath' => 'library/symbol.svg', + ), + 'symbol-filled' => array( + 'label' => _x( 'Symbol Filled', 'icon label' ), + 'filePath' => 'library/symbol-filled.svg', + ), + 'table' => array( + 'label' => _x( 'Table', 'icon label' ), + 'filePath' => 'library/table.svg', + ), + 'tablet' => array( + 'label' => _x( 'Tablet', 'icon label' ), + 'filePath' => 'library/tablet.svg', + ), + 'tag' => array( + 'label' => _x( 'Tag', 'icon label' ), + 'filePath' => 'library/tag.svg', + ), + 'tip' => array( + 'label' => _x( 'Tip', 'icon label' ), + 'filePath' => 'library/tip.svg', + ), + 'upload' => array( + 'label' => _x( 'Upload', 'icon label' ), + 'filePath' => 'library/upload.svg', + ), + 'verse' => array( + 'label' => _x( 'Verse', 'icon label' ), + 'filePath' => 'library/verse.svg', + ), +); diff --git a/src/wp-includes/theme.json b/src/wp-includes/theme.json new file mode 100644 index 0000000000000..5cfb3ccda09c8 --- /dev/null +++ b/src/wp-includes/theme.json @@ -0,0 +1,420 @@ +{ + "$schema": "../schemas/json/theme.json", + "version": 3, + "settings": { + "appearanceTools": false, + "useRootPaddingAwareAlignments": false, + "border": { + "color": false, + "radius": false, + "style": false, + "width": false + }, + "color": { + "background": true, + "button": true, + "caption": true, + "custom": true, + "customDuotone": true, + "customGradient": true, + "defaultDuotone": true, + "defaultGradients": true, + "defaultPalette": true, + "duotone": [ + { + "name": "Dark grayscale", + "colors": [ "#000000", "#7f7f7f" ], + "slug": "dark-grayscale" + }, + { + "name": "Grayscale", + "colors": [ "#000000", "#ffffff" ], + "slug": "grayscale" + }, + { + "name": "Purple and yellow", + "colors": [ "#8c00b7", "#fcff41" ], + "slug": "purple-yellow" + }, + { + "name": "Blue and red", + "colors": [ "#000097", "#ff4747" ], + "slug": "blue-red" + }, + { + "name": "Midnight", + "colors": [ "#000000", "#00a5ff" ], + "slug": "midnight" + }, + { + "name": "Magenta and yellow", + "colors": [ "#c7005a", "#fff278" ], + "slug": "magenta-yellow" + }, + { + "name": "Purple and green", + "colors": [ "#a60072", "#67ff66" ], + "slug": "purple-green" + }, + { + "name": "Blue and orange", + "colors": [ "#1900d8", "#ffa96b" ], + "slug": "blue-orange" + } + ], + "gradients": [ + { + "name": "Vivid cyan blue to vivid purple", + "gradient": "linear-gradient(135deg,rgb(6,147,227) 0%,rgb(155,81,224) 100%)", + "slug": "vivid-cyan-blue-to-vivid-purple" + }, + { + "name": "Light green cyan to vivid green cyan", + "gradient": "linear-gradient(135deg,rgb(122,220,180) 0%,rgb(0,208,130) 100%)", + "slug": "light-green-cyan-to-vivid-green-cyan" + }, + { + "name": "Luminous vivid amber to luminous vivid orange", + "gradient": "linear-gradient(135deg,rgb(252,185,0) 0%,rgb(255,105,0) 100%)", + "slug": "luminous-vivid-amber-to-luminous-vivid-orange" + }, + { + "name": "Luminous vivid orange to vivid red", + "gradient": "linear-gradient(135deg,rgb(255,105,0) 0%,rgb(207,46,46) 100%)", + "slug": "luminous-vivid-orange-to-vivid-red" + }, + { + "name": "Very light gray to cyan bluish gray", + "gradient": "linear-gradient(135deg,rgb(238,238,238) 0%,rgb(169,184,195) 100%)", + "slug": "very-light-gray-to-cyan-bluish-gray" + }, + { + "name": "Cool to warm spectrum", + "gradient": "linear-gradient(135deg,rgb(74,234,220) 0%,rgb(151,120,209) 20%,rgb(207,42,186) 40%,rgb(238,44,130) 60%,rgb(251,105,98) 80%,rgb(254,248,76) 100%)", + "slug": "cool-to-warm-spectrum" + }, + { + "name": "Blush light purple", + "gradient": "linear-gradient(135deg,rgb(255,206,236) 0%,rgb(152,150,240) 100%)", + "slug": "blush-light-purple" + }, + { + "name": "Blush bordeaux", + "gradient": "linear-gradient(135deg,rgb(254,205,165) 0%,rgb(254,45,45) 50%,rgb(107,0,62) 100%)", + "slug": "blush-bordeaux" + }, + { + "name": "Luminous dusk", + "gradient": "linear-gradient(135deg,rgb(255,203,112) 0%,rgb(199,81,192) 50%,rgb(65,88,208) 100%)", + "slug": "luminous-dusk" + }, + { + "name": "Pale ocean", + "gradient": "linear-gradient(135deg,rgb(255,245,203) 0%,rgb(182,227,212) 50%,rgb(51,167,181) 100%)", + "slug": "pale-ocean" + }, + { + "name": "Electric grass", + "gradient": "linear-gradient(135deg,rgb(202,248,128) 0%,rgb(113,206,126) 100%)", + "slug": "electric-grass" + }, + { + "name": "Midnight", + "gradient": "linear-gradient(135deg,rgb(2,3,129) 0%,rgb(40,116,252) 100%)", + "slug": "midnight" + } + ], + "heading": true, + "link": false, + "palette": [ + { + "name": "Black", + "slug": "black", + "color": "#000000" + }, + { + "name": "Cyan bluish gray", + "slug": "cyan-bluish-gray", + "color": "#abb8c3" + }, + { + "name": "White", + "slug": "white", + "color": "#ffffff" + }, + { + "name": "Pale pink", + "slug": "pale-pink", + "color": "#f78da7" + }, + { + "name": "Vivid red", + "slug": "vivid-red", + "color": "#cf2e2e" + }, + { + "name": "Luminous vivid orange", + "slug": "luminous-vivid-orange", + "color": "#ff6900" + }, + { + "name": "Luminous vivid amber", + "slug": "luminous-vivid-amber", + "color": "#fcb900" + }, + { + "name": "Light green cyan", + "slug": "light-green-cyan", + "color": "#7bdcb5" + }, + { + "name": "Vivid green cyan", + "slug": "vivid-green-cyan", + "color": "#00d084" + }, + { + "name": "Pale cyan blue", + "slug": "pale-cyan-blue", + "color": "#8ed1fc" + }, + { + "name": "Vivid cyan blue", + "slug": "vivid-cyan-blue", + "color": "#0693e3" + }, + { + "name": "Vivid purple", + "slug": "vivid-purple", + "color": "#9b51e0" + } + ], + "text": true + }, + "dimensions": { + "defaultAspectRatios": true, + "aspectRatios": [ + { + "name": "Square - 1:1", + "slug": "square", + "ratio": "1" + }, + { + "name": "Standard - 4:3", + "slug": "4-3", + "ratio": "4/3" + }, + { + "name": "Portrait - 3:4", + "slug": "3-4", + "ratio": "3/4" + }, + { + "name": "Classic - 3:2", + "slug": "3-2", + "ratio": "3/2" + }, + { + "name": "Classic Portrait - 2:3", + "slug": "2-3", + "ratio": "2/3" + }, + { + "name": "Wide - 16:9", + "slug": "16-9", + "ratio": "16/9" + }, + { + "name": "Tall - 9:16", + "slug": "9-16", + "ratio": "9/16" + } + ] + }, + "shadow": { + "defaultPresets": true, + "presets": [ + { + "name": "Natural", + "slug": "natural", + "shadow": "6px 6px 9px rgba(0, 0, 0, 0.2)" + }, + { + "name": "Deep", + "slug": "deep", + "shadow": "12px 12px 50px rgba(0, 0, 0, 0.4)" + }, + { + "name": "Sharp", + "slug": "sharp", + "shadow": "6px 6px 0px rgba(0, 0, 0, 0.2)" + }, + { + "name": "Outlined", + "slug": "outlined", + "shadow": "6px 6px 0px -3px rgb(255, 255, 255), 6px 6px rgb(0, 0, 0)" + }, + { + "name": "Crisp", + "slug": "crisp", + "shadow": "6px 6px 0px rgb(0, 0, 0)" + } + ] + }, + "spacing": { + "blockGap": null, + "margin": false, + "padding": false, + "customSpacingSize": true, + "defaultSpacingSizes": true, + "units": [ "px", "em", "rem", "vh", "vw", "%" ], + "spacingScale": { + "operator": "*", + "increment": 1.5, + "steps": 7, + "mediumStep": 1.5, + "unit": "rem" + } + }, + "typography": { + "customFontSize": true, + "defaultFontSizes": true, + "dropCap": true, + "fontSizes": [ + { + "name": "Small", + "slug": "small", + "size": "13px" + }, + { + "name": "Medium", + "slug": "medium", + "size": "20px" + }, + { + "name": "Large", + "slug": "large", + "size": "36px" + }, + { + "name": "Extra Large", + "slug": "x-large", + "size": "42px" + } + ], + "fontStyle": true, + "fontWeight": true, + "letterSpacing": true, + "lineHeight": false, + "textAlign": true, + "textColumns": false, + "textDecoration": true, + "textIndent": "subsequent", + "textTransform": true, + "writingMode": false + }, + "blocks": { + "core/button": { + "border": { + "radius": true + } + }, + "core/image": { + "lightbox": { + "allowEditing": true + } + }, + "core/icon": { + "dimensions": { + "width": true + } + }, + "core/pullquote": { + "border": { + "color": true, + "radius": true, + "style": true, + "width": true + } + } + } + }, + "styles": { + "blocks": { + "core/button": { + "variations": { + "outline": { + "border": { + "width": "2px", + "style": "solid", + "color": "currentColor" + }, + "color": { + "text": "currentColor", + "gradient": "transparent none" + }, + "spacing": { + "padding": { + "top": "0.667em", + "right": "1.33em", + "bottom": "0.667em", + "left": "1.33em" + } + } + } + } + }, + "core/icon": { + "dimensions": { + "width": "24px" + } + }, + "core/site-logo": { + "variations": { + "rounded": { + "border": { + "radius": "9999px" + } + } + } + } + }, + "elements": { + "button": { + "color": { + "text": "#fff", + "background": "#32373c" + }, + "spacing": { + "padding": { + "top": "calc(0.667em + 2px)", + "right": "calc(1.333em + 2px)", + "bottom": "calc(0.667em + 2px)", + "left": "calc(1.333em + 2px)" + } + }, + "typography": { + "fontSize": "inherit", + "fontFamily": "inherit", + "fontStyle": "inherit", + "fontWeight": "inherit", + "letterSpacing": "inherit", + "textTransform": "inherit", + "lineHeight": "inherit", + "textDecoration": "none" + }, + "border": { + "width": "0" + } + } + }, + "spacing": { + "blockGap": "24px", + "padding": { + "top": "0px", + "right": "0px", + "bottom": "0px", + "left": "0px" + } + } + } +} diff --git a/tools/diff-non-generated.sh b/tools/diff-non-generated.sh new file mode 100644 index 0000000000000..a50b8e6347519 --- /dev/null +++ b/tools/diff-non-generated.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env sh + +# Generate a list of all files not marked as auto-generated, and produce a +# pathspec for the `git diff` command so it skips over them. +# +# Example: +# +# ":!/src/wp-includes/assets/script-loader-packages.min.php" ":!/src/..." +GENERATED=$(cat .gitattributes | grep "diff=generated" | cut -w -f1 | sed 's/^\(.*\)$/":!\1"/g' | paste -sd ' ' -) + +# This ENV cannot be passed directly afte the "--", so generate the command. +CMD="git diff --exit-code -- $GENERATED" + +eval $CMD