Skip to content

Commit 44966ec

Browse files
committed
🐛 BUG: Fixed is_wc_endpoint_url causing a fatal error when not within a WooCommerce context
1 parent be93439 commit 44966ec

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

admin/clwc-woocommerce-account-tab.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ function clwc_my_account_menu_items( $items ) {
7171
/**
7272
* Endpoint HTML content.
7373
*
74-
* @return string
74+
* @return void
7575
*/
7676
function clwc_endpoint_content() {
7777
echo do_shortcode( '[clwc_dashboard]' );
@@ -87,7 +87,7 @@ function clwc_endpoint_content() {
8787
*/
8888
function clwc_endpoint_page_title( $title ) {
8989
// Update 'Customer Loyalty' page title.
90-
if ( is_wc_endpoint_url( 'customer-loyalty' ) && in_the_loop() ) {
90+
if ( function_exists( 'is_wc_endpoint_url' ) && is_wc_endpoint_url( 'customer-loyalty' ) && in_the_loop() ) {
9191
$title = apply_filters( 'clwc_my_account_endpoint_page_title', esc_attr__( 'Customer Loyalty', 'customer-loyalty-for-woocommerce' ) );
9292
}
9393
return $title;

0 commit comments

Comments
 (0)