From 023040d58f7c63ca22cfaed73f9ae701b09cc564 Mon Sep 17 00:00:00 2001 From: Adnan Haque <3737780+haqadn@users.noreply.github.com> Date: Tue, 22 Oct 2024 17:55:31 +0200 Subject: [PATCH] Boost: Don't add a posts page if front page is set but not the posts page (#39862) --- .../source-providers/providers/WP_Core_Provider.php | 4 ++-- projects/plugins/boost/changelog/update-ccss-core-providers | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 projects/plugins/boost/changelog/update-ccss-core-providers diff --git a/projects/plugins/boost/app/lib/critical-css/source-providers/providers/WP_Core_Provider.php b/projects/plugins/boost/app/lib/critical-css/source-providers/providers/WP_Core_Provider.php index e2b63769a6784..68445b4031fbb 100644 --- a/projects/plugins/boost/app/lib/critical-css/source-providers/providers/WP_Core_Provider.php +++ b/projects/plugins/boost/app/lib/critical-css/source-providers/providers/WP_Core_Provider.php @@ -43,8 +43,8 @@ public static function get_critical_source_urls( $context_posts = array() ) { if ( ! empty( $permalink ) ) { $urls['posts_page'] = array( $permalink ); } - } else { - $urls['posts_page'] = (array) home_url( '/' ); + } elseif ( ! $front_page ) { + $urls['posts_page'] = array( home_url( '/' ) ); } return $urls; diff --git a/projects/plugins/boost/changelog/update-ccss-core-providers b/projects/plugins/boost/changelog/update-ccss-core-providers new file mode 100644 index 0000000000000..527e9511c0c8b --- /dev/null +++ b/projects/plugins/boost/changelog/update-ccss-core-providers @@ -0,0 +1,4 @@ +Significance: patch +Type: changed + +Critical CSS: Make the list of critical CSS URLs more efficient.