Get In Touch
MEDPIKE
info@medpike.com
Work Inquiries
job@medpike.com

Add Tab links profile Sidebar in Woocomerce with points

/* Tab links Apps woom */

add_filter(‘um_account_page_default_tabs_hook’, ‘my_custom_tab_in_um3’, 100 );
function my_custom_tab_in_um3( $tabs ) {

$tabs[803][‘mytab3’][‘icon’] = ‘um-faicon-calendar’;
$tabs[803][‘mytab3’][‘title’] = ‘text’;
$tabs[803][‘mytab3’][‘custom’] = true;
return $tabs;
}

/* make our new tab hookable */

add_action(‘um_account_tab__mytab3’, ‘um_account_tab__mytab3’);
function um_account_tab__mytab3( $info ) {
global $ultimatemember;
extract( $info );

$output = $ultimatemember->account->get_tab_output(‘mytab3’);
if ( $output ) { echo $output; }
}

/* Finally we add some content in the tab */

add_filter(‘um_account_content_hook_mytab3’, ‘um_account_content_hook_mytab3’);
function um_account_content_hook_mytab3( $output ){
ob_start();
$clave = $current_user->user_login;

global $current_user; get_currentuserinfo();

echo nl2br($string);

$string = “\r\n\n\n”;
$string2 = “\r\n\n\n text \n\n\n\n”;
$string3 = “\r\n\n\n\n\n”;
echo nl2br($string2);
if(($current_user->role == ‘role1’) || ($current_user->role == ‘admin’)|| ($current_user->role == ‘role2’)|| ($current_user->role == ‘medicocreditovencido’)|| ($current_user->role == ‘medicoprueba’)){
echo’you text‘;
echo nl2br($string3);
echo’Label link‘;
echo nl2br($string3);
echo’Label link 2‘;
echo nl2br($string3);
}
else if(($current_user->role == ‘medicopago’) || ($current_user->role == ‘admin’)){
echo “Label“;
}
echo nl2br($string);
?>

account->get_tab_output(‘mytab4’);
if ( $output ) { echo $output; }
}

/* Finally we add some content in the tab */

add_filter(‘um_account_content_hook_mytab4’, ‘um_account_content_hook_mytab4′);
function um_account_content_hook_mytab4( $output ){
ob_start();
$clave = $current_user->user_login;

global $current_user; get_currentuserinfo();

// $user_count = $wpdb->get_var( “SELECT points FROM wp_wvy18cbh8q_users_points WHERE email=’killerwilmer@gmail.com'” );
// $myrows = $wpdb->get_results( “SELECT points FROM wp_wvy18cbh8q_users_points WHERE email=’email.com'” );
// $myrows = $wpdb->get_results( “SELECT id, name FROM mytable” );

global $wpdb;
//$result = $wpdb->get_var(“SELECT wp_wvy18cbh8q_users.user_login FROM wp_wvy18cbh8q_users ORDER BY wp_wvy18cbh8q_users.user_email DESC LIMIT 0,1”);
$result = $wpdb->get_var(“SELECT wp_wvy18cbh8q_users_points.points FROM wp_wvy18cbh8q_users_points WHERE wp_wvy18cbh8q_users_points.email = ‘” . $current_user->user_email . “‘ ORDER BY wp_wvy18cbh8q_users_points.id DESC LIMIT 0,1”);

echo nl2br($string);

$string = “\r\n\n\n”;
$string2 = “\r\n Credits:
” . $result . ”
” . $current_user->user_email ;
$string3 = “\r\n\r\n\n”;
echo nl2br($string2);

if(($current_user->role == ‘role1’) || ($current_user->role == ‘admin’)|| ($current_user->role == ‘role2’)|| ($current_user->role == ‘medicocreditovencido’)|| ($current_user->role == ‘medicoprueba’)){
echo nl2br($string3);
echo “Not available”;
echo nl2br($string3);
}
else if(($current_user->role == ‘role2’) || ($current_user->role == ‘admin’)){
echo nl2br($string3);
//echo “link label“;
}
echo nl2br($string);
$output .= ob_get_contents();
ob_end_clean();
return $output;
}

/*

Author avatar
miguel
https://blog.medpike.com

Post a comment

Your email address will not be published. Required fields are marked *

three × 1 =

  • Tureporti

    Radiology Second Opinions
    Tureporti
    Understanding radiology reports
    HIPAA ready
  • Radiolapp

    AI RIS-PACS On Demand
    Radiolapp
    Pay As You Go RIS-PACS
    AI included
© 2021, MEDPIKE. Made with passion by MEDPIKE.
All right reserved.
We use cookies to give you the best experience.