Skip to content

Commit

Permalink
Resolve the options via the helper instead
Browse files Browse the repository at this point in the history
  • Loading branch information
kasparsd committed Feb 28, 2025
1 parent 2cca836 commit d7e34aa
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/block-library/src/latest-posts/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ import {
DEFAULT_EXCERPT_LENGTH,
} from './constants';
import { useToolsPanelDropdownMenuProps } from '../utils/hooks';
import { useOrderByOptions } from '../query/utils';

/**
* Module Constants
Expand Down Expand Up @@ -87,7 +88,6 @@ export default function LatestPostsEdit( { attributes, setAttributes } ) {
postsToShow,
order,
orderBy,
orderByOptions,
categories,
selectedAuthor,
displayFeaturedImage,
Expand Down Expand Up @@ -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 ) => {
Expand Down

0 comments on commit d7e34aa

Please sign in to comment.