Add Favorite Posts to Ultimate Member User Profile Tabs in WordPress
<?php | |
// Customize Profile Tabs | |
/* add a custom tab to show user pages */ | |
add_filter('um_profile_tabs', 'pages_tab', 1000 ); | |
function pages_tab( $tabs ) { | |
$tabs['pages'] = array( | |
'name' => 'Favorite Posts', | |
'icon' => 'um-faicon-star', | |
'custom' => true | |
); | |
return $tabs; | |
} | |
/* Tell the tab what to display */ | |
add_action('um_profile_content_pages_default', 'um_profile_content_pages_default'); | |
function um_profile_content_pages_default( $args ) { | |
global $ultimatemember; ?> | |
<?php echo do_shortcode('[user_favorites user_id="" include_links="true" post_types="post" include_buttons="false"]'); ?> | |
<?php | |
} |
This comment has been minimized.
This comment has been minimized.
Hi. Where i need to put this code so it will work? Which file? Thanks. I have both plugins. I want to active favorites in ultimate member. I will be waiting for answer. Please. |
This comment has been minimized.
This comment has been minimized.
Hi Michelle, can you tell where to apply this code please? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This comment has been minimized.
This is to be used with the following plugins:
https://wordpress.org/plugins/ultimate-member/
https://wordpress.org/plugins/favorites/