Reply To: Additional tabs on account page

Home Forums User Registration Additional tabs on account page Reply To: Additional tabs on account page

#20216

jfuentes3002
Participant

I can not make an example work to add more than one endpoint. In the example above it is shown how to make it appear in the menu, but the example is not finished for the creation of the pages, according to how I interpret this example I get errors of type 404.

What will I be doing wrong?
What will be missing?

Oops!
It looks like nothing was found at this location. Maybe try one of the links below or a search?

Error 404

Example:


add_filter( 'user_registration_account_menu_items', 'ur_custom_menu_items', 10, 1 );
function ur_custom_menu_items( $items ) {
	$new_items = array(
		'new-item-1'	=> __( 'Test1', 'user-registration' ),
		'new-item-2'	=> __( 'Test2', 'user-registration' ),
		'new-item-3'	=> __( 'Test3', 'user-registration' ),
	);

	return array_merge( $items, $new_items );
}

add_action( 'init', 'user_registration_add_new_my_account_endpoint' );
function user_registration_add_new_my_account_endpoint() {
    add_rewrite_endpoint( 'new-item-1', EP_PAGES );
    add_rewrite_endpoint( 'new-item-2', EP_PAGES );
    add_rewrite_endpoint( 'new-item-3', EP_PAGES );
}

add_action( 'user_registration_account_new-item-1_endpoint', 'user_registration_new_item_1_endpoint_content' );
function user_registration_new_item_1_endpoint_content() {
    //echo 'Your new content';
    ur_get_template( 'myaccount/new-item-1.php');
}

add_action( 'user_registration_account_new-item-2_endpoint', 'user_registration_new_item_2_endpoint_content' );
function user_registration_new_item_2_endpoint_content() {
    //echo 'Your new content';
    ur_get_template( 'myaccount/new-item-2.php');
}

add_action( 'user_registration_account_new-item-3_endpoint', 'user_registration_new_item_3_endpoint_content' );
function user_registration_new_item_3_endpoint_content() {
    //echo 'Your new content';
    ur_get_template( 'myaccount/new-item-3.php');
}

please help!

From already thank you very much.

PS: I hope my English has been understood.