Skip to content

Commit

Permalink
Add back the default options to prevent breaking changes
Browse files Browse the repository at this point in the history
  • Loading branch information
kasparsd committed Feb 28, 2025
1 parent ef44e18 commit a6c408a
Showing 1 changed file with 27 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,33 @@
import { SelectControl } from '@wordpress/components';
import { __ } from '@wordpress/i18n';

function OrderControl( { order, orderBy, orderByOptions, onChange } ) {
const orderByOptionsDefault = [
{
label: __( 'Newest to oldest' ),
value: 'date/desc',
},
{
label: __( 'Oldest to newest' ),
value: 'date/asc',
},
{
/* translators: Label for ordering posts by title in ascending order. */
label: __( 'A → Z' ),
value: 'title/asc',
},
{
/* translators: Label for ordering posts by title in descending order. */
label: __( 'Z → A' ),
value: 'title/desc',
},
];

function OrderControl( {
order,
orderBy,
orderByOptions = orderByOptionsDefault,
onChange,
} ) {
return (
<SelectControl
__nextHasNoMarginBottom
Expand Down

0 comments on commit a6c408a

Please sign in to comment.