From 57ac936b6a45f7820cade460750b6759f0cc2f77 Mon Sep 17 00:00:00 2001 From: Paulo Iankoski Date: Wed, 10 Apr 2024 10:17:57 -0300 Subject: [PATCH] Fix: Enhance Donation Form block to display up to 100 forms (#7347) --- .../resources/editor/hooks/useFormOptions.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/DonationForms/Blocks/DonationFormBlock/resources/editor/hooks/useFormOptions.ts b/src/DonationForms/Blocks/DonationFormBlock/resources/editor/hooks/useFormOptions.ts index d9716d899a..bb6213ce70 100644 --- a/src/DonationForms/Blocks/DonationFormBlock/resources/editor/hooks/useFormOptions.ts +++ b/src/DonationForms/Blocks/DonationFormBlock/resources/editor/hooks/useFormOptions.ts @@ -12,6 +12,7 @@ export interface FormOption extends Form { } /** + * @unreleased Increase the per_page attribute to 100 to accommodate for more forms. * @since 3.2.0 include isLegacyForm, isLegacyFormTemplate & link. * @since 3.0.0 */ @@ -22,11 +23,16 @@ export default function useFormOptions(): { const formOptions = []; const {forms, isResolving} = useSelect((select) => { + const query = {per_page: 100}; return { // @ts-ignore - forms: select('core').getEntityRecords('postType', 'give_forms'), + forms: select('core').getEntityRecords('postType', 'give_forms', query), // @ts-ignore - isResolving: select('core/data').getIsResolving('core', 'getEntityRecords', ['postType', 'give_forms']), + isResolving: select('core/data').getIsResolving('core', 'getEntityRecords', [ + 'postType', + 'give_forms', + query, + ]), }; }, []);