本文整理汇总了PHP中is_blog_admin函数的典型用法代码示例。如果您正苦于以下问题:PHP is_blog_admin函数的具体用法?PHP is_blog_admin怎么用?PHP is_blog_admin使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了is_blog_admin函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: get_currentuserinfo
/**
* Populate global variables with information about the currently logged in user.
*
* Will set the current user, if the current user is not set. The current user
* will be set to the logged in person. If no user is logged in, then it will
* set the current user to 0, which is invalid and won't have any permissions.
*
* @since 0.71
* @uses $current_user Checks if the current user is set
* @uses wp_validate_auth_cookie() Retrieves current logged in user.
*
* @return bool|null False on XMLRPC Request and invalid auth cookie. Null when current user set
*/
function get_currentuserinfo()
{
global $current_user;
if (!empty($current_user)) {
if ($current_user instanceof WP_User) {
return;
}
// Upgrade stdClass to WP_User
if (is_object($current_user) && isset($current_user->ID)) {
$cur_id = $current_user->ID;
$current_user = null;
wp_set_current_user($cur_id);
return;
}
// $current_user has a junk value. Force to WP_User with ID 0.
$current_user = null;
wp_set_current_user(0);
return false;
}
if (defined('XMLRPC_REQUEST') && XMLRPC_REQUEST) {
wp_set_current_user(0);
return false;
}
if (!($user = wp_validate_auth_cookie())) {
if (is_blog_admin() || is_network_admin() || empty($_COOKIE[LOGGED_IN_COOKIE]) || !($user = wp_validate_auth_cookie($_COOKIE[LOGGED_IN_COOKIE], 'logged_in'))) {
wp_set_current_user(0);
return false;
}
}
wp_set_current_user($user);
}
开发者ID:bigkey,项目名称:php-getting-started,代码行数:44,代码来源:pluggable.min.php
示例2: hide_admin_bar_from_front_end
function hide_admin_bar_from_front_end()
{
if (is_blog_admin()) {
return true;
}
return false;
}
开发者ID:besimhu,项目名称:legacy,代码行数:7,代码来源:custom-functions.php
示例3: handle_ms_user_deletions
/**
* Handles Multisite User removal deletions.
*
* @package s2Member\User_Deletions
* @since 3.5
*
* @attaches-to ``add_action("remove_user_from_blog");``
*
* @param int|str $user_id Numeric WordPress User ID.
* @param int|str $blog_id Numeric WordPress Blog ID.
* @param bool $s2says Optional. Defaults to false. If true, it's definitely OK to process this deletion?
* The ``$s2says`` flag can be used when/if the routine is called directly for whatever reason.
* @return null
*/
public static function handle_ms_user_deletions($user_id = FALSE, $blog_id = FALSE, $s2says = FALSE)
{
static $processed = array();
// No duplicate processing.
global $pagenow;
// Need this to detect the current admin page.
foreach (array_keys(get_defined_vars()) as $__v) {
$__refs[$__v] =& ${$__v};
}
do_action("ws_plugin__s2member_before_handle_ms_user_deletions", get_defined_vars());
unset($__refs, $__v);
if (is_multisite() && empty($processed[$user_id])) {
if (($s2says || is_blog_admin() && $pagenow === "users.php") && ($processed[$user_id] = true)) {
foreach (array_keys(get_defined_vars()) as $__v) {
$__refs[$__v] =& ${$__v};
}
do_action("ws_plugin__s2member_during_handle_ms_user_deletions_before", get_defined_vars());
unset($__refs, $__v);
c_ws_plugin__s2member_user_deletions::handle_user_deletions($user_id);
// Hand this over.
foreach (array_keys(get_defined_vars()) as $__v) {
$__refs[$__v] =& ${$__v};
}
do_action("ws_plugin__s2member_during_handle_ms_user_deletions_after", get_defined_vars());
unset($__refs, $__v);
}
}
foreach (array_keys(get_defined_vars()) as $__v) {
$__refs[$__v] =& ${$__v};
}
do_action("ws_plugin__s2member_after_handle_ms_user_deletions", get_defined_vars());
unset($__refs, $__v);
return;
}
开发者ID:donwea,项目名称:nhap.org,代码行数:48,代码来源:user-deletions.inc.php
示例4: handle_ms_user_deletions
/**
* Handles Multisite User removal deletions.
*
* @package s2Member\User_Deletions
* @since 3.5
*
* @attaches-to ``add_action('remove_user_from_blog');``
*
* @param int|string $user_id Numeric WordPress User ID.
* @param int|string $blog_id Numeric WordPress Blog ID.
* @param bool $s2says Optional. Defaults to false. If true, it's definitely OK to process this deletion?
* The ``$s2says`` flag can be used when/if the routine is called directly for whatever reason.
*/
public static function handle_ms_user_deletions($user_id = 0, $blog_id = 0, $s2says = FALSE)
{
static $processed = array();
// No duplicate processing.
global $pagenow;
// Need this to detect the current admin page.
foreach (array_keys(get_defined_vars()) as $__v) {
$__refs[$__v] =& ${$__v};
}
do_action('ws_plugin__s2member_before_handle_ms_user_deletions', get_defined_vars());
unset($__refs, $__v);
if ($user_id && is_multisite() && empty($processed[$user_id]) && ($s2says || is_blog_admin() && $pagenow === 'users.php')) {
$processed[$user_id] = TRUE;
foreach (array_keys(get_defined_vars()) as $__v) {
$__refs[$__v] =& ${$__v};
}
do_action('ws_plugin__s2member_during_handle_ms_user_deletions_before', get_defined_vars());
unset($__refs, $__v);
c_ws_plugin__s2member_user_deletions::handle_user_deletions($user_id);
foreach (array_keys(get_defined_vars()) as $__v) {
$__refs[$__v] =& ${$__v};
}
do_action('ws_plugin__s2member_during_handle_ms_user_deletions_after', get_defined_vars());
unset($__refs, $__v);
}
foreach (array_keys(get_defined_vars()) as $__v) {
$__refs[$__v] =& ${$__v};
}
do_action('ws_plugin__s2member_after_handle_ms_user_deletions', get_defined_vars());
unset($__refs, $__v);
}
开发者ID:novichkovv,项目名称:candoweightloss,代码行数:44,代码来源:user-deletions.inc.php
示例5: is_blog_admin
public static function is_blog_admin()
{
if (version_compare(get_bloginfo("version"), "3.1-RC", ">=")) {
return is_blog_admin();
}
/**/
return is_admin();
}
开发者ID:Weissenberger13,项目名称:web.portugalrentalcottages,代码行数:8,代码来源:utils-conds.inc.php
示例6: hide_admin_bar_from_front_end
function hide_admin_bar_from_front_end()
{
if (is_blog_admin()) {
return true;
}
remove_action('wp_head', '_admin_bar_bump_cb');
return false;
}
开发者ID:mazykin46,项目名称:portfolio,代码行数:8,代码来源:functions.php
示例7: jl_brd_recent_drafts
function jl_brd_recent_drafts()
{
if (!(is_blog_admin() && current_user_can('edit_posts'))) {
return;
}
wp_add_dashboard_widget('jl_brd_dashboard_recent_drafts', __('Recent Drafts'), 'jl_brd_dashboard_recent_drafts');
remove_meta_box('dashboard_recent_drafts', 'dashboard', 'side');
// recent drafts
remove_meta_box('dashboard_recent_drafts', 'dashboard', 'normal');
// recent drafts
}
开发者ID:aarontgrogg,项目名称:aarontgrogg,代码行数:11,代码来源:better-recent-drafts.php
示例8: admin_user_new_fields
/**
* Adds Custom Fields to `/wp-admin/user-new.php`.
*
* We have to buffer because `/user-new.php` has NO Hooks.
*
* @package s2Member\New_Users
* @since 3.5
*
* @attaches-to ``add_action("load-user-new.php");``
*
* @return null
*/
public static function admin_user_new_fields()
{
global $pagenow;
// The current admin page file name.
do_action("ws_plugin__s2member_before_admin_user_new_fields", get_defined_vars());
if (is_blog_admin() && $pagenow === "user-new.php" && current_user_can("create_users")) {
ob_start("c_ws_plugin__s2member_user_new_in::_admin_user_new_fields");
do_action("ws_plugin__s2member_during_admin_user_new_fields", get_defined_vars());
}
do_action("ws_plugin__s2member_after_admin_user_new_fields", get_defined_vars());
return;
}
开发者ID:novichkovv,项目名称:candoweightloss,代码行数:24,代码来源:user-new.inc.php
示例9: wphd_remove_admin_bar_links
function wphd_remove_admin_bar_links()
{
global $blog, $current_user, $id, $wp_admin_bar, $wphd_user_capability;
if ((!current_user_can('' . $wphd_user_capability . '') || !current_user_can_for_blog($blog->userblog_id, '' . $wphd_user_capability . '')) && is_admin_bar_showing()) {
/* If Multisite, check whether they are assigned to any network sites before removing links */
$user_id = get_current_user_id();
$blogs = get_blogs_of_user($user_id);
if (is_multisite() && empty($blogs)) {
return;
} else {
if (is_admin() || is_blog_admin()) {
$wp_admin_bar->remove_menu('edit-my-profile');
}
}
$wp_admin_bar->remove_menu('dashboard');
}
}
开发者ID:GnaritasInc,项目名称:gnlms,代码行数:17,代码来源:wp-hide-dashboard.php
示例10: get_currentuserinfo
/**
* Populate global variables with information about the currently logged in user.
*
* Will set the current user, if the current user is not set. The current user
* will be set to the logged in person. If no user is logged in, then it will
* set the current user to 0, which is invalid and won't have any permissions.
*
* @since 0.71
* @uses $current_user Checks if the current user is set
* @uses wp_validate_auth_cookie() Retrieves current logged in user.
*
* @return bool|null False on XMLRPC Request and invalid auth cookie. Null when current user set
*/
function get_currentuserinfo()
{
global $current_user;
if (defined('XMLRPC_REQUEST') && XMLRPC_REQUEST) {
return false;
}
if (!empty($current_user)) {
return;
}
if (!($user = wp_validate_auth_cookie())) {
if (is_blog_admin() || is_network_admin() || empty($_COOKIE[LOGGED_IN_COOKIE]) || !($user = wp_validate_auth_cookie($_COOKIE[LOGGED_IN_COOKIE], 'logged_in'))) {
wp_set_current_user(0);
return false;
}
}
wp_set_current_user($user);
}
开发者ID:kosir,项目名称:thatcamp-org,代码行数:30,代码来源:pluggable.php
示例11: admin_user_new_fields
/**
* Adds Custom Fields to `/wp-admin/user-new.php`.
*
* We have to buffer because `/user-new.php` has NO Hooks.
*
* @package optimizeMember\New_Users
* @since 3.5
*
* @attaches-to ``add_action("load-user-new.php");``
*
* @return null
*/
public static function admin_user_new_fields()
{
global $pagenow;
/* The current admin page file name. */
/**/
do_action("ws_plugin__optimizemember_before_admin_user_new_fields", get_defined_vars());
/**/
if (is_blog_admin() && $pagenow === "user-new.php" && current_user_can("create_users")) {
ob_start("c_ws_plugin__optimizemember_user_new_in::_admin_user_new_fields");
/**/
do_action("ws_plugin__optimizemember_during_admin_user_new_fields", get_defined_vars());
}
/**/
do_action("ws_plugin__optimizemember_after_admin_user_new_fields", get_defined_vars());
/**/
return;
/* Return for uniformity. */
}
开发者ID:JalpMi,项目名称:v2contact,代码行数:30,代码来源:user-new.inc.php
示例12: handle_ms_user_deletions
/**
* Handles Multisite User removal deletions.
*
* @package s2Member\User_Deletions
* @since 3.5
*
* @attaches-to ``add_action("remove_user_from_blog");``
*
* @param int|str $user_id Numeric WordPress® User ID.
* @param int|str $blog_id Numeric WordPress® Blog ID.
* @param bool $s2says Optional. Defaults to false. If true, it's definitely OK to process this deletion?
* The ``$s2says`` flag can be used when/if the routine is called directly for whatever reason.
* @return null
*/
public static function handle_ms_user_deletions($user_id = FALSE, $blog_id = FALSE, $s2says = FALSE)
{
static $processed = array();
/* No duplicate processing. */
global $pagenow;
/* Need this to detect the current admin page. */
/**/
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
do_action("ws_plugin__s2member_before_handle_ms_user_deletions", get_defined_vars());
unset($__refs, $__v);
/* Unset defined __refs, __v. */
/**/
if (is_multisite() && empty($processed[$user_id])) {
if (($s2says || is_blog_admin() && $pagenow === "users.php") && ($processed[$user_id] = true)) {
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
do_action("ws_plugin__s2member_during_handle_ms_user_deletions_before", get_defined_vars());
unset($__refs, $__v);
/* Unset defined __refs, __v. */
/**/
c_ws_plugin__s2member_user_deletions::handle_user_deletions($user_id);
/* Hand this over. */
/**/
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
do_action("ws_plugin__s2member_during_handle_ms_user_deletions_after", get_defined_vars());
unset($__refs, $__v);
/* Unset defined __refs, __v. */
}
}
/**/
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
do_action("ws_plugin__s2member_after_handle_ms_user_deletions", get_defined_vars());
unset($__refs, $__v);
/* Unset defined __refs, __v. */
/**/
return;
/* Return for uniformity. */
}
开发者ID:vinvinh315,项目名称:maintainwebsolutions.com,代码行数:51,代码来源:user-deletions.inc.php
示例13: _admin_user_new_fields
/**
* Callback adds Custom Fields to `/wp-admin/user-new.php`.
*
* We have to buffer because `/user-new.php` has NO Hooks.
*
* @package s2Member\New_Users
* @since 3.5
*
* @attaches-to ``ob_start("c_ws_plugin__s2member_user_new_in::_admin_user_new_fields");``
*
* @return string Output buffer.
*/
public static function _admin_user_new_fields($buffer = FALSE)
{
global $pagenow;
// The current admin page file name.
foreach (array_keys(get_defined_vars()) as $__v) {
$__refs[$__v] =& ${$__v};
}
do_action("_ws_plugin__s2member_before_admin_user_new_fields", get_defined_vars());
unset($__refs, $__v);
if (is_blog_admin() && $pagenow === "user-new.php" && current_user_can("create_users")) {
$_p = c_ws_plugin__s2member_utils_strings::trim_deep(stripslashes_deep($_POST));
$unfs = '<div style="margin:25px 0 25px 0; height:1px; line-height:1px; background:#CCCCCC;"></div>' . "\n";
$unfs .= '<h3 style="position:relative;"><img src="' . esc_attr($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"]) . '/images/large-icon.png" title="s2Member (a Membership management system for WordPress)" alt="" style="position:absolute; top:-15px; right:0; border:0;" />s2Member Configuration & Profile Fields' . (is_multisite() ? ' (for this Blog)' : '') . '</h3>' . "\n";
$unfs .= '<table class="form-table">' . "\n";
foreach (array_keys(get_defined_vars()) as $__v) {
$__refs[$__v] =& ${$__v};
}
do_action("_ws_plugin__s2member_during_admin_user_new_fields_before", get_defined_vars());
unset($__refs, $__v);
if (is_multisite()) {
foreach (array_keys(get_defined_vars()) as $__v) {
$__refs[$__v] =& ${$__v};
}
do_action("_ws_plugin__s2member_during_admin_user_new_fields_before_first_name", get_defined_vars());
unset($__refs, $__v);
$unfs .= '<tr>' . "\n";
$unfs .= '<th><label for="ws-plugin--s2member-user-new-first-name">First Name:</label></th>' . "\n";
$unfs .= '<td><input type="text" autocomplete="off" name="ws_plugin__s2member_user_new_first_name" id="ws-plugin--s2member-user-new-first-name" value="' . esc_attr($_p["ws_plugin__s2member_user_new_first_name"]) . '" class="regular-text" /></td>' . "\n";
$unfs .= '</tr>' . "\n";
foreach (array_keys(get_defined_vars()) as $__v) {
$__refs[$__v] =& ${$__v};
}
do_action("_ws_plugin__s2member_during_admin_user_new_fields_after_first_name", get_defined_vars());
unset($__refs, $__v);
foreach (array_keys(get_defined_vars()) as $__v) {
$__refs[$__v] =& ${$__v};
}
do_action("_ws_plugin__s2member_during_admin_user_new_fields_before_last_name", get_defined_vars());
unset($__refs, $__v);
$unfs .= '<tr>' . "\n";
$unfs .= '<th><label for="ws-plugin--s2member-user-new-last-name">Last Name:</label></th>' . "\n";
$unfs .= '<td><input type="text" autocomplete="off" name="ws_plugin__s2member_user_new_last_name" id="ws-plugin--s2member-user-new-last-name" value="' . esc_attr($_p["ws_plugin__s2member_user_new_last_name"]) . '" class="regular-text" /></td>' . "\n";
$unfs .= '</tr>' . "\n";
foreach (array_keys(get_defined_vars()) as $__v) {
$__refs[$__v] =& ${$__v};
}
do_action("_ws_plugin__s2member_during_admin_user_new_fields_after_last_name", get_defined_vars());
unset($__refs, $__v);
}
foreach (array_keys(get_defined_vars()) as $__v) {
$__refs[$__v] =& ${$__v};
}
do_action("_ws_plugin__s2member_during_admin_user_new_fields_before_subscr_gateway", get_defined_vars());
unset($__refs, $__v);
$unfs .= '<tr>' . "\n";
$unfs .= '<th><label for="ws-plugin--s2member-user-new-s2member-subscr-gateway">Paid Subscr. Gateway:</label> <a href="#" onclick="alert(\'A Payment Gateway code is associated with the Paid Subscr. ID below. A Paid Subscription ID (or a Buy Now Transaction ID) is only valid for paid Members. Also known as (a Recurring Profile ID, a ClickBank Receipt #, a Google Order ID, an AliPay Trade No.). Under normal circumstances, this is filled automatically by s2Member. This field is ONLY here for Customer Service purposes; just in case you ever need to enter a Paid Subscr. Gateway/ID manually. This field will be empty for Free Subscribers, and/or anyone who is NOT paying you.\\n\\nThe value of Paid Subscr. ID, can be a PayPal Standard `Subscription ID`, or a PayPal Pro `Recurring Profile ID`, or a PayPal `Transaction ID`; depending on the type of sale. Your PayPal account will supply this information. If you\\\'re using Google Wallet, use the Google Order ID. ClickBank provides a Receipt #, ccBill provides a Subscription ID, Authorize.Net provides a Subscription ID, and AliPay provides a Transaction ID. The general rule is... IF there\\\'s a Subscription ID, use that! If there\\\'s NOT, use the Transaction ID.\'); return false;" tabindex="-1">[?]</a></th>' . "\n";
$unfs .= '<td><select name="ws_plugin__s2member_user_new_s2member_subscr_gateway" id="ws-plugin--s2member-user-new-s2member-subscr-gateway" style="width:25em;"><option value=""></option>' . "\n";
foreach (apply_filters("ws_plugin__s2member_profile_s2member_subscr_gateways", array("paypal" => "PayPal (code: paypal)"), get_defined_vars()) as $gateway => $gateway_name) {
$unfs .= '<option value="' . esc_attr($gateway) . '"' . ($gateway === $_p["ws_plugin__s2member_user_new_s2member_subscr_gateway"] ? ' selected="selected"' : '') . '>' . esc_html($gateway_name) . '</option>' . "\n";
}
$unfs .= '</select>' . "\n";
$unfs .= '</td>' . "\n";
$unfs .= '</tr>' . "\n";
foreach (array_keys(get_defined_vars()) as $__v) {
$__refs[$__v] =& ${$__v};
}
do_action("_ws_plugin__s2member_during_admin_user_new_fields_after_subscr_gateway", get_defined_vars());
unset($__refs, $__v);
foreach (array_keys(get_defined_vars()) as $__v) {
$__refs[$__v] =& ${$__v};
}
do_action("_ws_plugin__s2member_during_admin_user_new_fields_before_subscr_id", get_defined_vars());
unset($__refs, $__v);
$unfs .= '<tr>' . "\n";
$unfs .= '<th><label for="ws-plugin--s2member-user-new-s2member-subscr-id">Paid Subscr. ID:</label> <a href="#" onclick="alert(\'A Paid Subscription ID (or a Buy Now Transaction ID) is only valid for paid Members. Also known as (a Recurring Profile ID, a ClickBank Receipt #, a Google Order ID, an AliPay Trade No.). Under normal circumstances, this is filled automatically by s2Member. This field is ONLY here for Customer Service purposes; just in case you ever need to enter a Paid Subscr. Gateway/ID manually. This field will be empty for Free Subscribers, and/or anyone who is NOT paying you.\\n\\nThe value of Paid Subscr. ID, can be a PayPal Standard `Subscription ID`, or a PayPal Pro `Recurring Profile ID`, or a PayPal `Transaction ID`; depending on the type of sale. Your PayPal account will supply this information. If you\\\'re using Google Wallet, use the Google Order ID. ClickBank provides a Receipt #, ccBill provides a Subscription ID, Authorize.Net provides a Subscription ID, and AliPay provides a Transaction ID. The general rule is... if there\\\'s a Subscription ID, use that! If there\\\'s NOT, use the Transaction ID.\'); return false;" tabindex="-1">[?]</a></th>' . "\n";
$unfs .= '<td><input type="text" autocomplete="off" name="ws_plugin__s2member_user_new_s2member_subscr_id" id="ws-plugin--s2member-user-new-s2member-subscr-id" value="' . format_to_edit($_p["ws_plugin__s2member_user_new_s2member_subscr_id"]) . '" class="regular-text" /></td>' . "\n";
$unfs .= '</tr>' . "\n";
foreach (array_keys(get_defined_vars()) as $__v) {
$__refs[$__v] =& ${$__v};
}
do_action("_ws_plugin__s2member_during_admin_user_new_fields_after_subscr_id", get_defined_vars());
unset($__refs, $__v);
foreach (array_keys(get_defined_vars()) as $__v) {
$__refs[$__v] =& ${$__v};
}
do_action("_ws_plugin__s2member_during_admin_user_new_fields_before_custom", get_defined_vars());
unset($__refs, $__v);
$unfs .= '<tr>' . "\n";
//.........这里部分代码省略.........
开发者ID:adnandot,项目名称:intenseburn,代码行数:101,代码来源:user-new-in.inc.php
示例14: wp_dashboard_primary
/**
* WordPress News dashboard widget.
*
* @since 2.7.0
*/
function wp_dashboard_primary()
{
$feeds = array('news' => array('link' => apply_filters('dashboard_primary_link', __('https://wordpress.org/news/')), 'url' => apply_filters('dashboard_primary_feed', __('http://wordpress.org/news/feed/')), 'title' => apply_filters('dashboard_primary_title', __('WordPress Blog')), 'items' => 1, 'show_summary' => 1, 'show_author' => 0, 'show_date' => 1), 'planet' => array('link' => apply_filters('dashboard_secondary_link', __('https://planet.wordpress.org/')), 'url' => apply_filters('dashboard_secondary_feed', __('https://planet.wordpress.org/feed/')), 'title' => apply_filters('dashboard_secondary_title', __('Other WordPress News')), 'items' => apply_filters('dashboard_secondary_items', 3), 'show_summary' => 0, 'show_author' => 0, 'show_date' => 0));
if (!is_multisite() && is_blog_admin() && current_user_can('install_plugins') || is_network_admin() && current_user_can('manage_network_plugins') && current_user_can('install_plugins')) {
$feeds['plugins'] = array('link' => '', 'url' => array('popular' => 'http://wordpress.org/plugins/rss/browse/popular/'), 'title' => '', 'items' => 1, 'show_summary' => 0, 'show_author' => 0, 'show_date' => 0);
}
wp_dashboard_cached_rss_widget('dashboard_primary', 'wp_dashboard_primary_output', $feeds);
}
开发者ID:riasnelli,项目名称:WordPress,代码行数:13,代码来源:dashboard.php
示例15: wp_add_dashboard_widget
function wp_add_dashboard_widget($widget_id, $widget_name, $callback, $control_callback = null)
{
$screen = get_current_screen();
global $wp_dashboard_control_callbacks;
if ($control_callback && current_user_can('edit_dashboard') && is_callable($control_callback)) {
$wp_dashboard_control_callbacks[$widget_id] = $control_callback;
if (isset($_GET['edit']) && $widget_id == $_GET['edit']) {
list($url) = explode('#', add_query_arg('edit', false), 2);
$widget_name .= ' <span class="postbox-title-action"><a href="' . esc_url($url) . '">' . __('Cancel') . '</a></span>';
$callback = '_wp_dashboard_control_callback';
} else {
list($url) = explode('#', add_query_arg('edit', $widget_id), 2);
$widget_name .= ' <span class="postbox-title-action"><a href="' . esc_url("{$url}#{$widget_id}") . '" class="edit-box open-box">' . __('Configure') . '</a></span>';
}
}
if (is_blog_admin()) {
$side_widgets = array('dashboard_quick_press', 'dashboard_recent_drafts', 'dashboard_primary', 'dashboard_secondary');
} else {
if (is_network_admin()) {
$side_widgets = array('dashboard_primary', 'dashboard_secondary');
} else {
$side_widgets = array();
}
}
$location = 'normal';
if (in_array($widget_id, $side_widgets)) {
$location = 'side';
}
$priority = 'core';
if ('dashboard_browser_nag' === $widget_id) {
$priority = 'high';
}
add_meta_box($widget_id, $widget_name, $callback, $screen->id, $location, $priority);
}
开发者ID:nouphet,项目名称:rata,代码行数:34,代码来源:dashboard.php
示例16: tc_welcome_panel
//.........这里部分代码省略.........
<a class="" title="<?php
_e("Visit the extension's page", 'customizr');
?>
" href="<?php
echo TC_WEBSITE;
?>
customizr-pro/" target="_blank"><img alt="Customizr'extensions" src="<?php
echo TC_BASE_URL . 'inc/admin/img/customizr-pro.png';
?>
" class=""></a>
<h4 style="text-align: left"><?php
_e('Easily take your web design one step further', 'customizr');
?>
</h4></br>
<p style="text-align: left"><?php
_e("The Customizr Pro WordPress theme allows anyone to create a beautiful, professional and fully responsive website in a few seconds. In the Pro version, you'll get all the features of the free version plus some really cool and even revolutionary ones.", 'customizr');
?>
</p>
<p style="text-align:left">
<a class="button-primary review-customizr" title="<?php
_e("Discover Customizr Pro", 'customizr');
?>
" href="<?php
echo TC_WEBSITE;
?>
customizr-pro/" target="_blank"><?php
_e("Discover Customizr Pro", 'customizr');
?>
»</a>
</p>
</div>
</div>
<?php
}
//end if ! is_pro
?>
<div id="showcase" class="changelog">
<h3 style="text-align:right"><?php
_e('Customizr Showcase', 'customizr');
?>
</h3>
<div class="feature-section images-stagger-left">
<a class="" title="<?php
_e('Visit the showcase', 'customizr');
?>
" href="<?php
echo TC_WEBSITE;
?>
customizr/showcase/" target="_blank"><img alt="Customizr Showcase" src="<?php
echo TC_BASE_URL . 'inc/admin/img/mu2.png';
?>
" class=""></a>
<h4 style="text-align: right"><?php
_e('Find inspiration for your next Customizr based website!', 'customizr');
?>
</h4>
<p style="text-align: right"><?php
_e('This showcase aims to show what can be done with Customizr and helping other users to find inspiration for their web design.', 'customizr');
?>
</p>
<p style="text-align: right"><?php
_e('Do you think you made an awesome website that can inspire people? Submitting a site for review is quick and easy to do.', 'customizr');
?>
</br>
</p>
<p style="text-align:right">
<a class="button-primary review-customizr" title="<?php
_e('Visit the showcase', 'customizr');
?>
" href="<?php
echo TC_WEBSITE;
?>
customizr/showcase/" target="_blank"><?php
_e('Visit the showcase', 'customizr');
?>
»</a>
</p>
</div>
</div>
<?php
do_action('__after_welcome_panel');
?>
<div class="return-to-dashboard">
<a href="<?php
echo esc_url(self_admin_url());
?>
"><?php
is_blog_admin() ? _e('Go to Dashboard → Home', 'customizr') : _e('Go to Dashboard', 'customizr');
?>
</a>
</div>
</div><!-- //#customizr-admin-panel -->
<?php
}
开发者ID:cumbach,项目名称:ParadataChrisUmbach,代码行数:101,代码来源:class-fire-admin_page.php
示例17: wp_admin_bar_site_menu
/**
* Add the "Site Name" menu.
*
* @since 3.3.0
*
* @param WP_Admin_Bar $wp_admin_bar
*/
function wp_admin_bar_site_menu($wp_admin_bar)
{
// Don't show for logged out users.
if (!is_user_logged_in()) {
return;
}
// Show only when the user is a member of this site, or they're a super admin.
if (!is_user_member_of_blog() && !is_super_admin()) {
return;
}
$blogname = get_bloginfo('name');
if (!$blogname) {
$blogname = preg_replace('#^(https?://)?(www.)?#', '', get_home_url());
}
if (is_network_admin()) {
$blogname = sprintf(__('Network Admin: %s'), esc_html(get_current_site()->site_name));
} elseif (is_user_admin()) {
$blogname = sprintf(__('Global Dashboard: %s'), esc_html(get_current_site()->site_name));
}
$title = wp_html_excerpt($blogname, 40, '…');
$wp_admin_bar->add_menu(array('id' => 'site-name', 'title' => $title, 'href' => is_admin() ? home_url('/') : admin_url()));
// Create submenu items.
if (is_admin()) {
// Add an option to visit the site.
$wp_admin_bar->add_menu(array('parent' => 'site-name', 'id' => 'view-site', 'title' => __('Visit Site'), 'href' => home_url('/')));
if (is_blog_admin() && is_multisite() && current_user_can('manage_sites')) {
$wp_admin_bar->add_menu(array('parent' => 'site-name', 'id' => 'edit-site', 'title' => __('Edit Site'), 'href' => network_admin_url('site-info.php?id=' . get_current_blog_id())));
}
} else {
// We're on the front end, link to the Dashboard.
$wp_admin_bar->add_menu(array('parent' => 'site-name', 'id' => 'dashboard', 'title' => __('Dashboard'), 'href' => admin_url()));
// Add the appearance submenu items.
wp_admin_bar_appearance_menu($wp_admin_bar);
}
}
开发者ID:ajspencer,项目名称:NCSSM-SG-WordPress,代码行数:42,代码来源:admin-bar.php
示例18: __construct
/**
* Hook into queries, admin screens, and more!
*
* @since 0.1.0
*/
public function __construct()
{
// Setup plugin
$this->file = __FILE__;
$this->url = plugin_dir_url($this->file);
$this->path = plugin_dir_path($this->file);
$this->basename = plugin_basename($this->file);
$this->fancy = apply_filters('wp_fancy_term_order', true);
// Queries
add_filter('get_terms_orderby', array($this, 'get_terms_orderby'), 10, 2);
add_action('create_term', array($this, 'add_term_order'), 10, 2);
add_action('edit_term', array($this, 'add_term_order'), 10, 2);
// Get visible taxonomies
$taxonomies = $this->get_taxonomies();
// Always hook these in, for ajax actions
foreach ($taxonomies as $value) {
// Unfancy gets the column
if (false === $this->fancy) {
add_filter("manage_edit-{$value}_columns", array($this, 'add_column_header'));
add_filter("manage_{$value}_custom_column", array($this, 'add_column_value'), 10, 3);
add_filter("manage_edit-{$value}_sortable_columns", array($this, 'sortable_columns'));
}
add_action("{$value}_add_form_fields", array($this, 'term_order_add_form_field'));
add_action("{$value}_edit_form_fields", array($this, 'term_order_edit_form_field'));
}
// Ajax actions
add_action('wp_ajax_reordering_terms', array($this, 'ajax_reordering_terms'));
// Only blog admin screens
if (is_blog_admin() || doing_action('wp_ajax_inline_save_tax')) {
add_action('admin_init', array($this, 'admin_init'));
add_action('load-edit-tags.php', array($this, 'edit_tags'));
}
}
开发者ID:pathartl,项目名称:wp-term-order,代码行数:38,代码来源:wp-term-order.php
示例19: plugin_row_meta_filter
/**
* Outputs a list of active modules on SEO Ultimate's plugin page listing.
*
* @since 2.1
*/
function plugin_row_meta_filter($plugin_meta, $plugin_file)
{
if ($plugin_file == $this->plugin_basename) {
if (is_blog_admin()) {
$title = __('Active Modules: ', 'seo-ultimate');
} else {
$title = '';
}
echo $this->get_module_links_list('<p id="su-active-modules-list">' . $title, ' | ', '</p>');
}
return $plugin_meta;
}
开发者ID:fernflores0463,项目名称:RandolphTimesWeb,代码行数:17,代码来源:class.seo-ultimate.php
示例20: tc_welcome_panel
//.........这里部分代码省略.........
<p style="text-align: left"><?php
_e("The Customizr's extensions are plugins developed to extend the Customizr theme with great features. Nicely integrated with the theme's built-in options, they can be enabled/disabled safely with no side effects on your existing settings or customizations.", 'customizr');
?>
</p>
<p style="text-align: left"><?php
_e("These modules are designed to be simple to use for everyone. They are a good solution to add some creative customizations whitout needing to dive into the code.", 'customizr');
?>
</p>
<p style="text-align: left"><?php
_e("Customizr's extensions are installed and upgraded from your WordPress admin, like any other WordPress plugins. Well documented and easily extendable with hooks, they come with a dedicated support forum on themesandco.com.", 'customizr');
?>
</p>
<p style="text-align:left">
<a class="button-primary review-customizr" title="<?php
_e("Visit the extension's page", 'customizr');
?>
" href="<?php
echo TC_WEBSITE;
?>
customizr/extend/" target="_blank"><?php
_e("Visit the extension's page", 'customizr');
?>
»</a>
</p>
</div>
</div>
<div id="showcase" class="changelog">
<h3 style="text-align:right"><?php
_e('Customizr Showcase', 'customizr');
?>
</h3>
<div class="feature-section images-stagger-left">
<a class="" title="<?php
_e('Visit the
|
请发表评论