rachael-portier
8/13/2019 - 9:11 PM

Add Title to Account Endpoint Pages

function wpb_woo_endpoint_title( $title ) {
    if ( is_wc_endpoint_url( 'orders' ) ) {
        $title = "My Orders";
    }
    elseif ( is_wc_endpoint_url( 'edit-account' ) ) {
        $title = "Account Info";
    }
	elseif ( is_wc_endpoint_url( 'payment-methods' ) ) {
        $title = "Payment Info";
    }
	elseif ( is_wc_endpoint_url( 'edit-address' ) ) {
        $title = "Address Book";
    }
elseif ( is_account_page()  ) { // add your endpoint urls
      return null; // change your entry-title
   }
    echo '<h2 class="my-account-endpoint-title">' . $title . '</h2><span></span>';
}
add_filter( 'woocommerce_account_content', 'wpb_woo_endpoint_title' );