Skip to content

Commit

Permalink
Fix property path on get() call (#10962)
Browse files Browse the repository at this point in the history
  • Loading branch information
earnjam authored and danielbachhuber committed Oct 31, 2018
1 parent ab5d5ce commit 3503c0d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -174,12 +174,12 @@ class FlatTermSelector extends Component {
const termNames = availableTerms.map( ( term ) => term.name );
const newTermLabel = get(
taxonomy,
[ 'data', 'labels', 'add_new_item' ],
[ 'labels', 'add_new_item' ],
slug === 'post_tag' ? __( 'Add New Tag' ) : __( 'Add New Term' )
);
const singularName = get(
taxonomy,
[ 'data', 'labels', 'singular_name' ],
[ 'labels', 'singular_name' ],
slug === 'post_tag' ? __( 'Tag' ) : __( 'Term' )
);
const termAddedLabel = sprintf( _x( '%s added', 'term' ), singularName );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ class HierarchicalTermSelector extends Component {
const { filteredTermsTree, formName, formParent, isRequestingTerms, showForm, filterValue } = this.state;
const labelWithFallback = ( labelProperty, fallbackIsCategory, fallbackIsNotCategory ) => get(
taxonomy,
[ 'data', 'labels', labelProperty ],
[ 'labels', labelProperty ],
slug === 'category' ? fallbackIsCategory : fallbackIsNotCategory
);
const newTermButtonLabel = labelWithFallback(
Expand Down

0 comments on commit 3503c0d

Please sign in to comment.