本文整理汇总了PHP中is_admin_bar_showing函数的典型用法代码示例。如果您正苦于以下问题:PHP is_admin_bar_showing函数的具体用法?PHP is_admin_bar_showing怎么用?PHP is_admin_bar_showing使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了is_admin_bar_showing函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: wp_admin_bar_render
/**
* Render the admin bar to the page based on the $wp_admin_bar->menu member var.
* This is called very late on the footer actions so that it will render after anything else being
* added to the footer.
*
* It includes the action "admin_bar_menu" which should be used to hook in and
* add new menus to the admin bar. That way you can be sure that you are adding at most optimal point,
* right before the admin bar is rendered. This also gives you access to the $post global, among others.
*
* @since 3.1.0
*/
function wp_admin_bar_render()
{
global $wp_admin_bar;
if (!is_admin_bar_showing() || !is_object($wp_admin_bar)) {
return false;
}
/**
* Load all necessary admin bar items.
*
* This is the hook used to add, remove, or manipulate admin bar items.
*
* @since 3.1.0
*
* @param WP_Admin_Bar $wp_admin_bar WP_Admin_Bar instance, passed by reference
*/
do_action_ref_array('admin_bar_menu', array(&$wp_admin_bar));
/**
* Fires before the admin bar is rendered.
*
* @since 3.1.0
*/
do_action('wp_before_admin_bar_render');
$wp_admin_bar->render();
/**
* Fires after the admin bar is rendered.
*
* @since 3.1.0
*/
do_action('wp_after_admin_bar_render');
}
开发者ID:ajspencer,项目名称:NCSSM-SG-WordPress,代码行数:41,代码来源:admin-bar.php
示例2: stormbringer_body_class
/**
* Body Class - Thanks to Theme Hyprid (http://themehybrid.com/)
*/
function stormbringer_body_class($classes = '')
{
global $wp_query;
global $current_user;
// User role
$current_user->ID;
$user = new WP_User($current_user->ID);
// $user->roles
foreach ($user->roles as $role) {
$classes[] = 'role-' . $role;
}
/* Text direction (which direction does the text flow). */
$classes[] = 'wordpress';
$classes[] = get_bloginfo('text_direction');
$classes[] = get_locale();
/* Check if the current theme is a parent or child theme. */
$classes[] = is_child_theme() ? 'child-theme' : 'parent-theme';
/* Multisite check adds the 'multisite' class and the blog ID. */
if (is_multisite()) {
$classes[] = 'multisite';
$classes[] = 'blog-' . get_current_blog_id();
}
/* Date classes. */
$time = time() + get_option('gmt_offset') * 3600;
$classes[] = strtolower(gmdate('\\yY \\mm \\dd \\hH l', $time));
/* Is the current user logged in. */
$classes[] = is_user_logged_in() ? 'logged-in' : 'logged-out';
/* WP admin bar. */
if (is_admin_bar_showing()) {
$classes[] = 'admin-bar';
}
/* Merge base contextual classes with $classes. */
$classes = array_merge($classes, stormbringer_get_context());
/* Singular post (post_type) classes. */
if (is_singular()) {
/* Get the queried post object. */
$post = get_queried_object();
/* Checks for custom template. */
$template = str_replace(array("{$post->post_type}-template-", "{$post->post_type}-", '.php'), '', get_post_meta(get_queried_object_id(), "_wp_{$post->post_type}_template", true));
if (!empty($template)) {
$classes[] = "{$post->post_type}-template-{$template}";
}
/* Post format. */
if (current_theme_supports('post-formats') && post_type_supports($post->post_type, 'post-formats')) {
$post_format = get_post_format(get_queried_object_id());
$classes[] = empty($post_format) || is_wp_error($post_format) ? "{$post->post_type}-format-standard" : "{$post->post_type}-format-{$post_format}";
}
/* Attachment mime types. */
if (is_attachment()) {
foreach (explode('/', get_post_mime_type()) as $type) {
$classes[] = "attachment-{$type}";
}
}
}
/* Paged views. */
if ((($page = $wp_query->get('paged')) || ($page = $wp_query->get('page'))) && $page > 1) {
$classes[] = 'paged paged-' . intval($page);
}
return $classes;
}
开发者ID:nicomollet,项目名称:stormbringer,代码行数:63,代码来源:bodyclass.php
示例3: is_admin_bar_showing
public static function is_admin_bar_showing()
{
if (function_exists('is_admin_bar_showing')) {
return is_admin_bar_showing();
}
return FALSE;
}
开发者ID:arobbins,项目名称:davis,代码行数:7,代码来源:class-wpfront-static.php
示例4: miss_options_toolbar
/**
*
*/
function miss_options_toolbar($el)
{
if (is_admin_bar_showing()) {
global $wp_admin_bar, $wpdb;
$el->add_menu(array('id' => 'my-item', 'title' => 'Theme Options', 'href' => home_url() . '/wp-admin/themes.php?page=miss-options', 'meta' => array('title' => __('Theme Options', MISS_TEXTDOMAIN))));
}
}
开发者ID:schiz,项目名称:scrollax,代码行数:10,代码来源:core.php
示例5: loads
static function loads($hook)
{
if (!self::$add_feedback) {
return;
}
global $wp_admin_bar;
/* CHECK FOR ACTIVE PLUGINS */
$leads_status = FALSE;
$landing_page_status = FALSE;
$cta_status = FALSE;
if (function_exists('is_plugin_active') && is_plugin_active('leads/leads.php')) {
$leads_status = TRUE;
$leads_version_number = defined('WPL_CURRENT_VERSION') ? 'v' . WPL_CURRENT_VERSION : '';
}
if (function_exists('is_plugin_active') && is_plugin_active('landing-pages/landing-pages.php')) {
$landing_page_status = TRUE;
$landing_page_version_number = defined('LANDINGPAGES_CURRENT_VERSION') ? 'v' . LANDINGPAGES_CURRENT_VERSION : '';
}
if (function_exists('is_plugin_active') && is_plugin_active('cta/calls-to-action.php')) {
$cta_status = TRUE;
$cta_number = defined('WP_CTA_CURRENT_VERSION') ? 'v' . WP_CTA_CURRENT_VERSION : '';
}
if ($leads_status == FALSE && $landing_page_status == FALSE && $cta_status == FALSE) {
return;
/* end plugin is */
}
/* Exit if admin bar not there */
if (!is_user_logged_in() || !is_admin_bar_showing()) {
return;
}
/** Show these items only if Inbound Now plugin is actually installed */
if ($leads_status == TRUE || $landing_page_status == TRUE || $cta_status == TRUE) {
}
}
开发者ID:gbaladi,项目名称:landing-pages,代码行数:34,代码来源:class.feedback.php
示例6: admin_bar_menu
/**
* Add a 'customize' menu item to the admin bar
*
* This function is attached to the 'admin_bar_menu' action hook.
*
* @since 1.0.0
*/
public function admin_bar_menu($wp_admin_bar)
{
if (current_user_can('edit_theme_options') && is_admin_bar_showing()) {
$wp_admin_bar->add_node(array('parent' => 'bavotasan_toolbar', 'id' => 'customize_theme', 'title' => __('Theme Options', 'tonic'), 'href' => esc_url(admin_url('customize.php'))));
$wp_admin_bar->add_node(array('parent' => 'bavotasan_toolbar', 'id' => 'documentation_faqs', 'title' => __('Documentation & FAQs', 'tonic'), 'href' => 'https://themes.bavotasan.com/documentation', 'meta' => array('target' => '_blank')));
}
}
开发者ID:HandsomeDogStudio,项目名称:peanutbutterplan,代码行数:14,代码来源:theme-options.php
示例7: build_menu_prefix
/**
* Creates the prefix for the Nav Menu
* @return string
*/
private function build_menu_prefix()
{
$html = '';
//Wrap the whole menu in a container to limit to content width
if ($this->settings->wrap_in_container) {
$html .= "<div class='container'>";
}
//Main Nav Menu settings here - format and fixed type location
$html .= "<nav class='navbar {$this->settings->navbar_format} {$this->settings->navbar_fixed_type}'\n role='navigation'>";
//Move the menu top down if the WP admin bar is displayed
$html .= is_admin_bar_showing() ? $this->fixed_top_spacer_div() : '';
//Inner Nav div and Container or Container-Fluid
$html .= " <div class='navbar-inner'>\n <div class='{$this->settings->class_container}'>";
//Header section for the collapsed button and brand/logo.
$html .= "<div class='navbar-header'>";
//3 icon bar button for the collapsed menu only.
if ($this->settings->display_icon_bar_button) {
$html .= "<button type='button'\n class='navbar-toggle'\n data-toggle='collapse'\n data-target='#{$this->unique_menu_id}'\n aria-expanded='false'>\n <span class='sr-only'>Toggle navigation</span>\n <span class='icon-bar'></span>\n <span class='icon-bar'></span>\n <span class='icon-bar'></span>\n </button>";
}
//Get logo and title visible only for collapsed menu.
$html .= $this->get_display_logo('visible-xs');
$html .= $this->get_display_title('visible-xs');
//close navbar header section
$html .= "</div> <!-- close navbar-header-->";
//Collapse menu target and target id
$html .= "<div class='collapse navbar-collapse'\n id='{$this->unique_menu_id}'>";
//Get logo and title visible only for full menu, includes alignment left/right
// this is deliberately separated from the navbrand above as gives flexibility for edge case of separate left/right align logo/title
$html .= $this->get_display_logo('hidden-xs ' . $this->settings->logo_alignment);
$html .= $this->get_display_title('hidden-xs ' . $this->settings->title_alignment);
//Nav Menu Walker continues here...
return $html;
}
开发者ID:MarkSpencerTan,项目名称:webdev,代码行数:37,代码来源:nav-menu-markup.php
示例8: ubermenu_update_notifier_bar_menu
function ubermenu_update_notifier_bar_menu()
{
global $uberMenu;
if (!$uberMenu->getSettings()->op('update-alerts')) {
return;
}
if (!function_exists('simplexml_load_string')) {
return;
}
global $wp_admin_bar, $wpdb;
if (!is_super_admin() || !is_admin_bar_showing()) {
return;
}
$xml = ubermenu_get_latest_plugin_version(UBERMENU_UPDATE_DELAY);
//21600); // This tells the function to cache the remote call for 21600 seconds (6 hours)
$plugin_data = get_plugin_data(WP_PLUGIN_DIR . '/ubermenu/ubermenu.php');
// Get plugin data (current version is what we want)
if (!$xml) {
//we can't retrieve the XML file and parse it properly
return;
}
if (version_compare($plugin_data['Version'], $xml->latest) == -1) {
$wp_admin_bar->add_menu(array('id' => 'ubermenu_update_notifier', 'title' => '<span> ' . __('UberMenu', 'ubermenu') . ' <span id="ab-updates">' . __('New Updates', 'ubermenu') . '</span></span>', 'href' => get_admin_url() . 'themes.php?page=uber-menu&updates=1'));
}
}
开发者ID:shiyoi,项目名称:workplanhp,代码行数:25,代码来源:ubermenu.notifier.php
示例9: admin_bar_init
/**
* Add the hooks to display the asset panel in the admin bar
* @since 0.0.1
*/
public function admin_bar_init()
{
if (!is_super_admin() || !is_admin_bar_showing() || $this->is_wp_login()) {
return;
}
// Add links to the plugin listing on the installed plugins page
add_filter('plugin_action_links', array($this, 'plugin_action_links'), 10, 2);
// Don't bother showing the panel in the admin area
if (is_admin()) {
return;
}
// Enqueue assets for the control panel
add_action('wp_enqueue_scripts', array($this, 'register_assets'));
// Store all assets enqueued in the head
add_action('wp_head', array($this, 'store_head_assets'), 1000);
// Store any new assets enqueued in the footer
add_action('wp_footer', array($this, 'store_footer_assets'), 1000);
// Deregister assets
add_action('wp_head', array($this, 'deregister_assets'), 7);
add_action('wp_footer', array($this, 'deregister_assets'));
// Add the Assets item to the admin bar
add_action('admin_bar_menu', array($this, 'admin_bar_menu'));
// Print the assets panel in the footer
add_action('wp_footer', array($this, 'print_assets_panel'), 1000);
}
开发者ID:stevefloyd,项目名称:asset-queue-manager,代码行数:29,代码来源:asset-queue-manager.php
示例10: wowslider_admin_bar_menu
function wowslider_admin_bar_menu()
{
global $wp_admin_bar;
if (is_super_admin() && is_admin_bar_showing()) {
$wp_admin_bar->add_menu(array('parent' => 'new-content', 'title' => __('Slider', 'wowslider'), 'href' => admin_url('admin.php?page=wowslider-add-new')));
}
}
开发者ID:fwelections,项目名称:fwelections,代码行数:7,代码来源:admin-bar.php
示例11: ESSBAdminMenuInit3
function ESSBAdminMenuInit3()
{
global $essb_adminmenu;
if (is_admin_bar_showing()) {
$essb_adminmenu = new ESSBAdminBarMenu3();
}
}
开发者ID:JSreactor,项目名称:MarketCrater.com,代码行数:7,代码来源:essb-core-includes.php
示例12: eab_adminbar_menu_init
function eab_adminbar_menu_init()
{
//if (!is_super_admin() || !is_admin_bar_showing() )
if (is_admin_bar_showing()) {
add_action('admin_bar_menu', 'eab_admin_bar_menu', 1000);
}
}
开发者ID:bdesmero,项目名称:wp_easydevtuts,代码行数:7,代码来源:enhanced-admin-bar-with-codex-search.php
示例13: init
function init()
{
if ($this->show_in_admin_bar() && is_admin_bar_showing()) {
add_action('admin_bar_menu', array($this, 'dev_admin_menu'));
}
add_filter('debug_bar_panels', array($this, 'init_debug_bar_panels'));
if (self::is_debug_set()) {
// clear transient with url
if (isset($_GET['cdt']) && $_GET['cdt']) {
self::clear_debug_transient();
}
$trans = self::get_debug_transient();
$this->analyze($trans['data'], $trans);
}
//add_action( 'admin_notices', array($this, 'print_persistent_capture' ) );
add_action('current_screen', array($this, 'get_screen'));
wp_enqueue_style('dev-debug', "{$this->uri}/assets/dist/dev-debug.min.css");
wp_enqueue_script('dev-debug', "{$this->uri}/assets/dist/dev-debug.min.js", array('jquery'), false, true);
foreach ($this->hooks['styles'] as $hook) {
add_action($hook, array($this, 'print_styles'), 999);
}
foreach ($this->hooks['scripts'] as $hook) {
add_action($hook, array($this, 'print_scripts'), 999);
}
}
开发者ID:phillipmadsen,项目名称:dev-debug,代码行数:25,代码来源:DevDebug.php
示例14: admin_bar
public function admin_bar()
{
global $wp_admin_bar;
if (is_super_admin() && is_admin_bar_showing()) {
$wp_admin_bar->add_menu(array('parent' => 'new-content', 'id' => 'unoslider', 'title' => __('UnoSlider', 'unoslider'), 'href' => admin_url('admin.php?page=unoslider-new')));
}
}
开发者ID:googlecode-mirror,项目名称:wpmu-demo,代码行数:7,代码来源:bootstrap.php
示例15: env_name_setup
/**
* Add css style for the button
*/
function env_name_setup()
{
if (is_admin_bar_showing()) {
add_action('wp_head', 'env_name_print_style');
add_action('admin_head', 'env_name_print_style');
}
}
开发者ID:hyyan,项目名称:gwp,代码行数:10,代码来源:environment-name.php
示例16: cache_manager_init
/**
* Initializes the plugin on the init hook.
*/
function cache_manager_init()
{
if (!is_admin() && !is_admin_bar_showing()) {
return;
}
SSNepenthe\Metis\Loader::attach(new SSNepenthe\CacheManager\CacheManager());
}
开发者ID:ssnepenthe,项目名称:cache-manager,代码行数:10,代码来源:cache-manager.php
示例17: add_node
function add_node($name, $href = '', $parent = '', $custom_meta = array())
{
global $wp_admin_bar;
if (!is_super_admin() || !is_admin_bar_showing() || !is_object($wp_admin_bar) || !function_exists('is_admin_bar_showing')) {
return;
}
// Generate ID based on the current filename and the name supplied.
$id = str_replace('.php', '', basename(__FILE__)) . '-' . $name;
$id = preg_replace('#[^\\w-]#si', '-', $id);
$id = strtolower($id);
$id = trim($id, '-');
$parent = trim($parent);
// Generate the ID of the parent.
if (!empty($parent)) {
$parent = str_replace('.php', '', basename(__FILE__)) . '-' . $parent;
$parent = preg_replace('#[^\\w-]#si', '-', $parent);
$parent = strtolower($parent);
$parent = trim($parent, '-');
}
// links from the current host will open in the current window
$site_url = site_url();
$meta_default = array();
$meta_ext = array('target' => '_blank');
// external links open in new tab/window
$meta = strpos($href, $site_url) !== false ? $meta_default : $meta_ext;
$meta = array_merge($meta, $custom_meta);
$wp_admin_bar->add_node(array('parent' => $parent, 'id' => $id, 'title' => $name, 'href' => $href, 'meta' => $meta));
}
开发者ID:VadimSid,项目名称:thinkgreek,代码行数:28,代码来源:class-bon-admin-bar.php
示例18: aye_admin_bar_render_3_3
/**
* Add option to Admin Bar (WP 3.3+)
*
* Add link to YouTube Embed profile options to Admin Bar.
* With help from http://technerdia.com/1140_wordpress-admin-bar.html
*
* @uses aye_set_general_default Set default options
*
* @since 2.5
*/
function aye_admin_bar_render_3_3($meta = TRUE)
{
global $wp_version;
if ((double) $wp_version >= 3.3) {
$options = aye_set_general_defaults();
$profile_access = $options['profile_access'];
$list_access = $options['list_access'];
if ($options['admin_bar'] != '') {
global $wp_admin_bar;
if (!is_user_logged_in()) {
return;
}
if (!is_admin_bar_showing()) {
return;
}
$wp_admin_bar->add_menu(array('id' => 'aye-menu', 'title' => __('YouTube Embed', 'youtube-embed')));
if (function_exists('wp_readme_parser')) {
$wp_admin_bar->add_menu(array('parent' => 'aye-menu', 'id' => 'aye-readme', 'title' => __('Instructions', 'youtube-embed'), 'href' => admin_url('admin.php?page=aye-support-instructions'), 'meta' => array('target' => '_blank')));
}
if (current_user_can('delete_plugins')) {
$wp_admin_bar->add_menu(array('parent' => 'aye-menu', 'id' => 'aye-options', 'title' => __('Options', 'youtube-embed'), 'href' => admin_url('admin.php?page=aye-general-options'), 'meta' => array('target' => '_blank')));
}
if (current_user_can($profile_access)) {
$wp_admin_bar->add_menu(array('parent' => 'aye-menu', 'id' => 'aye-profile', 'title' => __('Profiles', 'youtube-embed'), 'href' => admin_url('admin.php?page=aye-profile-options'), 'meta' => array('target' => '_blank')));
}
if (current_user_can($list_access)) {
$wp_admin_bar->add_menu(array('parent' => 'aye-menu', 'id' => 'aye-lists', 'title' => __('Lists', 'youtube-embed'), 'href' => admin_url('admin.php?page=aye-list-options'), 'meta' => array('target' => '_blank')));
}
}
}
}
开发者ID:ejoan,项目名称:erikajoan.com,代码行数:41,代码来源:aye-add-to-admin-bar.php
示例19: update_notifier_bar_menu
function update_notifier_bar_menu()
{
if (function_exists('simplexml_load_string')) {
// Stop if simplexml_load_string funtion isn't available
global $wp_admin_bar, $wpdb;
if (!is_super_admin() || !is_admin_bar_showing()) {
// Don't display notification in admin bar if it's disabled or the current user isn't an administrator
return;
}
$xml = get_latest_theme_version(NOTIFIER_CACHE_INTERVAL);
// Get the latest remote XML file on our server
// get version
if (function_exists('wp_get_theme')) {
$theme_data = wp_get_theme(get_template());
$version = $theme_data->version;
} else {
$theme_data = get_theme_data(get_template_directory() . '/style.css');
$version = $theme_data['Version'];
}
if (!is_object($xml)) {
return;
}
if (version_compare($xml->latest, $version, '>')) {
// Compare current theme version with the remote XML version
$wp_admin_bar->add_menu(array('id' => 'update_notifier', 'title' => '<span>' . NOTIFIER_THEME_NAME . ' <span id="ab-updates">1 Update</span></span>', 'href' => get_admin_url() . 'index.php?page=theme-update-notifier'));
}
}
}
开发者ID:GaryJones,项目名称:goombiel,代码行数:28,代码来源:update-notifier.php
示例20: wowslider_admin_bar_menu
function wowslider_admin_bar_menu()
{
global $wp_admin_bar;
if (current_user_can('level_7') && is_admin_bar_showing()) {
$wp_admin_bar->add_menu(array('parent' => 'new-content', 'title' => __('Slider', 'wowslider'), 'href' => admin_url('admin.php?page=wowslider-add-new'), 'id' => 'wowslider'));
}
}
开发者ID:owesome2015,项目名称:MOSES-S-WORK,代码行数:7,代码来源:admin-bar.php
注:本文中的is_admin_bar_showing函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论