Viewing 15 replies - 1 through 15 (of 18 total)
  • Plugin Author Ultimate Member

    (@ultimatemember)

    Please see our code examples:

    https://gist.github.com/ultimatemember

    Thread Starter Kishores

    (@kishores)

    Plugin Author Ultimate Member

    (@ultimatemember)

    Yes ??

    Thread Starter Kishores

    (@kishores)

    https://gist.github.com/ultimatemember/8cdaf61e7bd9de35512c

    I have used this to add 1 tab, but I need to add multiple tabs. How can i do?

    Plugin Author Ultimate Member

    (@ultimatemember)

    Use the same code and change the tab IDs.

    Thanks!

    Thread Starter Kishores

    (@kishores)

    Hey,

    I am using inside a class

    public function __construct() {
    		add_filter('um_profile_tabs', array( $this, 'add_custom_profile_tab' ), 1000 );
    		add_action('um_profile_content_mycustomtab_default', array( $this, 'um_profile_content_mycustomtab_default' ));
    
    		add_filter('um_profile_tabs', array( $this, 'add_custom_profile_tab1' ), 1000 );
    		add_action('um_profile_content_mycustomtab1_default', array( $this, 'um_profile_content_mycustomtab1_default' ));
    	}
    
    	function add_custom_profile_tab( $tabs ) {
    
    			$tabs['mycustomtab'] = array(
    				'name' => 'My custom tab',
    				'icon' => 'um-faicon-comments',
    			);
    			return $tabs;
    
    	}
    
    	function um_profile_content_mycustomtab_default( $args ) {
    		echo 'Hello world!';
    	}
    
    	function add_custom_profile_tab1( $tabs ) {
    
    			$tabs['mycustomtab1'] = array(
    				'name' => 'My custom tab',
    				'icon' => 'um-faicon-comments',
    			);
    			return $tabs;
    
    	}
    
    	function um_profile_content_mycustomtab1_default( $args ) {
    		echo 'Hello world!';
    	}

    I am sorry it is not working. Can you please help me adding 2/3 tabs

    Plugin Author Ultimate Member

    (@ultimatemember)

    Out of interest what type of extension are you building?

    Thread Starter Kishores

    (@kishores)

    I am adding
    https://www.ads-software.com/plugins/wp-job-manager/

    to this plugin. I have made this
    https://www.ads-software.com/plugins/buddypress-job-manager/

    Now I want to make ultimate-member-job-manager. So It will integrate WP job-manager with ultimate-member

    Thread Starter Kishores

    (@kishores)

    I want to add all tabs what are present in buddypress-job-manager to this new ext.
    Here demo for buddypress
    https://buddypress-job-manager.opentuteplus.com/

    I am unable to figure out how to add tabs. Multiple tabs not working. Though I am able to add single tab

    Plugin Author Ultimate Member

    (@ultimatemember)

    Please visit our forum or see our code examples, we’ve written codes that allow you to add custom tab, to add multiple tabs the function names need to be unique.

    Thread Starter Kishores

    (@kishores)

    Hello,

    Here is my code.

    class UM_WP_Job_Manager_Component {
    
    	/**
    	 * Start the Job Manager component creation process
    	 *
    	 *
    	 */
    	public function __construct() {
    		add_filter('um_profile_tabs', array( $this, 'add_custom_profile_tab' ), 1000 );
    		add_filter('um_profile_tabs', array( $this, 'add_custom_profile_tab2' ), 1000 );
    		add_action('um_profile_content_mycustomtab2_default', array( $this, 'um_profile_content_mycustomtab2_default' ));
    		add_action('um_profile_content_mycustomtab_default', array( $this, 'um_profile_content_mycustomtab_default' ));
    	}
    
    	function add_custom_profile_tab( $tabs ) {
    
    			$tabs['mycustomtab'] = array(
    				'name' => 'My custom tab',
    				'icon' => 'um-faicon-comments',
    			);
    
    			return $tabs;
    
    	}
    
    	function add_custom_profile_tab2( $tabs ) {
    
    		$tabs['mycustomtab2'] = array(
    				'name' => 'My custom tab',
    				'icon' => 'um-faicon-comments',
    		);
    
    		return $tabs;
    
    	}
    
    	function um_profile_content_mycustomtab2_default( $args ) {
    		echo "tab 2";
    	}
    
    	function um_profile_content_mycustomtab_default( $args ) {
    		echo "tab 1";
    	}
    
    }
    
    new UM_WP_Job_Manager_Component();

    It adds two tabs, and displays its content. Works!!

    But when I am replacing ids “mycustomtab2” with “jobmanager”, tab2 is not working. Please help me out.

    Thread Starter Kishores

    (@kishores)

    Also how can I add a sub tabs?

    Thread Starter Kishores

    (@kishores)

    Thanks ?? i am able to add multiple tabs.

    I need to know is it possible to add sub tabs?

    Plugin Author Ultimate Member

    (@ultimatemember)

    Please see this for example:

    We use this for our bbpress extension tabs

    add_filter('um_profile_tabs', 'um_bbpress_add_tab', 1000 );
    	function um_bbpress_add_tab( $tabs ) {
    
    		global $um_bbpress;
    
    		$user_id = um_user('ID');
    
    		$tabs['forums'] = array(
    			'name' => __('Forums','um-bbpress'),
    			'icon' => 'um-faicon-comments',
    			'subnav' => array(
    				'topics' => __('Topics Started','um-bbpress') . '<span>' . bbp_get_user_topic_count_raw( $user_id ) . '</span>',
    				'replies' => __('Replies Created','um-bbpress') . '<span>' . bbp_get_user_reply_count_raw( $user_id ) . '</span>',
    				'favorites' => __('Favorites','um-bbpress') . '<span>' . count( bbp_get_user_favorites_topic_ids( $user_id ) ) . '</span>',
    				'subscriptions' => __('Subscriptions','um-bbpress') . '<span>' . $um_bbpress->user_subscriptions_count( $user_id ) . '</span>',
    			),
    			'subnav_default' => 'topics'
    		);
    
    		return $tabs;
    
    	}
    Thread Starter Kishores

    (@kishores)

    Thanks ?? It worked

Viewing 15 replies - 1 through 15 (of 18 total)
  • The topic ‘New Member Profile Tab’ is closed to new replies.