• I’d like to add another tab next to ‘Comments’ and ‘Posts’ that would show another custom post type I’ve created. Any tips on doing this?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Ultimate Member Support

    (@ultimatemembersupport)

    Hi @flantascience,

    You can follow this doc for instructions on how to add extra tabs to user profiles:

    https://docs.ultimatemember.com/article/69-how-do-i-add-my-extra-tabs-to-user-profiles

    Thanks.

    Thread Starter flantascience

    (@flantascience)

    I know you can’t offer a ton of support when customizing things. But i went to that site and copied the code into a custom plugin and when I activated, I got this message:

    The plugin generated 2 characters of unexpected output during activation. If you notice “headers already sent” messages, problems with syndication feeds or other issues, try deactivating or removing this plugin.

    Any tips on this? Is this code for an older plugin version? Did I mess something up? I’ll copy the code I used below here.

    <?php 
        /* 
        Plugin Name: Ultimate Member - Custom Post Types Extension by JF Web Dev
        Plugin URI: https://utlimatemember.com
        Description: This adds tabs and content for custom post types to the profiles page
        Author: Jim Flannery
        Version: 1.0
        Author URI: https://www.jfwebdev.com
        */
    ?>
    
    <?php
    
    /* 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['mycustomtab'] = array(
    		'name' => 'My custom tab',
    		'icon' => 'um-faicon-comments',
    	);
    		
    	return $tabs;
    		
    }
    
    /* Then we just have to add content to that tab using this action */
    
    add_action('um_profile_content_mycustomtab_default', 'um_profile_content_mycustomtab_default');
    function um_profile_content_mycustomtab_default( $args ) {
    	echo 'Hello world!';
    }
    
    ?>
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to add a new tab with a custom post type?’ is closed to new replies.