From 9a35324f1bd06efb6961ee347c9cb48b94b6b313 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Wrede?= Date: Thu, 24 Jan 2019 13:49:09 +0100 Subject: [PATCH] Fix: Categories block: add custom classes only to wrapper (#13439) * add wp-block-categories as prefix * render class names only on the block wrapper * review changes --- packages/block-library/src/categories/edit.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/block-library/src/categories/edit.js b/packages/block-library/src/categories/edit.js index b67eb0982e0bf2..5341ad6ff51682 100644 --- a/packages/block-library/src/categories/edit.js +++ b/packages/block-library/src/categories/edit.js @@ -57,8 +57,7 @@ class CategoriesEdit extends Component { } getCategoryListClassName( level ) { - const { className } = this.props; - return `${ className }__list ${ className }__list-level-${ level }`; + return `wp-block-categories__list wp-block-categories__list-level-${ level }`; } renderCategoryName( category ) { @@ -89,7 +88,7 @@ class CategoriesEdit extends Component {
  • { this.renderCategoryName( category ) } { showPostCounts && - + { ' ' }({ category.count }) } @@ -107,7 +106,7 @@ class CategoriesEdit extends Component { } renderCategoryDropdown() { - const { showHierarchy, instanceId, className } = this.props; + const { showHierarchy, instanceId } = this.props; const parentId = showHierarchy ? 0 : null; const categories = this.getCategories( parentId ); const selectId = `blocks-category-select-${ instanceId }`; @@ -116,7 +115,7 @@ class CategoriesEdit extends Component { - { categories.map( ( category ) => this.renderCategoryDropdownItem( category, 0 ) ) }