[Enhancement] Create new filter `woocommerce_is_store_page` for filtering if the URL is a store page. (#50174)

Create a new filter woocommerce_is_store_page for filtering if the URL is a store page.

Fixes #50173

* Create new filter  for filtering if the URL is a store page

* Fix brace

* Update plugins/woocommerce/src/Admin/WCAdminHelper.php

Co-authored-by: Corey McKrill <916023+coreymckrill@users.noreply.github.com>

* Add changefile(s) from automation for the following project(s): woocommerce

* Remove extra whitespace

---------

Co-authored-by: Corey McKrill <916023+coreymckrill@users.noreply.github.com>
Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
Marianne380 2024-08-03 02:10:57 +02:00 committed by GitHub
parent d92161cbd1
commit 0ca152fa0d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 14 additions and 1 deletions

View File

@ -0,0 +1,4 @@
Significance: minor
Type: enhancement
Add filter `woocommerce_is_store_page` to modify whether Coming Soon mode considers a URL a store page or not.

View File

@ -230,7 +230,16 @@ class WCAdminHelper {
}
}
return false;
/**
* Filter if a URL is a store page.
*
* @since 9.3.0
* @param bool $is_store_page Whether or not the URL is a store page.
* @param string $url URL to check.
*/
$is_store_page = apply_filters( 'woocommerce_is_store_page', false, $url );
return filter_var( $is_store_page, FILTER_VALIDATE_BOOL );
}
/**