woocommerce_store_pages
Filter the store pages array to check if a URL is a store page.
Usage
add_filter( 'woocommerce_store_pages', 'wp_kama_woocommerce_store_pages_filter' );
/**
* Function for `woocommerce_store_pages` filter-hook.
*
* @param array $store_pages The store pages array. The keys are the page slugs and the values are the page IDs.
*
* @return array
*/
function wp_kama_woocommerce_store_pages_filter( $store_pages ){
// filter...
return $store_pages;
}
- $store_pages(array)
- The store pages array. The keys are the page slugs and the values are the page IDs.
Changelog
| Since 8.8.0 | Introduced. |
Where the hook is called
woocommerce_store_pages
woocommerce/src/Admin/WCAdminHelper.php 149
$store_pages = apply_filters( 'woocommerce_store_pages', $store_pages );