Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【確認待ち】外観 > カスタマイズ > ウィジェット でブロックが使用できないのを解消 #614

Merged
merged 4 commits into from
Jul 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions inc/vk-blocks/languages/vk-blocks-js.pot
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,7 @@ msgid "Pagination Type"
msgstr ""

#: src/blocks/_pro/slider/edit.js:285
#: src/blocks/heading/edit.js:342
#: src/blocks/heading/edit.js:344
msgid "Hide"
msgstr ""

Expand Down Expand Up @@ -1458,7 +1458,7 @@ msgstr ""
msgid "Display"
msgstr ""

#: src/blocks/heading/edit.js:350
#: src/blocks/heading/edit.js:352
msgid "Text size (rem)"
msgstr ""

Expand Down
6 changes: 3 additions & 3 deletions inc/vk-blocks/languages/vk-blocks.pot
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: 2021-07-19T06:28:49+00:00\n"
"POT-Creation-Date: 2021-07-20T00:15:44+00:00\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"X-Generator: WP-CLI 2.4.0\n"
"X-Domain: vk-blocks\n"
Expand Down Expand Up @@ -824,7 +824,7 @@ msgid "Pagination Type"
msgstr ""

#: src/blocks/_pro/slider/edit.js:285
#: src/blocks/heading/edit.js:342
#: src/blocks/heading/edit.js:344
msgid "Hide"
msgstr ""

Expand Down Expand Up @@ -1461,7 +1461,7 @@ msgstr ""
msgid "Display"
msgstr ""

#: src/blocks/heading/edit.js:350
#: src/blocks/heading/edit.js:352
msgid "Text size (rem)"
msgstr ""

Expand Down
12 changes: 11 additions & 1 deletion src/blocks/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,18 @@ const registerBlock = (block) => {

let { metadata, settings, name } = block;

/*
そもそも Require at Least が 5.7 なので 5.5 以下の後方互換は不要ではあるが、現状影響が少ないので残しておく
window.wpVersion は外観 > カスタマイズ > ウィジェットでは undefined を返すので比較不可能
ともかく最初から undefined が条件に当てはまらないように変更
*/

//WP5.5未満の場合
if (compareVersions(window.wpVersion, '5.5') < 0) {
if (
window.wpVersion !== undefined &&
window.wpVersion !== null &&
compareVersions(window.wpVersion, '5.5') < 0
) {
//nameを削除
delete metadata.name;
//カテゴリ等を追加
Expand Down