Skip to content

Instantly share code, notes, and snippets.

@iamandrewpeters
Created February 12, 2019 18:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iamandrewpeters/774975300234ea6228b73df9e444ea8c to your computer and use it in GitHub Desktop.
Save iamandrewpeters/774975300234ea6228b73df9e444ea8c to your computer and use it in GitHub Desktop.
Change Endpoint titles
/*
* Change the endpoint menu order
*/
function wpb_woo_my_account_order() {
$myorder = array(
'edit-account' => __( 'Change My Details', 'woocommerce' ),
'dashboard' => __( 'Dashboard', 'woocommerce' ),
'members-area' => __( 'My Courses', 'woocommerce' ),
'orders' => __( 'Orders', 'woocommerce' ),
'downloads' => __( 'Your Downloads', 'woocommerce' ),
'edit-address' => __( 'Addresses', 'woocommerce' ),
'payment-methods' => __( 'Payment Methods', 'woocommerce' ),
'customer-logout' => __( 'Logout', 'woocommerce' ),
);
return $myorder;
}
add_filter ( 'woocommerce_account_menu_items', 'wpb_woo_my_account_order' );
/*
* Change the entry title of the endpoints that appear in My Account Page
*/
function wpb_woo_endpoint_title( $title, $id ) {
if ( is_wc_endpoint_url( 'members-area/' ) && in_the_loop() ) { // add your endpoint urls
$title = "Courses"; // change your entry-title
}
return $title;
}
add_filter( 'the_title', 'wpb_woo_endpoint_title', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment