From 321befc4ccd6fa6fc4d8f116e4b958657b3f86f8 Mon Sep 17 00:00:00 2001 From: Darin Kotter Date: Wed, 10 Jan 2024 09:44:44 -0700 Subject: [PATCH] Ensure our query for podcasting terms pulls more than the default 10 items --- assets/js/create-podcast-show.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/assets/js/create-podcast-show.js b/assets/js/create-podcast-show.js index 60012296..c54c3dbe 100644 --- a/assets/js/create-podcast-show.js +++ b/assets/js/create-podcast-show.js @@ -19,6 +19,13 @@ import { useSelect, dispatch } from "@wordpress/data"; // `wp` namespace instead of @wordpress NPM packages for the following. const { store: editorStore } = wp.editor; const { store: coreDataStore } = wp.coreData; +const DEFAULT_QUERY = { + per_page: -1, + orderby: 'name', + order: 'asc', + _fields: 'id,name,parent', + context: 'view', +}; const CreatePodcastShowModal = ( { isModalOpen, closeModal } ) => { const [ showName, setShowName ] = useState( '' ); @@ -238,7 +245,7 @@ const CreatePodcastShowPlugin = () => { const { getCurrentPostId } = select( editorStore ); return { - allPodcasts: getEntityRecords( 'taxonomy', 'podcasting_podcasts' ) || [], + allPodcasts: getEntityRecords( 'taxonomy', 'podcasting_podcasts', DEFAULT_QUERY ) || [], attachedPodcasts: getEntityRecords( 'taxonomy', 'podcasting_podcasts', { post: getCurrentPostId() } ) || [], currentPostId: getCurrentPostId(), }