예제 #1
0
function wptbr_abtlh()
{
    echo "\n\n<!--Start Toolbar Removal Code-->\n\n";
    ?>

<style type="text/css">table#tbrcss td#tbrcss_ttl a:link,table#tbrcss td#tbrcss_ttl a:visited{text-decoration:none}table#tbrcss td#tbrcss_lgt,table#tbrcss td#tbrcss_lgt a{text-decoration:none}</style>
<table style="margin-left:6px;float:left;z-index:100;position:relative;left:0px;top:0px;background:none;padding:0px;border:0px;border-bottom:1px solid #DFDFDF" id="tbrcss" border="0" cols="4" width="97%" height="33">
<tr>
<td align="left" valign="center" id="tbrcss_ttl">
<?php 
    echo '<a href="' . home_url() . '">' . __(get_bloginfo(), 'email-control') . '</a>';
    ?>

</td>
<td align="right" valign="center" id="tbrcss_lgt">
<div style="padding-top:2px">
<?php 
    echo date_i18n(get_option('date_format'));
    ?>


 @ 

<?php 
    echo date_i18n(get_option('time_format'));
    ?>


<?php 
    wp_get_current_user();
    $current_user = wp_get_current_user();
    if (!$current_user instanceof WP_User) {
        return;
    }
    echo ' | ' . $current_user->display_name . '';
    if (is_multisite() && is_super_admin()) {
        if (!is_network_admin()) {
            echo ' | <a href="' . network_admin_url() . '">' . __('Network Admin', 'email-control') . '</a>';
        } else {
            echo ' | <a href="' . get_DashBoard_url(get_current_user_id()) . '">' . __('Site Admin', 'email-control') . '</a>';
        }
    }
    echo ' | <a href="' . wp_logout_url(home_url()) . '">' . __('Log Out', 'email-control') . '</a>';
    ?>

</div>
</td>
<td width="8">
</td>
</tr>
</table>
<?php 
    echo "\n<!--End Toolbar Removal Code-->\n\n";
}
function ghatb_bfp_login_header()
{
    global $wp_version;
    wp_get_current_user();
    $current_user = wp_get_current_user();
    if (!$current_user instanceof WP_User) {
        return;
    }
    $date_format = get_option('date_format');
    $time_format = get_option('time_format');
    $formatteddate = date($date_format . ' ' . $time_format, current_time('timestamp'));
    $logout_link = '<a href="' . wp_logout_url(home_url()) . '">' . __('Log Out', 'global-hide-remove-toolbar-plugin') . '</a>';
    $admin_link = is_multisite() && is_super_admin() ? !is_network_admin() ? ' | <a href="' . network_admin_url() . '">' . __('Network Admin', 'global-hide-remove-toolbar-plugin') . '</a>' : ' | <a href="' . get_DashBoard_url(get_current_user_id()) . '">' . __('Site Admin', 'global-hide-remove-toolbar-plugin') . '</a>' : '';
    $displayname = $current_user->display_name;
    $toggle = $wp_version >= 3.8 ? '<div id="wp-bftoolbar-bar-menu-toggle" class="dashicons dashicons-menu"></div>' : '';
    $homelink = '<a href="' . home_url() . '">' . __(get_bloginfo()) . '</a>';
    echo '
			<!--Start Plugin Global Hide Admin Tool Bar Bruteforce Code-->
			<style type="text/css">
				@media screen and (max-width:782px){
					#wp-bftoolbar-bar-menu-toggle {display:block}
					.wp-responsive-open #bftoobar {right: -190px}
					.wp-responsive-open #bftoobar #bftoobar_ttl{width:auto;padding-right:2%}
					.wp-responsive-open #bftoobar #bftoobar_lgt{width:auto}
				}
				#bftoobar {position:relative;z-index:10;border-bottom:1px solid #e1e1e1;height:33px;line-height:33px}
				#bftoobar #bftoobar_ttl a:link,
					#bftoobar #bftoobar_ttl a:visited{text-decoration:none}
				#bftoobar #bftoobar_lgt,
				#bftoobar #bftoobar_lgt a{text-decoration:none}
				#bftoobar #bftoobar_ttl{width:33%;float:left;text-align:left}
				#bftoobar #bftoobar_lgt{width:65%;float:left;text-align:right;padding-right:2%}

			</style>
				<div id="bftoobar">
				<div id="bftoobar_ttl">' . $toggle . $homelink . '</div>
				<div id="bftoobar_lgt">' . $formatteddate . ' | ' . $displayname . $admin_link . ' | ' . $logout_link . '</div>
			</div>
			<!--/ End Plugin Global Hide Admin Tool Bar Bruteforce Code-->
			';
    if ($wp_version >= 3.8) {
        echo '<!--Start Plugin Global Hide Admin Tool Bar Bruteforce Code-->';
        echo '<script>jQuery(document).ready(function(){var $wpwrap=jQuery("#wpwrap");jQuery("#wp-bftoolbar-bar-menu-toggle").on("click",function(event) {console.log("clicked");event.preventDefault();$wpwrap.toggleClass("wp-responsive-open");});});</script>';
        echo '<!--/ End Plugin Global Hide Admin Tool Bar Bruteforce Code-->';
    }
}