WC_Query::get_endpoints_mask
Endpoint mask describing the places the endpoint should be added.
Method of the class: WC_Query{}
No Hooks.
Returns
Int.
Usage
$WC_Query = new WC_Query(); $WC_Query->get_endpoints_mask();
Changelog
| Since 2.6.2 | Introduced. |
WC_Query::get_endpoints_mask() WC Query::get endpoints mask code WC 10.8.1
public function get_endpoints_mask() {
if ( 'page' === get_option( 'show_on_front' ) ) {
$page_on_front = get_option( 'page_on_front' );
$myaccount_page_id = get_option( 'woocommerce_myaccount_page_id' );
$checkout_page_id = get_option( 'woocommerce_checkout_page_id' );
if ( in_array( $page_on_front, array( $myaccount_page_id, $checkout_page_id ), true ) ) {
return EP_ROOT | EP_PAGES;
}
}
return EP_PAGES;
}