Title: Hasi Weragala's Replies | WordPress.org

---

# Hasi Weragala

  [  ](https://wordpress.org/support/users/hasinthawk/)

 *   [Profile](https://wordpress.org/support/users/hasinthawk/)
 *   [Topics Started](https://wordpress.org/support/users/hasinthawk/topics/)
 *   [Replies Created](https://wordpress.org/support/users/hasinthawk/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/hasinthawk/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/hasinthawk/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/hasinthawk/engagements/)
 *   [Favorites](https://wordpress.org/support/users/hasinthawk/favorites/)

 Search replies:

## Forum Replies Created

Viewing 15 replies - 1 through 15 (of 58 total)

1 [2](https://wordpress.org/support/users/hasinthawk/replies/page/2/?output_format=md)
[3](https://wordpress.org/support/users/hasinthawk/replies/page/3/?output_format=md)
[4](https://wordpress.org/support/users/hasinthawk/replies/page/4/?output_format=md)
[→](https://wordpress.org/support/users/hasinthawk/replies/page/2/?output_format=md)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Redirection] Performance](https://wordpress.org/support/topic/performance-79/)
 *  Thread Starter [Hasi Weragala](https://wordpress.org/support/users/hasinthawk/)
 * (@hasinthawk)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/performance-79/#post-18125777)
 * [@johnny5](https://wordpress.org/support/users/johnny5/) Thank you Jhon sir. 
   Glad to hear that.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Nextend Social Login and Register] UM Welcome Email for new registrations](https://wordpress.org/support/topic/um-welcome-email-for-new-registrations/)
 *  Thread Starter [Hasi Weragala](https://wordpress.org/support/users/hasinthawk/)
 * (@hasinthawk)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/um-welcome-email-for-new-registrations/#post-18095283)
 * Hi [@laszloszalvak](https://wordpress.org/support/users/laszloszalvak/)
 * Thank you sir, It worked well. Appreciate the prompt response.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Ultimate Member – User Profile, Registration, Login, Member Directory, Content Restriction & Membership Plugin] Possible to customize empty profile message?](https://wordpress.org/support/topic/possible-to-customize-empty-profile-message/)
 *  [Hasi Weragala](https://wordpress.org/support/users/hasinthawk/)
 * (@hasinthawk)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/possible-to-customize-empty-profile-message/#post-18089778)
 * thank you Veronica. Appreciate it!
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Ultimate Member – User Profile, Registration, Login, Member Directory, Content Restriction & Membership Plugin] Possible to customize empty profile message?](https://wordpress.org/support/topic/possible-to-customize-empty-profile-message/)
 *  [Hasi Weragala](https://wordpress.org/support/users/hasinthawk/)
 * (@hasinthawk)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/possible-to-customize-empty-profile-message/#post-18089745)
 * Hi Vernoica
 * I have the same question. But is there any way to do this without plugin? I tried
   to do with the_content filter but didn’t work.
 * Best Regards
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Ultimate Member – User Profile, Registration, Login, Member Directory, Content Restriction & Membership Plugin] Show all fields in profile even when empty](https://wordpress.org/support/topic/show-all-fields-in-profile-even-when-empty/)
 *  Thread Starter [Hasi Weragala](https://wordpress.org/support/users/hasinthawk/)
 * (@hasinthawk)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/show-all-fields-in-profile-even-when-empty/#post-18089695)
 * Hi Veronica
 * Many thanks for the quick response. Appreciate it. You have a good day now.
 * Best Regards
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Nextend Social Login and Register] The password](https://wordpress.org/support/topic/the-password/)
 *  Thread Starter [Hasi Weragala](https://wordpress.org/support/users/hasinthawk/)
 * (@hasinthawk)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/the-password/#post-18087318)
 * Hi Robert
 * We’ve a use case where visitors who logged in using the traditional method and
   later connect with their social account. So we need to identify users like that.
   Is there a way to do that. ?
 * Because by simply checking for not null provider is not enough in this case.
 * Awaiting a favorable response.
 * Best Regards
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Ultimate Member – User Profile, Registration, Login, Member Directory, Content Restriction & Membership Plugin] Add multiple tabs to accounts page](https://wordpress.org/support/topic/add-multiple-tabs-to-accounts-page/)
 *  Thread Starter [Hasi Weragala](https://wordpress.org/support/users/hasinthawk/)
 * (@hasinthawk)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/add-multiple-tabs-to-accounts-page/page/2/#post-18082768)
 * Hi Veronica
 * Problem got solved, it was a stray <div> from the comments custom tab.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Ultimate Member – User Profile, Registration, Login, Member Directory, Content Restriction & Membership Plugin] Add multiple tabs to accounts page](https://wordpress.org/support/topic/add-multiple-tabs-to-accounts-page/)
 *  Thread Starter [Hasi Weragala](https://wordpress.org/support/users/hasinthawk/)
 * (@hasinthawk)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/add-multiple-tabs-to-accounts-page/#post-18082686)
 * Hi Veronica
 * Sorry for the late response. No there are no any errors logged in the console
   as well
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Ultimate Member – User Profile, Registration, Login, Member Directory, Content Restriction & Membership Plugin] Add multiple tabs to accounts page](https://wordpress.org/support/topic/add-multiple-tabs-to-accounts-page/)
 *  Thread Starter [Hasi Weragala](https://wordpress.org/support/users/hasinthawk/)
 * (@hasinthawk)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/add-multiple-tabs-to-accounts-page/#post-18082529)
 * Hi, There are no errors logged in the debug.log.
 * The last two tabs are supposed to be inside **div.um-account-main** but apparently
   they are outside of it.
 * ![](https://i0.wp.com/i.ibb.co/XCKB5s0/Screenshot-2024-10-19-072913.jpg?ssl=1)
    -  This reply was modified 1 year, 6 months ago by [Hasi Weragala](https://wordpress.org/support/users/hasinthawk/).
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Ultimate Member – User Profile, Registration, Login, Member Directory, Content Restriction & Membership Plugin] Add multiple tabs to accounts page](https://wordpress.org/support/topic/add-multiple-tabs-to-accounts-page/)
 *  Thread Starter [Hasi Weragala](https://wordpress.org/support/users/hasinthawk/)
 * (@hasinthawk)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/add-multiple-tabs-to-accounts-page/#post-18082502)
 * Hi, but why isn’t it closed? have i done anything wrong in my code?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Ultimate Member – User Profile, Registration, Login, Member Directory, Content Restriction & Membership Plugin] Add multiple tabs to accounts page](https://wordpress.org/support/topic/add-multiple-tabs-to-accounts-page/)
 *  Thread Starter [Hasi Weragala](https://wordpress.org/support/users/hasinthawk/)
 * (@hasinthawk)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/add-multiple-tabs-to-accounts-page/#post-18082379)
 * [@missveronicatv](https://wordpress.org/support/users/missveronicatv/)
 * Here is the complete code , when i run it through the html validator it shows
   these errors. It shows an unclosed form element but i have not used any form 
   therein the code. Please help
 * [https://validator.w3.org/nu/#l68c22889](https://validator.w3.org/nu/#l68c22889)
 * Here is the site : [https://bit.ly/3Yb7q6H](https://bit.ly/3Yb7q6H)
 *     ```wp-block-code
       <?php		// Requires for user deletion process	require_once( ABSPATH.'wp-admin/includes/user.php' );	// Init ajax handlers	add_action( 'wp_ajax_nxl_delete_acct', 'nxl_delete_acct' );	add_action( 'wp_ajax_nopriv_nxl_delete_acct', 'nxl_delete_acct' );	function nxl_user_logged_using_socials(){				global $wpdb;				//get the user id		$user_id;				if ( is_user_logged_in() ) {    		$user_id = get_current_user_id();		} else {    		return false;		}				$provider = $wpdb->get_results("SELECT type FROM {$wpdb->prefix}social_users WHERE ID=".$user_id, OBJECT);				if(empty($provider) || is_null($provider)){			return false;		}		else{			return true;		}		  		if ( $wpdb->last_error ) {  			error_log('wpdb error: ' . $wpdb->last_error);		}			}  /* add new tab called "nxltab" */      add_filter('um_account_page_default_tabs_hook', 'nxl_tab_in_um', 100 );    function nxl_tab_in_um( $tabs ) {				/* Add Comments tab */        $tabs[900][ 'comments_tab' ] = array(            'icon'         => 'um-faicon-plus',            'title'        => __( 'Comments', 'ultimate-member' ),            'custom'       => true,			'show_button'  => false        );				/* Add Logout tab */        $tabs[1000][ 'nxltab' ] = array(            'icon'         => 'um-icon-log-out',            'title'        => __( 'Logout', 'ultimate-member' ),            'custom'       => true,			'show_button'  => false        );				/* Check if the current user has logged in using a social provider */		$is_social_login = nxl_user_logged_using_socials();				if($is_social_login){						/* If it is a social login, hide the password change tab*/			unset($tabs[200]);						/* Further, hide the default account deletion form and load the nxl account deletion form */			unset($tabs[99999]);							$tabs[99999][ 'nxl_delete' ] = array(				'icon'         => 'um-faicon-trash-o',				'title'        => __( 'Delete Account', 'ultimate-member' ),				'custom'       => true,				'show_button'  => false        	);					}        return $tabs;    }              /* make our new tab hookable */        add_action('um_account_tab__nxltab', 'um_account_tab__nxltab');   	function um_account_tab__nxltab( $info ) {        global $ultimatemember;        extract( $info );        $output = $ultimatemember->account->get_tab_output('nxltab');        if ( $output ) { echo $output; }    } 	add_action('um_account_tab__nxl_delete', 'um_account_tab__nxl_delete');   	function um_account_tab__nxl_delete( $info ) {        global $ultimatemember;        extract( $info );        $output = $ultimatemember->account->get_tab_output('nxl_delete');        if ( $output ) { echo $output; }    }	add_action('um_account_tab__comments_tab', 'um_account_tab__comments_tab');   	function um_account_tab__comments_tab( $info ) {        global $ultimatemember;        extract( $info );        $output = $ultimatemember->account->get_tab_output('comments_tab');        if ( $output ) { echo $output; }    }        /* Finally we add some content in the tabs */        add_filter('um_account_content_hook_nxltab', 'um_account_content_hook_nxltab', 20);    function um_account_content_hook_nxltab( $output = ''){				$logout_url  = wp_logout_url(home_url());		        ob_start();		        ?>                    <div class="um-field um-left">                        <p>Are you sure you want to logout?</p>			<a class="um-button nxl_fit_content" href="<?php echo $logout_url; ?>">Logout</a>                    </div>                    <?php                    $output .= ob_get_contents();        ob_end_clean();        return $output;    }	 add_filter('um_account_content_hook_nxl_delete', 'um_account_content_hook_nxl_delete', 20);     function um_account_content_hook_nxl_delete( $output = ''){		        ob_start();		         ?>  			                    <p>Are you sure you want to delete your account? This will erase all of your account data from the site. To delete your account enter your email address below.</p>										<div id="um_field_0_single_user_email" class="um-field um-field-email  um-field-single_user_email um-field-email um-field-type_email" data-key="single_user_email">										<div class="um-field-label">						<label for="single_user_email">Email<span class="um-req" title="Required">*</span></label>					</div>						<div class="um-field-area">						<input class="um-form-field valid" type="email" name="single_user_email" id="single_user_email" value="" placeholder="" data-validate="" data-key="single_user_email" aria-invalid="false">					</div>									</div>					<div class="um-col-alt">					<button class="um-button nxl_fit_content" id="nxl_delete_acct" type="submit">Delete Account</button> 				</div> 						 			<div class="nxl_notifications_wrapper">				<span id="nxl_notifications"></span>			</div>                       <?php                    $output .= ob_get_contents();        ob_end_clean();        return $output;    }    /** * Add custom tab content. * * @param  string $output Tab content. * @return string */function um_account_content_comments_tab( $output = '' ) {		$user_id =  get_current_user_id();		// get comments data structure	$comments = get_comments( array(					'number'        => 10,					'user_id'       => $user_id,					'post_status'   => array('publish')				) );			if ( ! empty( $comments ) ) {			$output .= '<div class="um-ajax-items">';		    foreach ( $comments as $comment ) {								$comment_title = apply_filters( 'um_user_profile_comment_title', get_the_title( $comment->comment_post_ID ), $comment );				$link = apply_filters( 'um_user_profile_comment_url', get_permalink( $comment->comment_post_ID ), $comment ); 				$output .= '<div class="um-item">							<div class="um-item-link">								<i class="um-icon-chatboxes"></i>								<a href="'.esc_url( get_comment_link( $comment->comment_ID ) ).'">									'.get_comment_excerpt( $comment->comment_ID ).'								</a>							</div>														<div class="um-item-meta">								<span>'.									'On <a href="'.$link.'">'.$comment_title.'</a>' 								.'</span>							</div>						</div>';			}			if ( $count_comments > 10 ) { 				$output .= '<div class="um-load-items"><a href="javascript:void(0);" class="um-ajax-paginate um-button" data-hook="um_load_comments"					   data-user_id="'.esc_attr( um_get_requested_user() ).'" data-page="1"					   data-pages="'.esc_attr( ceil( $count_comments / 10 ) ).'">'.						_e( 'load more comments', 'ultimate-member' ).'					</a>				</div>';			 }	 } else { 		$output .= '<div class="um-profile-note"><span>You have not made any comments</span></div>';	}    $output .= '</div>';    return $output;}add_filter( 'um_account_content_hook_comments_tab', 'um_account_content_comments_tab', 20 );
       ```
   
    -  This reply was modified 1 year, 6 months ago by [Hasi Weragala](https://wordpress.org/support/users/hasinthawk/).
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Ultimate Member – User Profile, Registration, Login, Member Directory, Content Restriction & Membership Plugin] Add multiple tabs to accounts page](https://wordpress.org/support/topic/add-multiple-tabs-to-accounts-page/)
 *  Thread Starter [Hasi Weragala](https://wordpress.org/support/users/hasinthawk/)
 * (@hasinthawk)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/add-multiple-tabs-to-accounts-page/#post-18080850)
 * Hi Veronica
 * I have added some custom tabs to the site but tab heading styles are not applied
   for non-admin users. Is there a setting that I’ve missed? Please help
 * ![](https://i0.wp.com/i.ibb.co/Mgs0wkg/Screenshot-2024-10-18-162803.jpg?ssl=1)
 * ![](https://ibb.co/sg2Yx9g)
 * ![](https://wordpress.org/89825020-9d9f-4c3f-91ef-16eed15dd053)
    -  This reply was modified 1 year, 6 months ago by [Hasi Weragala](https://wordpress.org/support/users/hasinthawk/).
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Ultimate Member – User Profile, Registration, Login, Member Directory, Content Restriction & Membership Plugin] Add multiple tabs to accounts page](https://wordpress.org/support/topic/add-multiple-tabs-to-accounts-page/)
 *  Thread Starter [Hasi Weragala](https://wordpress.org/support/users/hasinthawk/)
 * (@hasinthawk)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/add-multiple-tabs-to-accounts-page/#post-18080427)
 * Thanks so much Veronica. ? need one more help from you
 * I want to modify the delete account form a bit. I want to remove password field
   therein and replace it with an email field. Is that possible?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Ultimate Member – User Profile, Registration, Login, Member Directory, Content Restriction & Membership Plugin] Add multiple tabs to accounts page](https://wordpress.org/support/topic/add-multiple-tabs-to-accounts-page/)
 *  Thread Starter [Hasi Weragala](https://wordpress.org/support/users/hasinthawk/)
 * (@hasinthawk)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/add-multiple-tabs-to-accounts-page/#post-18080379)
 * Thank you veronica for the swift response. appreciate it.
 * In the code you provided it doesn’t display any fields . how to render the fields?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Ultimate Member – User Profile, Registration, Login, Member Directory, Content Restriction & Membership Plugin] Add multiple tabs to accounts page](https://wordpress.org/support/topic/add-multiple-tabs-to-accounts-page/)
 *  Thread Starter [Hasi Weragala](https://wordpress.org/support/users/hasinthawk/)
 * (@hasinthawk)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/add-multiple-tabs-to-accounts-page/#post-18080347)
 * Thanks so much veronica. The tab shows up but doesn’t render any fields.
 * may I also know what is that index in $tabs array signifies? e:g 999 in $tab[
   999]
 * further, is it possible to add the comments profile tab as a accounts tab?
    -  This reply was modified 1 year, 6 months ago by [Hasi Weragala](https://wordpress.org/support/users/hasinthawk/).
    -  This reply was modified 1 year, 6 months ago by [Hasi Weragala](https://wordpress.org/support/users/hasinthawk/).

Viewing 15 replies - 1 through 15 (of 58 total)

1 [2](https://wordpress.org/support/users/hasinthawk/replies/page/2/?output_format=md)
[3](https://wordpress.org/support/users/hasinthawk/replies/page/3/?output_format=md)
[4](https://wordpress.org/support/users/hasinthawk/replies/page/4/?output_format=md)
[→](https://wordpress.org/support/users/hasinthawk/replies/page/2/?output_format=md)