query_vars[ self::$endpoint ] ); if ( $is_endpoint && ! is_admin() && is_main_query() && in_the_loop() && is_account_page() ) { // New page title. $title = __( 'My Custom Endpoint', 'woocommerce' ); remove_filter( 'the_title', array( $this, 'endpoint_title' ) ); } return $title; } /** * Insert the new endpoint into the My Account menu. * * @param array $items * @return array */ public function new_menu_items( $items ) { // Remove the logout menu item. $logout = $items['customer-logout']; unset( $items['customer-logout'] ); // Insert your custom endpoint. $items[ self::$endpoint ] = __( 'My Custom Endpoint', 'woocommerce' ); // Insert back the logout item. $items['customer-logout'] = $logout; return $items; } /** * Endpoint HTML content. */ public function endpoint_content() { wc_get_template( 'myaccount/navigation.php' ); ?>
Hello World!