From 6b6ec65190f5f71750c80dc141b2fc1df2a5f6c9 Mon Sep 17 00:00:00 2001 From: Joeleen Kennedy Date: Tue, 12 May 2026 17:59:50 -0400 Subject: [PATCH] Add a property to set search terms per page --- src/components/TermSearchControl/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/TermSearchControl/index.js b/src/components/TermSearchControl/index.js index ee0103a..fb5a920 100644 --- a/src/components/TermSearchControl/index.js +++ b/src/components/TermSearchControl/index.js @@ -52,10 +52,11 @@ const getTermIdByTermValue = ( terms, termValue ) => { * @param {object} props.taxonomy The taxonomy object. * @param {number[]} props.termIds An array with the block's term ids for the given taxonomy. * @param {Function} props.onChange Callback `onChange` function. + * @param {number} props.perPage A number to use for the search terms per page. * * @returns {Element} The rendered component. */ -function TermSearchControl( { label, taxonomy, termIds, onChange } ) { +function TermSearchControl( { label, taxonomy, termIds, onChange, perPage = 20 } ) { const [ search, setSearch ] = useState( '' ); const [ value, setValue ] = useState( EMPTY_ARRAY ); const [ suggestions, setSuggestions ] = useState( EMPTY_ARRAY ); @@ -83,7 +84,7 @@ function TermSearchControl( { label, taxonomy, termIds, onChange } ) { search, orderby: 'name', exclude: termIds, - per_page: 20, + per_page: perPage, }, ]; return {