add_menu( array( 'id' => 'toggle-help-links', 'title' => ' Toggle Aid', 'href' => '#', 'meta' => array( 'title' => __('Toggle Aid'), 'class' => 'toggle-help-links' ), )); } } function getTooltip($atts){ if ( is_array( $atts ) ) { foreach ( $atts as $k => $v ) { if ( 'false' === $v ) { $atts[ $k ] = false; } } $link = $atts['link']; $title = $atts['title']; } $output = ""; $user = wp_get_current_user(); $allowed_roles = array('administrator','manager'); if( array_intersect($allowed_roles, $user->roles ) ) { $output = '
'; if(!empty($atts['do_short_code'])){ $output = '
'.$output.'
'; } } return $output; } add_shortcode( 'getTooltip', 'getTooltip' ); ?>