Skip to content

Commit

Permalink
adds data check for select
Browse files Browse the repository at this point in the history
  • Loading branch information
jomurgel committed Sep 21, 2018
1 parent 0e55260 commit 2ebd648
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/components/search-edit-component/post-render.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,12 @@ export default withSelect( ( select, props ) => {
_embed: 'embed',
orderby: 'include',
include: selectedResultsQuery,
} );
}, ( value ) => ! isUndefined( value ) );

const queryType = props.attributes.queryFor.slice( 0, -1 );

return {
selectedResults: getEntityRecords( 'postType', 'post', postQuery ),
selectedResults: getEntityRecords( 'postType', queryType, postQuery ),
};
}
}
Expand Down

0 comments on commit 2ebd648

Please sign in to comment.