Jon
(@freshyjon)
Try this:
/* First we need to extend main profile tabs */
add_filter('um_profile_tabs', 'add_custom_profile_tab', 1000 );
function add_custom_profile_tab( $tabs ) {
$tabs['polls'] = array(
'name' => 'My Polls',
'icon' => 'um-faicon-bar-chart',
'custom' => true,
);
// return all the tabs (and any of the ones above)
return $tabs;
}
/* Then we just have to add content to the POLLS tab using this action */
add_action('um_profile_content_polls_default', 'um_profile_content_polls_default');
function um_profile_content_polls_default( $args ) {
$profile_id = um_profile_id();
$profile_user = get_user_by( 'id', $profile_id );
echo '<div class="checklist checklist-columns-3">';
echo do_shortcode('[list-posts author="' . $profile_id . '"]');
echo '</div>';
}
Note, I’m still on version 2.0.2 so I don’t know if it works on 2.0.9+, but I’m sure it’s fine. I think their old documentation on their site is still for version 1.X.
-
This reply was modified 6 years ago by Jon.
Thread Starter
jx4550
(@jx4550)
Aren’t those for the actual profile page?
What I’m looking for is on the “My Account” page
I tried your hooks, regardless, but they did not show on the page as expected still.
Thank you!
Jon
(@freshyjon)
Yes, that code above was to create a new tab on the Profile. I see that’s now what you wanted. If you download the latest plugin fileset, you can see these do_action are available on the account.php template:
<?php
add_action( 'um_before_form', 'my_before_form', 10, 1 );
function my_before_form( $args ) {
// your code here
}
?>
<?php
add_action( 'um_after_account_page_load', 'my_after_account_page_load', 10 );
function my_after_account_page_load() {
// your code here
}
?>
Thread Starter
jx4550
(@jx4550)
Unfortunately, that does not really help.
we don’t want a new tab. we want to append info to the general tab, BEFORe the submit button. Neither of the hooks above work, and I cannot locate any other hooks in the template.
In an older version, the hook um_after_account_{$tab_id} was PERFECT for this.
Why was it removed? How can I replicate this functionality?
Thanks.
Thread Starter
jx4550
(@jx4550)
updated and it works idk why, same hook as before