From 356d8f0ed2a4e040a045500e7c62038f65117c9c Mon Sep 17 00:00:00 2001 From: Don Bowman Date: Thu, 18 Aug 2022 19:37:10 -0400 Subject: [PATCH] fix: check if max_page is set This avoids the warning: PHP message: PHP Warning: Undefined variable $max_page in that otherwise occurs --- feed-json-functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/feed-json-functions.php b/feed-json-functions.php index 7309332..4c78a16 100644 --- a/feed-json-functions.php +++ b/feed-json-functions.php @@ -51,7 +51,7 @@ function get_link_from_json_feed( $link ) { function get_json_feed_next_url() { global $paged, $wp_query; - if ( ! $max_page ) { + if ( ! isset($max_page) || ! $max_page ) { $max_page = $wp_query->max_num_pages; }