Automattic\WooCommerce\Internal\ShopperLists
ShopperListsController::maybe_register_wishlist_endpoint
Register the wishlist endpoint.
Method of the class: ShopperListsController{}
No Hooks.
Returns
null. Nothing (null).
Usage
$ShopperListsController = new ShopperListsController(); $ShopperListsController->maybe_register_wishlist_endpoint(): void;
ShopperListsController::maybe_register_wishlist_endpoint() ShopperListsController::maybe register wishlist endpoint code WC 11.0.1
public function maybe_register_wishlist_endpoint(): void {
if ( ! $this->is_enabled( 'wishlist' ) ) {
return;
}
$endpoint = $this->get_wishlist_endpoint();
add_filter( 'woocommerce_get_query_vars', array( $this, 'add_wishlist_query_var' ) );
add_filter( 'woocommerce_account_menu_items', array( $this, 'add_wishlist_menu_item' ) );
add_filter( 'woocommerce_endpoint_' . $endpoint . '_title', array( $this, 'wishlist_endpoint_title' ) );
add_action( 'woocommerce_account_' . $endpoint . '_endpoint', array( $this, 'render_wishlist_endpoint' ) );
}