function add_to_admin_bar()
 {
     global $wp_admin_bar;
     if (!(defined('WDEB_IS_IN_EASY_MODE') && WDEB_IS_IN_EASY_MODE)) {
         $href = apply_filters('wdeb_easy_mode_init', WDEB_LANDING_PAGE . '?wdeb_on');
         $title = __('Activate easy mode', 'wdeb');
     } else {
         $data = new Wdeb_Options();
         $auto_enter_roles = $data->get_option('auto_enter_role');
         if (!$auto_enter_roles || !wdeb_current_user_can($auto_enter_roles)) {
             $href = apply_filters('wdeb_easy_mode_init', WDEB_LANDING_PAGE . '?wdeb_off');
             $title = __('Exit easy mode', 'wdeb');
         } else {
             return false;
         }
         // Not showing exit easy mode link if not applicable
     }
     $wp_admin_bar->add_menu(array('parent' => 'site-name', 'id' => 'wdeb-my_sites-ttsb', 'title' => $title, 'href' => $href));
 }
		<div class="wdeb_meta">
			<strong><?php 
    _e('Exit Easy Mode', 'wdeb');
    ?>
</strong>
			<?php 
    _e('Return to advanced mode', 'wdeb');
    ?>
		</div>
	</li>
<?php 
}
?>

<?php 
if ($this->data->get_option('show_logout') || $auto_enter_roles && wdeb_current_user_can($auto_enter_roles)) {
    ?>
<!-- Easy Mode forced, or showing logout link requested. Add Logout link -->
	<li>
		<a href="<?php 
    echo wp_logout_url();
    ?>
" class="dashboard">
			<img src="<?php 
    echo WDEB_PLUGIN_THEME_URL;
    ?>
/assets/icons/theme_icons/settings.png" alt="" />
			<span class="current"><?php 
    _e('Log Out', 'wdeb');
    ?>
</span>
Пример #3
0
				var href = $me.attr("href");
				if (href.match(/&(width|height)=[^&]+/)) href = href.replace(/&(width|height)=[^&]+/g, '');
				$me.attr("href", href + "&width=" + width + '&height=' + height);
				return true;
			});
		;
	});
});

<?php 
do_action('wdeb_script-custom_javascript');
?>

<?php 
$auto_enter_role = $this->data->get_option('auto_enter_role');
if ($this->data->get_option('easy_bar') && (!$auto_enter_role || !wdeb_current_user_can($auto_enter_role))) {
    ?>
// Add exit easy mode link
$(function () {
	$(".wdeb_visit_site").first().append("<a href='<?php 
    echo WDEB_LANDING_PAGE;
    ?>
?wdeb_off'><?php 
    _e('Exit easy mode', 'wdeb');
    ?>
</a>");
});
<?php 
}
?>
})(jQuery);