From d7e34aaba1f32d5e7a5253b9d4cfc2bfbd06510f Mon Sep 17 00:00:00 2001 From: Kaspars Dambis Date: Fri, 28 Feb 2025 11:20:18 +0200 Subject: [PATCH] Resolve the options via the helper instead --- packages/block-library/src/latest-posts/edit.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/block-library/src/latest-posts/edit.js b/packages/block-library/src/latest-posts/edit.js index bfcfb318bd8084..4652bfa0905494 100644 --- a/packages/block-library/src/latest-posts/edit.js +++ b/packages/block-library/src/latest-posts/edit.js @@ -54,6 +54,7 @@ import { DEFAULT_EXCERPT_LENGTH, } from './constants'; import { useToolsPanelDropdownMenuProps } from '../utils/hooks'; +import { useOrderByOptions } from '../query/utils'; /** * Module Constants @@ -87,7 +88,6 @@ export default function LatestPostsEdit( { attributes, setAttributes } ) { postsToShow, order, orderBy, - orderByOptions, categories, selectedAuthor, displayFeaturedImage, @@ -161,6 +161,8 @@ export default function LatestPostsEdit( { attributes, setAttributes } ) { ] ); + const orderByOptions = useOrderByOptions( 'post' ); + // If a user clicks to a link prevent redirection and show a warning. const { createWarningNotice } = useDispatch( noticeStore ); const showRedirectionPreventedNotice = ( event ) => {