diff --git a/projects/plugins/boost/app/lib/Foundation_Pages.php b/projects/plugins/boost/app/lib/Foundation_Pages.php index 0e0e39bd5daa5..9d4c10842ddf4 100644 --- a/projects/plugins/boost/app/lib/Foundation_Pages.php +++ b/projects/plugins/boost/app/lib/Foundation_Pages.php @@ -12,6 +12,7 @@ public function setup() { } add_filter( 'jetpack_boost_critical_css_providers', array( $this, 'remove_ccss_front_page_provider' ), 10, 2 ); + add_filter( 'display_post_states', array( $this, 'add_display_post_states' ), 10, 2 ); } public function remove_ccss_front_page_provider( $providers ) { @@ -41,6 +42,20 @@ public function get_properties() { ); } + public function add_display_post_states( $post_states, $post ) { + $foundation_pages = $this->get_pages(); + if ( ! empty( $foundation_pages ) ) { + $post_url = untrailingslashit( get_permalink( $post ) ); + $foundation_pages = array_map( 'untrailingslashit', $foundation_pages ); + + if ( in_array( $post_url, $foundation_pages, true ) ) { + $post_states[] = __( 'Foundation Page', 'jetpack-boost' ); + } + } + + return $post_states; + } + private function get_max_pages() { return Premium_Features::has_any() ? 10 : 1; } diff --git a/projects/plugins/boost/changelog/update-boost-indicate-foundation-page-in-wp-post-listing b/projects/plugins/boost/changelog/update-boost-indicate-foundation-page-in-wp-post-listing new file mode 100644 index 0000000000000..945a55cea1ab0 --- /dev/null +++ b/projects/plugins/boost/changelog/update-boost-indicate-foundation-page-in-wp-post-listing @@ -0,0 +1,5 @@ +Significance: patch +Type: added +Comment: Add "Foundation Page" indication next to pages in WPs page listing screen. + +