AnsPress 2.0 – User Profile -> pull request

6.04K viewsCore
1

Hi,

I figured out how to add a custom tab to the user-profile.
I love the extension-pattern that you applied! Thanks!

One issue I found was that the tab-page which I registered with
ap_register_user_page('testtab', __('Test tab', 'ap'), array('AnsPress_User_Page_Test', 'output'));
came first in the menu list. Probably because I called the ap_register_user_page too early.

Anyway, it started me thinking that things might get nasty when multiple plugins want to add a tab -> in which order will they be added?
So I have made some changes to the anspress-master\includes\user.php file in such way that you can now specify an order when registering a tab:
ap_register_user_page('testtab', __('Test tab', 'ap'), 90, array('AnsPress_User_Page_Test', 'output'));

If you agree to it, you can find the changes here: https://www.dropbox.com/s/l2mu2mtfv1kiwwa/user.php?dl=0
I have all the changed sections marked with the //MVRM comment, so you can easily find my changes.

Greetings,

Michiel

0

Hi, I think I succeeded in creating a pull request:
https://github.com/wp3/anspress/pull/243
I don’t know if it was still needed for this change but I just wanted to sort out how to do this so I’m future-proof 😉

Working on it 😉

You are viewing 1 out of 3 answers, click here to view all answers.