- - $section_title ) : - // Only logged in users can have favorites. - if ( 'favorites' === $browse && ! is_user_logged_in() ) { - continue; - } - - $section_args = array( - 'post_type' => 'plugin', - 'post_status' => 'publish', - 'posts_per_page' => 4, - 'browse' => $browse, - ); - - if ( 'popular' === $browse ) { - $section_args['meta_key'] = '_active_installs'; - $section_args['orderby'] = 'meta_value_num'; - unset( $section_args['browse'] ); - } else if ( 'blocks' === $browse ) { - $section_args['orderby'] = 'rand'; - $section_args['meta_query'] = [ - [ - 'key' => '_active_installs', - 'value' => 200, - 'type' => 'numeric', - 'compare' => '>=', - ], - [ - 'key' => 'tested', - 'value' => Template::get_current_major_wp_version() - 0.2, - 'compare' => '>=', - ], - ]; - } - - $section_query = new WP_Query( $section_args ); - - // If the user doesn't have any favorites, omit the section. - if ( 'favorites' === $browse && ! $section_query->have_posts() ) { - continue; - } - - // Overwrite the global query with the section query. - $wp_query = $section_query; - - $safe_title = esc_html( $section_title ); - $title = do_blocks ( << -

$safe_title

- - BLOCKS - ); - - ?> - -
-
- - "> - ' . esc_html( $section_title ) . '' - ); - ?> - -
- - -
- - - -
- - BLOCKS - ); - - // Reset the global $wp_query - wp_reset_query(); - ?> -
- - - -