AnsPress 2.0 – User Profile -> pull request
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
Working on it 😉