• Hello,
    sorry if stupid question. I am still learning wordpress and php at all.

    My problem is:
    on the side – https://github.com/woocommerce/woocommerce/wiki/Customising-account-page-tabs
    And everything works fine for me, but have two issues.
    1) There is point “Adding content to an endpoint”. And there is such code:

    
    function my_custom_endpoint_content() {
    	echo '<p>Hello World!</p>';
    }
    
    add_action( 'woocommerce_account_my-custom-endpoint_endpoint', 'my_custom_endpoint_content' );
    

    But when I click on my new tab in my account page it takes me to my page “my-custom-endpoint”. But I can’t see anywhere “Hello World!”. So where is that added content? How to get that?

    2) I would like to open my new tab content the same as other tabs. I mean on the my account page that I can see the rest of my tabs, and content should be in frame like the rest of tabs (like dashboard, orders etc.). But instead it opens another page which is “my-custom-endpoint”. How to change that?

    For any helpe great thanks in advance.
    Best Regards
    Wojtek

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • @pajczur Been awhile, but I think you need to include a div tag in your my_custom_endpoint_content() as a wrapper, to position the content correctly.

    Thread Starter pajczur

    (@pajczur)

    Great thanks for your reply.
    But unfortunately it didn’t helped. Nothing changed.
    I make something like that:
    echo '<div><p>Hello World!</p></div>';

    Is it OK?

    But I thinks maybe it has something to do with registering the endpoint. There is line like that:
    add_rewrite_endpoint( 'my-custom-endpoint', EP_ROOT | EP_PAGES );

    Shouldn’t it be instead EP_PAGES something else? But what?

    • This reply was modified 4 years, 5 months ago by pajczur.
    Thread Starter pajczur

    (@pajczur)

    I also tried to remove page “my-custom-endpoint” but then when I click on my new tab it takes me to 404 error page.
    But As I told in point 2) I don’t want it takes me to separate page. I just want to open tab, like any other tabs: Dashboard, Orders, Downloads, Account details etc.

    Thread Starter pajczur

    (@pajczur)

    OK, I’ve found out that I forgot to click “Save changes” in wordpress->settings->permalinks.
    Now everything works fine

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Adding tab to account page – content issue’ is closed to new replies.