mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-10 18:37:58 +01:00
Revert [15717]; it had extra bits in it
git-svn-id: http://svn.automattic.com/wordpress/trunk@15718 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
d78d29dfc4
commit
2a7220b15a
@ -25,47 +25,42 @@ function wp_dashboard_setup() {
|
|||||||
/* Register Widgets and Controls */
|
/* Register Widgets and Controls */
|
||||||
|
|
||||||
// Right Now
|
// Right Now
|
||||||
if ( is_blog_admin() && current_user_can('edit_posts') )
|
wp_add_dashboard_widget( 'dashboard_right_now', __( 'Right Now' ), 'wp_dashboard_right_now' );
|
||||||
wp_add_dashboard_widget( 'dashboard_right_now', __( 'Right Now' ), 'wp_dashboard_right_now' );
|
|
||||||
|
|
||||||
// Recent Comments Widget
|
// Recent Comments Widget
|
||||||
if ( is_blog_admin() && current_user_can('moderate_comments') ) {
|
if ( !isset( $widget_options['dashboard_recent_comments'] ) || !isset( $widget_options['dashboard_recent_comments']['items'] ) ) {
|
||||||
if ( !isset( $widget_options['dashboard_recent_comments'] ) || !isset( $widget_options['dashboard_recent_comments']['items'] ) ) {
|
$update = true;
|
||||||
$update = true;
|
$widget_options['dashboard_recent_comments'] = array(
|
||||||
$widget_options['dashboard_recent_comments'] = array(
|
'items' => 5,
|
||||||
'items' => 5,
|
);
|
||||||
);
|
|
||||||
}
|
|
||||||
$recent_comments_title = __( 'Recent Comments' );
|
|
||||||
wp_add_dashboard_widget( 'dashboard_recent_comments', $recent_comments_title, 'wp_dashboard_recent_comments', 'wp_dashboard_recent_comments_control' );
|
|
||||||
}
|
}
|
||||||
|
$recent_comments_title = __( 'Recent Comments' );
|
||||||
|
wp_add_dashboard_widget( 'dashboard_recent_comments', $recent_comments_title, 'wp_dashboard_recent_comments', 'wp_dashboard_recent_comments_control' );
|
||||||
|
|
||||||
// Incoming Links Widget
|
// Incoming Links Widget
|
||||||
if ( is_blog_admin() && current_user_can('publish_posts') ) {
|
if ( !isset( $widget_options['dashboard_incoming_links'] ) || !isset( $widget_options['dashboard_incoming_links']['home'] ) || $widget_options['dashboard_incoming_links']['home'] != get_option('home') ) {
|
||||||
if ( !isset( $widget_options['dashboard_incoming_links'] ) || !isset( $widget_options['dashboard_incoming_links']['home'] ) || $widget_options['dashboard_incoming_links']['home'] != get_option('home') ) {
|
$update = true;
|
||||||
$update = true;
|
$num_items = isset($widget_options['dashboard_incoming_links']['items']) ? $widget_options['dashboard_incoming_links']['items'] : 10;
|
||||||
$num_items = isset($widget_options['dashboard_incoming_links']['items']) ? $widget_options['dashboard_incoming_links']['items'] : 10;
|
$widget_options['dashboard_incoming_links'] = array(
|
||||||
$widget_options['dashboard_incoming_links'] = array(
|
'home' => get_option('home'),
|
||||||
'home' => get_option('home'),
|
'link' => apply_filters( 'dashboard_incoming_links_link', 'http://blogsearch.google.com/blogsearch?scoring=d&partner=wordpress&q=link:' . trailingslashit( get_option('home') ) ),
|
||||||
'link' => apply_filters( 'dashboard_incoming_links_link', 'http://blogsearch.google.com/blogsearch?scoring=d&partner=wordpress&q=link:' . trailingslashit( get_option('home') ) ),
|
'url' => isset($widget_options['dashboard_incoming_links']['url']) ? apply_filters( 'dashboard_incoming_links_feed', $widget_options['dashboard_incoming_links']['url'] ) : apply_filters( 'dashboard_incoming_links_feed', 'http://blogsearch.google.com/blogsearch_feeds?scoring=d&ie=utf-8&num=' . $num_items . '&output=rss&partner=wordpress&q=link:' . trailingslashit( get_option('home') ) ),
|
||||||
'url' => isset($widget_options['dashboard_incoming_links']['url']) ? apply_filters( 'dashboard_incoming_links_feed', $widget_options['dashboard_incoming_links']['url'] ) : apply_filters( 'dashboard_incoming_links_feed', 'http://blogsearch.google.com/blogsearch_feeds?scoring=d&ie=utf-8&num=' . $num_items . '&output=rss&partner=wordpress&q=link:' . trailingslashit( get_option('home') ) ),
|
'items' => $num_items,
|
||||||
'items' => $num_items,
|
'show_date' => isset($widget_options['dashboard_incoming_links']['show_date']) ? $widget_options['dashboard_incoming_links']['show_date'] : false
|
||||||
'show_date' => isset($widget_options['dashboard_incoming_links']['show_date']) ? $widget_options['dashboard_incoming_links']['show_date'] : false
|
);
|
||||||
);
|
|
||||||
}
|
|
||||||
wp_add_dashboard_widget( 'dashboard_incoming_links', __( 'Incoming Links' ), 'wp_dashboard_incoming_links', 'wp_dashboard_incoming_links_control' );
|
|
||||||
}
|
}
|
||||||
|
wp_add_dashboard_widget( 'dashboard_incoming_links', __( 'Incoming Links' ), 'wp_dashboard_incoming_links', 'wp_dashboard_incoming_links_control' );
|
||||||
|
|
||||||
// WP Plugins Widget
|
// WP Plugins Widget
|
||||||
if ( is_blog_admin() && current_user_can( 'install_plugins' ) )
|
if ( current_user_can( 'install_plugins' ) )
|
||||||
wp_add_dashboard_widget( 'dashboard_plugins', __( 'Plugins' ), 'wp_dashboard_plugins' );
|
wp_add_dashboard_widget( 'dashboard_plugins', __( 'Plugins' ), 'wp_dashboard_plugins' );
|
||||||
|
|
||||||
// QuickPress Widget
|
// QuickPress Widget
|
||||||
if ( is_blog_admin() && current_user_can('edit_posts') )
|
if ( current_user_can('edit_posts') )
|
||||||
wp_add_dashboard_widget( 'dashboard_quick_press', __( 'QuickPress' ), 'wp_dashboard_quick_press' );
|
wp_add_dashboard_widget( 'dashboard_quick_press', __( 'QuickPress' ), 'wp_dashboard_quick_press' );
|
||||||
|
|
||||||
// Recent Drafts
|
// Recent Drafts
|
||||||
if ( is_blog_admin() && current_user_can('edit_posts') )
|
if ( current_user_can('edit_posts') )
|
||||||
wp_add_dashboard_widget( 'dashboard_recent_drafts', __('Recent Drafts'), 'wp_dashboard_recent_drafts' );
|
wp_add_dashboard_widget( 'dashboard_recent_drafts', __('Recent Drafts'), 'wp_dashboard_recent_drafts' );
|
||||||
|
|
||||||
// Primary feed (Dev Blog) Widget
|
// Primary feed (Dev Blog) Widget
|
||||||
|
@ -3140,14 +3140,14 @@ class WP_MS_Users_Table extends WP_List_Table {
|
|||||||
$edit_link = ( get_current_user_id() == $user->ID ) ? 'profile.php' : 'user-edit.php?user_id=' . $user->ID;
|
$edit_link = ( get_current_user_id() == $user->ID ) ? 'profile.php' : 'user-edit.php?user_id=' . $user->ID;
|
||||||
?>
|
?>
|
||||||
<td class="username column-username">
|
<td class="username column-username">
|
||||||
<?php echo $avatar; ?><strong><a href="<?php echo esc_url( self_admin_url( $edit_link ) ); ?>" class="edit"><?php echo stripslashes( $user->user_login ); ?></a><?php
|
<?php echo $avatar; ?><strong><a href="<?php echo esc_url( admin_url( $edit_link ) ); ?>" class="edit"><?php echo stripslashes( $user->user_login ); ?></a><?php
|
||||||
if ( in_array( $user->user_login, $super_admins ) )
|
if ( in_array( $user->user_login, $super_admins ) )
|
||||||
echo ' - ' . __( 'Super admin' );
|
echo ' - ' . __( 'Super admin' );
|
||||||
?></strong>
|
?></strong>
|
||||||
<br/>
|
<br/>
|
||||||
<?php
|
<?php
|
||||||
$actions = array();
|
$actions = array();
|
||||||
$actions['edit'] = '<a href="' . esc_url( self_admin_url( $edit_link ) ) . '">' . __( 'Edit' ) . '</a>';
|
$actions['edit'] = '<a href="' . esc_url( admin_url( $edit_link ) ) . '">' . __( 'Edit' ) . '</a>';
|
||||||
|
|
||||||
if ( ! in_array( $user->user_login, $super_admins ) ) {
|
if ( ! in_array( $user->user_login, $super_admins ) ) {
|
||||||
$actions['delete'] = '<a href="' . $delete = esc_url( network_admin_url( add_query_arg( '_wp_http_referer', urlencode( stripslashes( $_SERVER['REQUEST_URI'] ) ), wp_nonce_url( 'edit.php', 'deleteuser' ) . '&action=deleteuser&id=' . $user->ID ) ) ) . '" class="delete">' . __( 'Delete' ) . '</a>';
|
$actions['delete'] = '<a href="' . $delete = esc_url( network_admin_url( add_query_arg( '_wp_http_referer', urlencode( stripslashes( $_SERVER['REQUEST_URI'] ) ), wp_nonce_url( 'edit.php', 'deleteuser' ) . '&action=deleteuser&id=' . $user->ID ) ) ) . '" class="delete">' . __( 'Delete' ) . '</a>';
|
||||||
|
@ -9,8 +9,6 @@
|
|||||||
|
|
||||||
if ( is_network_admin() )
|
if ( is_network_admin() )
|
||||||
do_action('_network_admin_menu');
|
do_action('_network_admin_menu');
|
||||||
elseif ( is_user_admin() )
|
|
||||||
do_action('_user_admin_menu');
|
|
||||||
else
|
else
|
||||||
do_action('_admin_menu');
|
do_action('_admin_menu');
|
||||||
|
|
||||||
@ -91,8 +89,6 @@ unset($id, $data, $subs, $first_sub, $old_parent, $new_parent);
|
|||||||
|
|
||||||
if ( is_network_admin() )
|
if ( is_network_admin() )
|
||||||
do_action('network_admin_menu', '');
|
do_action('network_admin_menu', '');
|
||||||
elseif ( is_user_admin() )
|
|
||||||
do_action('user_admin_menu', '');
|
|
||||||
else
|
else
|
||||||
do_action('admin_menu', '');
|
do_action('admin_menu', '');
|
||||||
|
|
||||||
|
@ -502,14 +502,29 @@ function redirect_user_to_blog() {
|
|||||||
$c ++;
|
$c ++;
|
||||||
|
|
||||||
$blog = get_active_blog_for_user( get_current_user_id() );
|
$blog = get_active_blog_for_user( get_current_user_id() );
|
||||||
|
$dashboard_blog = get_dashboard_blog();
|
||||||
if ( is_object( $blog ) ) {
|
if ( is_object( $blog ) ) {
|
||||||
wp_redirect( get_admin_url( $blog->blog_id, '?c=' . $c ) ); // redirect and count to 5, "just in case"
|
wp_redirect( get_admin_url( $blog->blog_id, '?c=' . $c ) ); // redirect and count to 5, "just in case"
|
||||||
exit;
|
exit;
|
||||||
} else {
|
|
||||||
wp_redirect( user_admin_url( '?c=' . $c ) ); // redirect and count to 5, "just in case"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
If the user is a member of only 1 blog and the user's primary_blog isn't set to that blog,
|
||||||
|
then update the primary_blog record to match the user's blog
|
||||||
|
*/
|
||||||
|
$blogs = get_blogs_of_user( get_current_user_id() );
|
||||||
|
|
||||||
|
if ( !empty( $blogs ) ) {
|
||||||
|
foreach( $blogs as $blogid => $blog ) {
|
||||||
|
if ( $blogid != $dashboard_blog->blog_id && get_user_meta( get_current_user_id() , 'primary_blog', true ) == $dashboard_blog->blog_id ) {
|
||||||
|
update_user_meta( get_current_user_id(), 'primary_blog', $blogid );
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$blog = get_blog_details( get_user_meta( get_current_user_id(), 'primary_blog', true ) );
|
||||||
|
wp_redirect( get_admin_url( $blog->blog_id, '?c=' . $c ) );
|
||||||
|
exit;
|
||||||
|
}
|
||||||
wp_die( __( 'You do not have sufficient permissions to access this page.' ) );
|
wp_die( __( 'You do not have sufficient permissions to access this page.' ) );
|
||||||
}
|
}
|
||||||
add_action( 'admin_page_access_denied', 'redirect_user_to_blog', 99 );
|
add_action( 'admin_page_access_denied', 'redirect_user_to_blog', 99 );
|
||||||
|
Loading…
Reference in New Issue
Block a user