Skip to content

Commit

Permalink
Block theme: Remove customizations for the front page
Browse files Browse the repository at this point in the history
These can now be handled without workarounds, since the main query on the front page is the patterns query.
  • Loading branch information
ryelle committed Apr 17, 2024
1 parent 196633b commit 0dcf797
Showing 1 changed file with 0 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,6 @@ function get_curation_options( $options ) {
break;
}

// Show the correct filters on the front page.
if ( is_front_page() ) {
$current = 'core';
$label = _x( 'Curated', 'filter option label', 'wporg-patterns' );
}

return array(
'label' => $label,
'title' => __( 'Filter', 'wporg-patterns' ),
Expand Down Expand Up @@ -199,11 +193,6 @@ function get_sort_options( $options ) {
$sort = 'favorite_count_desc';
}

// Show the correct filters on the front page.
if ( is_front_page() ) {
$sort = 'date_desc';
}

$label = __( 'Sort', 'wporg-patterns' );
switch ( $sort ) {
case 'date_desc':
Expand Down Expand Up @@ -269,15 +258,6 @@ function inject_other_filters( $key ) {
}
}

if ( is_front_page() ) {
if ( 'curation' !== $key ) {
printf( '<input type="hidden" name="curation" value="core" />' );
}
if ( 'orderby' !== $key ) {
printf( '<input type="hidden" name="orderby" value="date_desc" />' );
}
}

// Pass through search query.
if ( isset( $wp_query->query['s'] ) ) {
printf( '<input type="hidden" name="s" value="%s" />', esc_attr( $wp_query->query['s'] ) );
Expand Down

0 comments on commit 0dcf797

Please sign in to comment.