From b89bbaf085da7042d0db334b6ee6d63c37458b1e Mon Sep 17 00:00:00 2001 From: Jorge Costa Date: Thu, 31 Jan 2019 12:29:05 +0000 Subject: [PATCH] Fix: Categories Block: hierarchical Dropdown (#13567) Previously higher than second levels categories here rendered multiple times on the categories block, when "Show Hierarchy" and "Display as Dropdown" options here true. This commit fixes that problem. --- packages/block-library/src/categories/edit.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/block-library/src/categories/edit.js b/packages/block-library/src/categories/edit.js index ad1dea3ec55bf4..aee240e7384e69 100644 --- a/packages/block-library/src/categories/edit.js +++ b/packages/block-library/src/categories/edit.js @@ -106,7 +106,8 @@ class CategoriesEdit extends Component { } renderCategoryDropdown() { - const { showHierarchy, instanceId } = this.props; + const { instanceId } = this.props; + const { showHierarchy } = this.props.attributes; const parentId = showHierarchy ? 0 : null; const categories = this.getCategories( parentId ); const selectId = `blocks-category-select-${ instanceId }`;