• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP is_user_admin函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中is_user_admin函数的典型用法代码示例。如果您正苦于以下问题:PHP is_user_admin函数的具体用法?PHP is_user_admin怎么用?PHP is_user_admin使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了is_user_admin函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: add_js_w_globals

 /**
  * Enqueues JS file for theme integration.
  *
  * Be sure s2Member's API Constants are already defined before firing this.
  *
  * @package s2Member\CSS_JS
  * @since 3.5
  *
  * @attaches-to ``add_action("wp_print_scripts");``
  *
  * @return null After enqueuing JS for theme integration.
  */
 public static function add_js_w_globals()
 {
     global $pagenow;
     /* Need this for comparisons. */
     /**/
     do_action("ws_plugin__s2member_before_add_js_w_globals", get_defined_vars());
     /**/
     if (!is_admin() || is_user_admin() && $pagenow === "profile.php" && !current_user_can("edit_users")) {
         $s2o = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["s2o_url"];
         /**/
         if (is_user_logged_in()) {
             $md5 = WS_PLUGIN__S2MEMBER_API_CONSTANTS_MD5;
             /* An MD5 hash based on global key => values. */
             /* The MD5 hash allows the script to be cached in the browser until the globals happen to change. */
             /* For instance, the global variables may change when a User who is logged-in changes their Profile. */
             wp_enqueue_script("ws-plugin--s2member", $s2o . "?ws_plugin__s2member_js_w_globals=" . urlencode($md5) . "&qcABC=1", array("jquery", "password-strength-meter"), c_ws_plugin__s2member_utilities::ver_checksum());
         } else {
             /* This essentially creates 2 versions of the script. One while logged in & another when not. */
             wp_enqueue_script("ws-plugin--s2member", $s2o . "?ws_plugin__s2member_js_w_globals=1&qcABC=1", array("jquery", "password-strength-meter"), c_ws_plugin__s2member_utilities::ver_checksum());
         }
         /**/
         do_action("ws_plugin__s2member_during_add_js_w_globals", get_defined_vars());
     }
     /**/
     do_action("ws_plugin__s2member_after_add_js_w_globals", get_defined_vars());
     /**/
     return;
     /* Return for uniformity. */
 }
开发者ID:vinvinh315,项目名称:maintainwebsolutions.com,代码行数:41,代码来源:css-js-themes.inc.php


示例2: admin_bar_menu

 /**
  * Remove the WordPress comments menu bar item, replacing with a Facebook comments link
  * Check if Facebook comments enabled and if the current user might be able to view a comments edit screen on Facebook
  *
  * @since 1.1
  * @see WP_Admin_Bar->add_menus()
  */
 public static function admin_bar_menu()
 {
     global $facebook_loader;
     if (is_network_admin() && is_user_admin()) {
         return;
     }
     // use moderate_comments capability as a local proxy for accounts that might be granted moderate comments permissions for the Facebook application if the application administrator fully setup the app
     // technically the WordPress menu item is added for users with 'edit_posts' due to the permissions of the destination page but we'll check for the specific comments permission instead
     // TODO: check if Facebook data stored for current user, check if Facebook user is moderator
     if (!current_user_can('moderate_comments')) {
         return;
     }
     if (!class_exists('Facebook_User')) {
         require_once dirname(dirname(__FILE__)) . '/facebook-user.php';
     }
     $current_user = wp_get_current_user();
     $facebook_user_data = Facebook_User::get_user_meta($current_user->ID, 'fb_data', true);
     if (!(is_array($facebook_user_data) && isset($facebook_user_data['fb_uid']))) {
         return;
     }
     // swap only. don't add a menu item if none existed
     if (remove_action('admin_bar_menu', 'wp_admin_bar_comments_menu', 60)) {
         add_action('admin_bar_menu', array('Facebook_Comments', 'admin_bar_add_comments_menu'), 60);
     }
 }
开发者ID:batruji,项目名称:metareading,代码行数:32,代码来源:class-facebook-comments.php


示例3: is_user_admin

 public static function is_user_admin()
 {
     if (version_compare(get_bloginfo("version"), "3.1-RC", ">=")) {
         return is_user_admin();
     }
     /**/
     return is_admin();
 }
开发者ID:Weissenberger13,项目名称:web.portugalrentalcottages,代码行数:8,代码来源:utils-conds.inc.php


示例4: redirect_if_user_not_admin

function redirect_if_user_not_admin($email)
{
    // Redirect to /e_commerce/index.php.
    if (!is_user_admin($email)) {
        header('Location: /e_commerce/index.php');
        die;
    }
}
开发者ID:koalacoding,项目名称:e_commerce,代码行数:8,代码来源:check_if_user_is_admin.php


示例5: wp_admin_header

function wp_admin_header()
{
    remove_action('admin_bar_menu', 'wp_admin_bar_updates_menu', 40);
    if (!is_network_admin() && !is_user_admin()) {
        //评论
        remove_action('admin_bar_menu', 'wp_admin_bar_comments_menu', 60);
    }
}
开发者ID:sdgdsffdsfff,项目名称:shipin,代码行数:8,代码来源:helper-config.php


示例6: rwmb_debug_print

/**
 * Prints or exports the content of the global debug array at the 'shutdown' hook
 *
 * @return void
 */
function rwmb_debug_print()
{
    global $rwmb_debug;
    if (!$rwmb_debug || is_user_logged_in() && is_user_admin()) {
        return;
    }
    $html = '<h3>' . __('RW_Meta_Box Debug:', 'rwmb') . '</h3><pre>';
    foreach ($rwmb_debug as $debug) {
        $html .= "{$debug}<hr />";
    }
    $html .= '</pre>';
    die($html);
}
开发者ID:nWidart,项目名称:meta-box,代码行数:18,代码来源:meta-box.php


示例7: __construct

 /**
  * Class constructor.
  *
  * @since 160710 Common utils.
  */
 public function __construct()
 {
     $this->is_multisite = is_multisite();
     $this->is_main_site = !$this->is_multisite || is_main_site();
     $this->is_admin = is_admin();
     $this->is_user_admin = $this->is_admin && is_user_admin();
     $this->is_network_admin = $this->is_admin && $this->is_multisite && is_network_admin();
     $this->debug = defined('WP_DEBUG') && WP_DEBUG;
     $this->debug_edge = $this->debug && defined('WP_DEBUG_EDGE') && WP_DEBUG_EDGE;
     $this->debug_log = $this->debug && defined('WP_DEBUG_LOG') && WP_DEBUG_LOG;
     $this->debug_display = $this->debug && defined('WP_DEBUG_DISPLAY') && WP_DEBUG_DISPLAY;
     if (!($this->salt = wp_salt())) {
         throw new Exception('Failed to acquire WP salt.');
     }
     if (!($this->tmp_dir = rtrim(get_temp_dir(), '/'))) {
         throw new Exception('Failed to acquire a writable tmp dir.');
     }
     if (!($this->site_url = site_url('/'))) {
         throw new Exception('Failed to acquire site URL.');
     } elseif (!($this->site_url_parts = parse_url($this->site_url))) {
         throw new Exception('Failed to parse site URL parts.');
     } elseif (!($this->site_url_host = $this->site_url_parts['host'] ?? '')) {
         throw new Exception('Failed to parse site URL host.');
     } elseif (!($this->site_url_root_host = implode('.', array_slice(explode('.', $this->site_url_host), -2)))) {
         throw new Exception('Failed to parse site URL root host.');
     }
     if (!($this->site_url_option = get_option('siteurl'))) {
         throw new Exception('Failed to acquire site URL option.');
     } elseif (!($this->site_url_option_parts = parse_url($this->site_url_option))) {
         throw new Exception('Failed to parse site URL option parts.');
     } elseif (!($this->site_default_scheme = $this->site_url_option_parts['scheme'] ?? '')) {
         throw new Exception('Failed to parse site URL option scheme.');
     }
     if (!($this->template_directory_url = get_template_directory_uri())) {
         throw new Exception('Failed to acquire template directory URL.');
     } elseif (!($this->template_directory_url_parts = parse_url($this->template_directory_url))) {
         throw new Exception('Failed to parse template directory URL parts.');
     }
     $this->template = get_template();
     $this->stylesheet = get_stylesheet();
     $this->is_woocommerce_active = defined('WC_VERSION');
     $this->is_woocommerce_product_vendors_active = defined('WC_PRODUCT_VENDORS_VERSION');
     $this->is_jetpack_active = defined('JETPACK__VERSION');
 }
开发者ID:websharks,项目名称:wp-sharks-core,代码行数:49,代码来源:Wp.php


示例8: bp_admin_bar_remove_nxt_menus

/**
 * Unhook the NXTClass core menus.
 *
 * @since BuddyPress (r4151)
 *
 * @uses remove_action
 * @uses is_network_admin()
 * @uses is_user_admin()
 */
function bp_admin_bar_remove_nxt_menus()
{
    if ('3.2' == bp_get_major_nxt_version()) {
        remove_action('admin_bar_menu', 'nxt_admin_bar_my_account_menu', 10);
        remove_action('admin_bar_menu', 'nxt_admin_bar_my_sites_menu', 20);
        remove_action('admin_bar_menu', 'nxt_admin_bar_dashboard_view_site_menu', 25);
        // Don't show the 'Edit Page' menu on BP pages
        if (!bp_is_blog_page()) {
            remove_action('admin_bar_menu', 'nxt_admin_bar_edit_menu', 30);
        }
        remove_action('admin_bar_menu', 'nxt_admin_bar_shortlink_menu', 80);
        remove_action('admin_bar_menu', 'nxt_admin_bar_updates_menu', 70);
        if (!is_network_admin() && !is_user_admin()) {
            remove_action('admin_bar_menu', 'nxt_admin_bar_comments_menu', 50);
            remove_action('admin_bar_menu', 'nxt_admin_bar_appearance_menu', 60);
        }
        remove_action('admin_bar_menu', 'nxt_admin_bar_updates_menu', 70);
    }
}
开发者ID:nxtclass,项目名称:NXTClass-Plugin,代码行数:28,代码来源:bp-core-adminbar.php


示例9: wp_dashboard_right_now

/**
 * Dashboard widget that displays some basic stats about the site.
 *
 * Formerly 'Right Now'. A streamlined 'At a Glance' as of 3.8.
 *
 * @since 2.7.0
 */
function wp_dashboard_right_now()
{
    ?>
	<div class="main">
	<ul>
	<?php 
    // Posts and Pages
    foreach (array('post', 'page') as $post_type) {
        $num_posts = wp_count_posts($post_type);
        if ($num_posts && $num_posts->publish) {
            if ('post' == $post_type) {
                $text = _n('%s Post', '%s Posts', $num_posts->publish);
            } else {
                $text = _n('%s Page', '%s Pages', $num_posts->publish);
            }
            $text = sprintf($text, number_format_i18n($num_posts->publish));
            $post_type_object = get_post_type_object($post_type);
            if ($post_type_object && current_user_can($post_type_object->cap->edit_posts)) {
                printf('<li class="%1$s-count"><a href="edit.php?post_type=%1$s">%2$s</a></li>', $post_type, $text);
            } else {
                printf('<li class="%1$s-count"><span>%2$s</span></li>', $post_type, $text);
            }
        }
    }
    // Comments
    $num_comm = wp_count_comments();
    if ($num_comm && $num_comm->approved) {
        $text = sprintf(_n('%s Comment', '%s Comments', $num_comm->approved), number_format_i18n($num_comm->approved));
        ?>
		<li class="comment-count"><a href="edit-comments.php"><?php 
        echo $text;
        ?>
</a></li>
		<?php 
        /* translators: Number of comments in moderation */
        $text = sprintf(_nx('%s in moderation', '%s in moderation', $num_comm->moderated, 'comments'), number_format_i18n($num_comm->moderated));
        ?>
		<li class="comment-mod-count<?php 
        if (!$num_comm->moderated) {
            echo ' hidden';
        }
        ?>
"><a href="edit-comments.php?comment_status=moderated"><?php 
        echo $text;
        ?>
</a></li>
		<?php 
    }
    /**
     * Filter the array of extra elements to list in the 'At a Glance'
     * dashboard widget.
     *
     * Prior to 3.8.0, the widget was named 'Right Now'. Each element
     * is wrapped in list-item tags on output.
     *
     * @since 3.8.0
     *
     * @param array $items Array of extra 'At a Glance' widget items.
     */
    $elements = apply_filters('dashboard_glance_items', array());
    if ($elements) {
        echo '<li>' . implode("</li>\n<li>", $elements) . "</li>\n";
    }
    ?>
	</ul>
	<?php 
    update_right_now_message();
    // Check if search engines are asked not to index this site.
    if (!is_network_admin() && !is_user_admin() && current_user_can('manage_options') && '1' != get_option('blog_public')) {
        /**
         * Filter the link title attribute for the 'Search Engines Discouraged'
         * message displayed in the 'At a Glance' dashboard widget.
         *
         * Prior to 3.8.0, the widget was named 'Right Now'.
         *
         * @since 3.0.0
         *
         * @param string $title Default attribute text.
         */
        $title = apply_filters('privacy_on_link_title', __('Your site is asking search engines not to index its content'));
        /**
         * Filter the link label for the 'Search Engines Discouraged' message
         * displayed in the 'At a Glance' dashboard widget.
         *
         * Prior to 3.8.0, the widget was named 'Right Now'.
         *
         * @since 3.0.0
         *
         * @param string $content Default text.
         */
        $content = apply_filters('privacy_on_link_text', __('Search Engines Discouraged'));
        echo "<p><a href='options-reading.php' title='{$title}'>{$content}</a></p>";
    }
//.........这里部分代码省略.........
开发者ID:riasnelli,项目名称:WordPress,代码行数:101,代码来源:dashboard.php


示例10: wp_dashboard_right_now


//.........这里部分代码省略.........
    $num = number_format_i18n($num_tags);
    $text = _n('Tag', 'Tags', $num_tags);
    if (current_user_can('manage_categories')) {
        $num = "<a href='edit-tags.php'>{$num}</a>";
        $text = "<a href='edit-tags.php'>{$text}</a>";
    }
    echo '<td class="first b b-tags">' . $num . '</td>';
    echo '<td class="t tags">' . $text . '</td>';
    echo "</tr>";
    do_action('right_now_content_table_end');
    echo "\n\t</table>\n\t</div>";
    echo "\n\t" . '<div class="table table_discussion">';
    echo "\n\t" . '<p class="sub">' . __('Discussion') . '</p>' . "\n\t" . '<table>';
    echo "\n\t" . '<tr class="first">';
    // Total Comments
    $num = '<span class="total-count">' . number_format_i18n($num_comm->total_comments) . '</span>';
    $text = _n('Comment', 'Comments', $num_comm->total_comments);
    if (current_user_can('moderate_comments')) {
        $num = '<a href="edit-comments.php">' . $num . '</a>';
        $text = '<a href="edit-comments.php">' . $text . '</a>';
    }
    echo '<td class="b b-comments">' . $num . '</td>';
    echo '<td class="last t comments">' . $text . '</td>';
    echo '</tr><tr>';
    // Approved Comments
    $num = '<span class="approved-count">' . number_format_i18n($num_comm->approved) . '</span>';
    $text = _nx('Approved', 'Approved', $num_comm->approved, 'Right Now');
    if (current_user_can('moderate_comments')) {
        $num = "<a href='edit-comments.php?comment_status=approved'>{$num}</a>";
        $text = "<a class='approved' href='edit-comments.php?comment_status=approved'>{$text}</a>";
    }
    echo '<td class="b b_approved">' . $num . '</td>';
    echo '<td class="last t">' . $text . '</td>';
    echo "</tr>\n\t<tr>";
    // Pending Comments
    $num = '<span class="pending-count">' . number_format_i18n($num_comm->moderated) . '</span>';
    $text = _n('Pending', 'Pending', $num_comm->moderated);
    if (current_user_can('moderate_comments')) {
        $num = "<a href='edit-comments.php?comment_status=moderated'>{$num}</a>";
        $text = "<a class='waiting' href='edit-comments.php?comment_status=moderated'>{$text}</a>";
    }
    echo '<td class="b b-waiting">' . $num . '</td>';
    echo '<td class="last t">' . $text . '</td>';
    echo "</tr>\n\t<tr>";
    // Spam Comments
    $num = number_format_i18n($num_comm->spam);
    $text = _nx('Spam', 'Spam', $num_comm->spam, 'comment');
    if (current_user_can('moderate_comments')) {
        $num = "<a href='edit-comments.php?comment_status=spam'><span class='spam-count'>{$num}</span></a>";
        $text = "<a class='spam' href='edit-comments.php?comment_status=spam'>{$text}</a>";
    }
    echo '<td class="b b-spam">' . $num . '</td>';
    echo '<td class="last t">' . $text . '</td>';
    echo "</tr>";
    do_action('right_now_table_end');
    do_action('right_now_discussion_table_end');
    echo "\n\t</table>\n\t</div>";
    echo "\n\t" . '<div class="versions">';
    $ct = current_theme_info();
    echo "\n\t<p>";
    if (!empty($wp_registered_sidebars)) {
        $sidebars_widgets = wp_get_sidebars_widgets();
        $num_widgets = 0;
        foreach ((array) $sidebars_widgets as $k => $v) {
            if ('wp_inactive_widgets' == $k) {
                continue;
            }
            if (is_array($v)) {
                $num_widgets = $num_widgets + count($v);
            }
        }
        $num = number_format_i18n($num_widgets);
        $switch_themes = $ct->title;
        if (current_user_can('switch_themes')) {
            $switch_themes = '<a href="themes.php">' . $switch_themes . '</a>';
        }
        if (current_user_can('edit_theme_options')) {
            printf(_n('Theme <span class="b">%1$s</span> with <span class="b"><a href="widgets.php">%2$s Widget</a></span>', 'Theme <span class="b">%1$s</span> with <span class="b"><a href="widgets.php">%2$s Widgets</a></span>', $num_widgets), $switch_themes, $num);
        } else {
            printf(_n('Theme <span class="b">%1$s</span> with <span class="b">%2$s Widget</span>', 'Theme <span class="b">%1$s</span> with <span class="b">%2$s Widgets</span>', $num_widgets), $switch_themes, $num);
        }
    } else {
        if (current_user_can('switch_themes')) {
            printf(__('Theme <span class="b"><a href="themes.php">%1$s</a></span>'), $ct->title);
        } else {
            printf(__('Theme <span class="b">%1$s</span>'), $ct->title);
        }
    }
    echo '</p>';
    // Check if search engines are blocked.
    if (!is_network_admin() && !is_user_admin() && current_user_can('manage_options') && '1' != get_option('blog_public')) {
        $title = apply_filters('privacy_on_link_title', __('Your site is asking search engines not to index its content'));
        $content = apply_filters('privacy_on_link_text', __('Search Engines Blocked'));
        echo "<p><a href='options-privacy.php' title='{$title}'>{$content}</a></p>";
    }
    update_right_now_message();
    echo "\n\t" . '<br class="clear" /></div>';
    do_action('rightnow_end');
    do_action('activity_box_end');
}
开发者ID:nouphet,项目名称:rata,代码行数:101,代码来源:dashboard.php


示例11: get_edit_profile_url

/**
 * Get the URL to the user's profile editor.
 *
 * @since 3.1.0
 *
 * @param int $user User ID
 * @param string $scheme The scheme to use. Default is 'admin', which obeys force_ssl_admin() and is_ssl(). 'http' or 'https' can be passed to force those schemes.
 * @return string Dashboard url link with optional path appended
 */
function get_edit_profile_url($user, $scheme = 'admin')
{
    $user = (int) $user;
    if (is_user_admin()) {
        $url = user_admin_url('profile.php', $scheme);
    } elseif (is_network_admin()) {
        $url = network_admin_url('profile.php', $scheme);
    } else {
        $url = get_dashboard_url($user, 'profile.php', $scheme);
    }
    return apply_filters('edit_profile_url', $url, $user, $scheme);
}
开发者ID:vpatrinica,项目名称:jfdesign,代码行数:21,代码来源:link-template.php


示例12: dashboard_right_now

 /**
  * Custom "Right Now" dashboard widget for Calendar Administrators.
  *
  * @return  void
  */
 function dashboard_right_now()
 {
     global $wp_registered_sidebars;
     $num_comm = wp_count_comments();
     echo "\n\t" . '<div class="table table_content">';
     echo "\n\t" . '<p class="sub">' . __('Content') . '</p>' . "\n\t" . '<table>';
     echo "\n\t" . '<tr class="first">';
     do_action('right_now_content_table_end');
     echo "\n\t</table>\n\t</div>";
     echo "\n\t" . '<div class="table table_discussion">';
     echo "\n\t" . '<p class="sub">' . __('Discussion') . '</p>' . "\n\t" . '<table>';
     echo "\n\t" . '<tr class="first">';
     // Total Comments
     $num = '<span class="total-count">' . number_format_i18n($num_comm->total_comments) . '</span>';
     $text = _n('Comment', 'Comments', $num_comm->total_comments);
     if (current_user_can('moderate_comments')) {
         $num = '<a href="edit-comments.php">' . $num . '</a>';
         $text = '<a href="edit-comments.php">' . $text . '</a>';
     }
     echo '<td class="b b-comments">' . $num . '</td>';
     echo '<td class="last t comments">' . $text . '</td>';
     echo '</tr><tr>';
     // Approved Comments
     $num = '<span class="approved-count">' . number_format_i18n($num_comm->approved) . '</span>';
     $text = _nx('Approved', 'Approved', $num_comm->approved, 'Right Now');
     if (current_user_can('moderate_comments')) {
         $num = "<a href='edit-comments.php?comment_status=approved'>{$num}</a>";
         $text = "<a class='approved' href='edit-comments.php?comment_status=approved'>{$text}</a>";
     }
     echo '<td class="b b_approved">' . $num . '</td>';
     echo '<td class="last t">' . $text . '</td>';
     echo "</tr>\n\t<tr>";
     // Pending Comments
     $num = '<span class="pending-count">' . number_format_i18n($num_comm->moderated) . '</span>';
     $text = _n('Pending', 'Pending', $num_comm->moderated);
     if (current_user_can('moderate_comments')) {
         $num = "<a href='edit-comments.php?comment_status=moderated'>{$num}</a>";
         $text = "<a class='waiting' href='edit-comments.php?comment_status=moderated'>{$text}</a>";
     }
     echo '<td class="b b-waiting">' . $num . '</td>';
     echo '<td class="last t">' . $text . '</td>';
     echo "</tr>\n\t<tr>";
     // Spam Comments
     $num = number_format_i18n($num_comm->spam);
     $text = _nx('Spam', 'Spam', $num_comm->spam, 'comment');
     if (current_user_can('moderate_comments')) {
         $num = "<a href='edit-comments.php?comment_status=spam'><span class='spam-count'>{$num}</span></a>";
         $text = "<a class='spam' href='edit-comments.php?comment_status=spam'>{$text}</a>";
     }
     echo '<td class="b b-spam">' . $num . '</td>';
     echo '<td class="last t">' . $text . '</td>';
     echo "</tr>";
     do_action('right_now_table_end');
     do_action('right_now_discussion_table_end');
     echo "\n\t</table>\n\t</div>";
     echo "\n\t" . '<div class="versions">';
     // Check if search engines are blocked.
     if (!is_network_admin() && !is_user_admin() && current_user_can('manage_options') && '1' != Ai1ec_Meta::get_option('blog_public')) {
         $title = apply_filters('privacy_on_link_title', __('Your site is asking search engines not to index its content'));
         $content = apply_filters('privacy_on_link_text', __('Search Engines Blocked'));
         echo "<p><a href='options-privacy.php' title='{$title}'>{$content}</a></p>";
     }
     $msg = sprintf(__('You are using <span class="b">All-in-One Event Calendar %s</span>.'), AI1EC_VERSION);
     echo "<span id='wp-version-message'>{$msg}</span>";
     echo "\n\t" . '<br class="clear" /></div>';
     do_action('ai1ec_rightnow_end');
     do_action('activity_box_end');
 }
开发者ID:hamid-kamalpour,项目名称:all-in-one-event-calendar,代码行数:73,代码来源:class-ai1ec-platform-helper.php


示例13: piklist_dashboard_right_now_old


//.........这里部分代码省略.........
            </td>

          </tr>

        <?php 
    }
    ?>
      

      </tbody>

    </table>
    
  </div>


  <div class="versions">

    <p>

    <?php 
    $theme = wp_get_theme();
    if ($theme->errors()) {
        if (!is_multisite() || is_super_admin()) {
            echo '<span class="error-message">' . __('ERROR: The themes directory is either empty or does not exist. Please check your installation.', 'piklist') . '</span>';
        }
    } elseif (!empty($wp_registered_sidebars)) {
        $sidebars_widgets = wp_get_sidebars_widgets();
        $num_widgets = 0;
        foreach ((array) $sidebars_widgets as $k => $v) {
            if ('wp_inactive_widgets' == $k || 'orphaned_widgets' == substr($k, 0, 16)) {
                continue;
            }
            if (is_array($v)) {
                $num_widgets = $num_widgets + count($v);
            }
        }
        $num = number_format_i18n($num_widgets);
        $switch_themes = $theme->display('Name');
        if (current_user_can('switch_themes')) {
            $switch_themes = '<a href="themes.php">' . $switch_themes . '</a>';
        }
        if (current_user_can('edit_theme_options')) {
            printf(_n('Theme %1$s with %2$s Widget', 'Theme %1$s with %2$s Widgets', $num_widgets), '<span class="b">' . $switch_themes . '</span>', '<span class="b"><a href="widgets.php">' . $num . '</a></span>');
        } else {
            printf(_n('Theme %1$s with %2$s Widget', 'Theme %1$s with %2$s Widgets', $num_widgets), '<span class="b">' . $switch_themes . '</span>', '<span class="b">' . $num . '</span>');
        }
    } else {
        if (current_user_can('switch_themes')) {
            printf(__('Theme %1$s', 'piklist'), '<span class="b"><a href="themes.php">' . $theme->display('Name') . '</a></span>');
        } else {
            printf(__('Theme %1$s', 'piklist'), '<span class="b">' . $theme->display('Name') . '</span>');
        }
    }
    ?>

    </p>

    <?php 
    if (!is_network_admin() && !is_user_admin() && current_user_can('manage_options') && '1' != get_option('blog_public')) {
        ?>

      <?php 
        $title = apply_filters('privacy_on_link_title', __('Your site is asking search engines not to index its content', 'piklist'));
        ?>
      <?php 
        $content = apply_filters('privacy_on_link_text', __('Search Engines Discouraged', 'piklist'));
        ?>

      <p>
        <a href='options-reading.php' title='<?php 
        echo $title;
        ?>
 '><?php 
        echo $content;
        ?>
</a>
      </p>

    <?php 
    }
    ?>

    <?php 
    update_right_now_message();
    ?>

    <br class="clear" />

  </div>

  <?php 
    do_action('rightnow_end');
    ?>
  <?php 
    do_action('activity_box_end');
    ?>

<?php 
}
开发者ID:valenciafg,项目名称:want2ski,代码行数:101,代码来源:dashboard-right-now.php


示例14: add_menus

 public function add_menus()
 {
     // User related, aligned right.
     add_action('admin_bar_menu', 'wp_admin_bar_my_account_menu', 0);
     add_action('admin_bar_menu', 'wp_admin_bar_search_menu', 4);
     add_action('admin_bar_menu', 'wp_admin_bar_my_account_item', 7);
     // Site related.
     add_action('admin_bar_menu', 'wp_admin_bar_wp_menu', 10);
     add_action('admin_bar_menu', 'wp_admin_bar_my_sites_menu', 20);
     add_action('admin_bar_menu', 'wp_admin_bar_site_menu', 30);
     add_action('admin_bar_menu', 'wp_admin_bar_updates_menu', 40);
     // Content related.
     if (!is_network_admin() && !is_user_admin()) {
         add_action('admin_bar_menu', 'wp_admin_bar_comments_menu', 60);
         add_action('admin_bar_menu', 'wp_admin_bar_new_content_menu', 70);
     }
     add_action('admin_bar_menu', 'wp_admin_bar_edit_menu', 80);
     add_action('admin_bar_menu', 'wp_admin_bar_add_secondary_groups', 200);
     do_action('add_admin_bar_menus');
 }
开发者ID:rmccue,项目名称:wordpress-unit-tests,代码行数:20,代码来源:class-wp-admin-bar.php


示例15: wp_user_profiles_status_metabox

/**
 * Render the primary metabox for user profile screen
 *
 * @since 0.1.0
 *
 * @param WP_User $user The WP_User object to be edited.
 */
function wp_user_profiles_status_metabox($user = null)
{
    // Bail if no user id or if the user has not activated their account yet
    if (empty($user->ID)) {
        return;
    }
    ?>

	<div class="submitbox">
		<div id="minor-publishing">
			<div id="misc-publishing-actions">
				<?php 
    // Get the spam status once here to compare against below
    if (apply_filters('wp_user_profiles_show_status', true) && (current_user_can('edit_user', $user->ID) && !IS_PROFILE_PAGE && !is_user_admin() && !in_array($user->user_login, get_super_admins()))) {
        ?>

					<div class="misc-pub-section" id="comment-status-radio">
						<label class="approved"><input type="radio" name="user_status" value="ham" <?php 
        checked($user->user_status, 0);
        ?>
><?php 
        esc_html_e('Active', 'wp-user-profiles');
        ?>
</label><br>
						<label><input type="radio" name="user_status" value="inactive" <?php 
        checked($user->user_status, 2);
        ?>
><?php 
        esc_html_e('Inactive', 'wp-user-profiles');
        ?>
</label><br>
						<label class="spam"><input type="radio" name="user_status" value="spam" <?php 
        checked($user->user_status, 1);
        ?>
><?php 
        esc_html_e('Spammer', 'wp-user-profiles');
        ?>
</label>
					</div>

				<?php 
    }
    ?>

				<div class="misc-pub-section curtime misc-pub-section-last">
					<?php 
    $datef = get_option('date_format') . ' ' . get_option('time_format');
    $date = date_i18n($datef, strtotime($user->user_registered));
    ?>

					<span id="timestamp"><?php 
    printf(esc_html__('Registered on: %1$s', 'wp-user-profiles'), '<strong>' . $date . '</strong>');
    ?>
</span>
				</div>
			</div>

			<div class="clear"></div>
		</div>

		<div id="major-publishing-actions">
			<div id="publishing-action">
				<a class="button" href="<?php 
    echo esc_url(get_author_posts_url($user->ID));
    ?>
" target="_blank"><?php 
    esc_html_e('View User', 'wp-user-profiles');
    ?>
</a>
				<?php 
    submit_button(esc_html__('Update', 'wp-user-profiles'), 'primary', 'save', false);
    ?>
				<input type="hidden" name="action" value="update" />
				<input type="hidden" name="user_id" id="user_id" value="<?php 
    echo esc_attr($user->ID);
    ?>
" />
			</div>
			<div class="clear"></div>
		</div>
	</div>

	<?php 
}
开发者ID:wir,项目名称:wp-user-profiles,代码行数:91,代码来源:all-status.php


示例16: elseif

}
if (!$user_id && IS_PROFILE_PAGE) {
    $user_id = $current_user->ID;
} elseif (!$user_id && !IS_PROFILE_PAGE) {
    wp_die(__('Invalid user ID.'));
} elseif (!get_userdata($user_id)) {
    wp_die(__('Invalid user ID.'));
}
wp_enqueue_script('user-profile');
$title = IS_PROFILE_PAGE ? __('Profile') : __('Edit User');
if (current_user_can('edit_users') && !IS_PROFILE_PAGE) {
    $submenu_file = 'users.php';
} else {
    $submenu_file = 'profile.php';
}
if (current_user_can('edit_users') && !is_user_admin()) {
    $parent_file = 'users.php';
} else {
    $parent_file = 'profile.php';
}
$profile_help = '<p>' . __('Your profile contains information about you (your &#8220;account&#8221;) as well as some personal options related to using WordPress.') . '</p>' . '<p>' . __('You can change your password, turn on keyboard shortcuts, change the color scheme of your WordPress administration screens, and turn off the WYSIWYG (Visual) editor, among other things. You can hide the Toolbar (formerly called the Admin Bar) from the front end of your site, however it cannot be disabled on the admin screens.') . '</p>' . '<p>' . __('Your username cannot be changed, but you can use other fields to enter your real name or a nickname, and change which name to display on your posts.') . '</p>' . '<p>' . __('You can log out of other devices, such as your phone or a public computer, by clicking the Log Out of All Other Sessions button.') . '</p>' . '<p>' . __('Required fields are indicated; the rest are optional. Profile information will only be displayed if your theme is set up to do so.') . '</p>' . '<p>' . __('Remember to click the Update Profile button when you are finished.') . '</p>';
get_current_screen()->add_help_tab(array('id' => 'overview', 'title' => __('Overview'), 'content' => $profile_help));
get_current_screen()->set_help_sidebar('<p><strong>' . __('For more information:') . '</strong></p>' . '<p>' . __('<a href="https://codex.wordpress.org/Users_Your_Profile_Screen" target="_blank">Documentation on User Profiles</a>') . '</p>' . '<p>' . __('<a href="https://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>');
$wp_http_referer = remove_query_arg(array('update', 'delete_count'), $wp_http_referer);
$user_can_edit = current_user_can('edit_posts') || current_user_can('edit_pages');
/**
 * Optional SSL preference that can be turned on by hooking to the 'personal_options' action.
 *
 * @since 2.7.0
 *
 * @param object $user User data object
开发者ID:harissonsofia,项目名称:WordPress,代码行数:31,代码来源:user-edit.php


示例17: bp_core_activation_notice

/**
 * Verify that some BP prerequisites are set up properly, and notify the admin if not.
 *
 * On every Dashboard page, this function checks the following:
 *   - that pretty permalinks are enabled.
 *   - that every BP component that needs a WP page for a directory has one.
 *   - that no WP page has multiple BP components associated with it.
 * The administrator will be shown a notice for each check that fails.
 *
 * @global WPDB $wpdb WordPress DB object
 * @global WP_Rewrite $wp_rewrite
 *
 * @since 1.2.0
 */
function bp_core_activation_notice()
{
    global $wp_rewrite, $wpdb;
    // Only the super admin gets warnings.
    if (!bp_current_user_can('bp_moderate')) {
        return;
    }
    // Bail in user admin.
    if (is_user_admin()) {
        return;
    }
    // On multisite installs, don't load on a non-root blog, unless do_network_admin is overridden.
    if (is_multisite() && bp_core_do_network_admin() && !bp_is_root_blog()) {
        return;
    }
    // Bail if in network admin, and BuddyPress is not network activated.
    if (is_network_admin() && !bp_is_network_activated()) {
        return;
    }
    /**
     * Check to make sure that the blog setup routine has run. This can't
     * happen during the wizard because of the order which the components
     * are loaded.
     */
    if (bp_is_active('blogs')) {
        $bp = buddypress();
        $count = $wpdb->get_var("SELECT COUNT(*) FROM {$bp->blogs->table_name}");
        if (empty($count)) {
            bp_blogs_record_existing_blogs();
        }
    }
    // Add notice if no rewrite rules are enabled.
    if (empty($wp_rewrite->permalink_structure)) {
        bp_core_add_admin_notice(sprintf(__('<strong>BuddyPress is almost ready</strong>. You must <a href="%s">update your permalink structure</a> to something other than the default for it to work.', 'buddypress'), admin_url('options-permalink.php')), 'error');
    }
    // Get BuddyPress instance.
    $bp = buddypress();
    /**
     * Check for orphaned BP components (BP component is enabled, no WP page exists).
     */
    $orphaned_components = array();
    $wp_page_components = array();
    // Only components with 'has_directory' require a WP page to function.
    foreach (array_keys($bp->loaded_components) as $component_id) {
        if (!empty($bp->{$component_id}->has_directory)) {
            $wp_page_components[] = array('id' => $component_id, 'name' => isset($bp->{$component_id}->name) ? $bp->{$component_id}->name : ucwords($bp->{$component_id}->id));
        }
    }
    // Activate and Register are special cases. They are not components but they need WP pages.
    // If user registration is disabled, we can skip this step.
    if (bp_get_signup_allowed()) {
        $wp_page_components[] = array('id' => 'activate', 'name' => __('Activate', 'buddypress'));
        $wp_page_components[] = array('id' => 'register', 'name' => __('Register', 'buddypress'));
    }
    // On the first admin screen after a new installation, this isn't set, so grab it to suppress
    // a misleading error message.
    if (empty($bp->pages->members)) {
        $bp->pages = bp_core_get_directory_pages();
    }
    foreach ($wp_page_components as $component) {
        if (!isset($bp->pages->{$component['id']})) {
            $orphaned_components[] = $component['name'];
        }
    }
    // Special case: If the Forums component is orphaned, but the bbPress 1.x installation is
    // not correctly set up, don't show a nag. (In these cases, it's probably the case that the
    // user is using bbPress 2.x; see https://buddypress.trac.wordpress.org/ticket/4292.
    if (isset($bp->forums->name) && in_array($bp->forums->name, $orphaned_components) && !bp_forums_is_installed_correctly()) {
        $forum_key = array_search($bp->forums->name, $orphaned_components);
        unset($orphaned_components[$forum_key]);
        $orphaned_components = array_values($orphaned_components);
    }
    if (!empty($orphaned_components)) {
        $admin_url = bp_get_admin_url(add_query_arg(array('page' => 'bp-page-settings'), 'admin.php'));
        $notice = sprintf(__('The following active BuddyPress Components do not have associated WordPress Pages: %2$s. <a href="%1$s">Repair</a>', 'buddypress'), esc_url($admin_url), '<strong>' . implode('</strong>, <strong>', $orphaned_components) . '</strong>');
        bp_core_add_admin_notice($notice);
    }
    // BP components cannot share a single WP page. Check for duplicate assignments, and post a message if found.
    $dupe_names = array();
    $page_ids = (array) bp_core_get_directory_page_ids();
    $dupes = array_diff_assoc($page_ids, array_unique($page_ids));
    if (!empty($dupes)) {
        foreach (array_keys($dupes) as $dupe_component) {
            $dupe_names[] = $bp->pages->{$dupe_component}->title;
        }
        // Make sure that there are no duplicate duplicates :).
//.........这里部分代码省略.........
开发者ID:igniterealtime,项目名称:community-plugins,代码行数:101,代码来源:bp-core-admin-functions.php


示例18: __adminInit

该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP is_user_administrator_rs函数代码示例发布时间:2022-05-15
下一篇:
PHP is_user函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap