From f73edc852d84038a34148c30ba69bd512f8f04e2 Mon Sep 17 00:00:00 2001 From: "Stephen A. Bernhardt" Date: Fri, 17 Oct 2025 06:48:03 -0500 Subject: [PATCH 1/3] Check query order in loop.php --- src/wp-content/themes/twentyten/loop.php | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/wp-content/themes/twentyten/loop.php b/src/wp-content/themes/twentyten/loop.php index e1348f3122b29..16c46e1fd39e3 100644 --- a/src/wp-content/themes/twentyten/loop.php +++ b/src/wp-content/themes/twentyten/loop.php @@ -20,10 +20,19 @@ ?> -max_num_pages > 1 ) : ?> +max_num_pages > 1 ) : + $order = get_query_var( 'order', 'DESC' ); + $is_desc = ( 'DESC' === $order ); + + $new_posts_text = __( 'Newer posts ', 'twentyten' ); + $old_posts_text = __( ' Older posts', 'twentyten' ); + + $prev_link = $is_desc ? get_next_posts_link( $old_posts_text ) : get_previous_posts_link( $old_posts_text ); + $next_link = $is_desc ? get_previous_posts_link( $new_posts_text ) : get_next_posts_link( $new_posts_text ); + ?> @@ -205,7 +214,7 @@ max_num_pages > 1 ) : ?> From d83213d8d31b50339346d76f0e8fbfb56b4392fe Mon Sep 17 00:00:00 2001 From: "Stephen A. Bernhardt" Date: Fri, 17 Oct 2025 07:02:09 -0500 Subject: [PATCH 2/3] Coding standards fix --- src/wp-content/themes/twentyten/loop.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/wp-content/themes/twentyten/loop.php b/src/wp-content/themes/twentyten/loop.php index 16c46e1fd39e3..c86b39b487e06 100644 --- a/src/wp-content/themes/twentyten/loop.php +++ b/src/wp-content/themes/twentyten/loop.php @@ -20,7 +20,8 @@ ?> -max_num_pages > 1 ) : +max_num_pages > 1 ) : $order = get_query_var( 'order', 'DESC' ); $is_desc = ( 'DESC' === $order ); From 5209dc00ddc81f3f9f66bb869cd8355ae5c6aef0 Mon Sep 17 00:00:00 2001 From: "Stephen A. Bernhardt" Date: Fri, 17 Oct 2025 07:48:51 -0500 Subject: [PATCH 3/3] Add missing checks for `$prev_link` and `$next_link` --- src/wp-content/themes/twentyten/loop.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/wp-content/themes/twentyten/loop.php b/src/wp-content/themes/twentyten/loop.php index c86b39b487e06..758342a3a67ff 100644 --- a/src/wp-content/themes/twentyten/loop.php +++ b/src/wp-content/themes/twentyten/loop.php @@ -32,8 +32,13 @@ $next_link = $is_desc ? get_previous_posts_link( $new_posts_text ) : get_next_posts_link( $new_posts_text ); ?> @@ -215,7 +220,12 @@ max_num_pages > 1 ) : ?>