Ticket #14696: 14696.2.diff
File 14696.2.diff, 58.9 KB (added by , 14 years ago) |
---|
-
wp-login.php
572 572 </div></body></html> 573 573 <?php exit; 574 574 } 575 // If the user can't edit posts, send them to their profile. 576 if ( !$user->has_cap('edit_posts') && ( empty( $redirect_to ) || $redirect_to == 'wp-admin/' || $redirect_to == admin_url() ) ) 575 576 // If the user doesn't belong to a blog, send them to user admin. If the user can't edit posts, send them to their profile. 577 if ( is_multisite() && !get_active_blog_for_user($user->id) ) 578 $redirect_to = user_admin_url(); 579 elseif ( !is_multisite() && !$user->has_cap('read') ) 580 $redirect_to = user_admin_url(); 581 elseif ( !$user->has_cap('edit_posts') && ( empty( $redirect_to ) || $redirect_to == 'wp-admin/' || $redirect_to == admin_url() ) ) 577 582 $redirect_to = admin_url('profile.php'); 578 583 wp_safe_redirect($redirect_to); 579 584 exit(); -
wp-includes/admin-bar.php
110 110 if ( !is_object( $wp_admin_bar ) ) 111 111 return false; 112 112 113 /* Remove the global dashboard */114 if ( is_multisite() ) {115 foreach ( (array) $wp_admin_bar->user->blogs as $key => $blog ) {116 if ( get_dashboard_blog() == $blog->domain )117 unset( $wp_admin_bar->user->blogs[$key] );118 }119 }120 121 113 /* Add the 'My Dashboards' menu if the user has more than one blog. */ 122 114 if ( count( $wp_admin_bar->user->blogs ) > 1 ) { 123 115 $wp_admin_bar->add_menu( array( 'id' => 'my-blogs', 'title' => __( 'My Blogs' ), 'href' => $wp_admin_bar->user->account_domain ) ); -
wp-includes/functions.php
447 447 if ( empty($site_id) ) 448 448 $site_id = $wpdb->siteid; 449 449 450 $core_options = array('site_name', 'siteurl', 'active_sitewide_plugins', '_site_transient_timeout_theme_roots', '_site_transient_theme_roots', 'site_admins', ' dashboard_blog', 'can_compress_scripts', 'global_terms_enabled' );450 $core_options = array('site_name', 'siteurl', 'active_sitewide_plugins', '_site_transient_timeout_theme_roots', '_site_transient_theme_roots', 'site_admins', 'can_compress_scripts', 'global_terms_enabled' ); 451 451 452 452 $core_options_in = "'" . implode("', '", $core_options) . "'"; 453 453 $options = $wpdb->get_results( $wpdb->prepare("SELECT meta_key, meta_value FROM $wpdb->sitemeta WHERE meta_key IN ($core_options_in) AND site_id = %d", $site_id) ); -
wp-includes/vars.php
15 15 // On which page are we ? 16 16 if ( is_admin() ) { 17 17 // wp-admin pages are checked more carefully 18 preg_match('#/wp-admin/?(.*?)$#i', $PHP_SELF, $self_matches); 18 if ( is_network_admin() ) 19 preg_match('#/wp-admin/network/?(.*?)$#i', $PHP_SELF, $self_matches); 20 elseif ( is_user_admin() ) 21 preg_match('#/wp-admin/user/?(.*?)$#i', $PHP_SELF, $self_matches); 22 else 23 preg_match('#/wp-admin/?(.*?)$#i', $PHP_SELF, $self_matches); 19 24 $pagenow = $self_matches[1]; 20 25 $pagenow = trim($pagenow, '/'); 21 26 $pagenow = preg_replace('#\?.*?$#', '', $pagenow); -
wp-includes/load.php
621 621 } 622 622 623 623 /** 624 * Whether the current request is for a user admin screen /wp-admin/user/ 625 * 626 * Does not inform on whether the user is an admin! Use capability checks to 627 * tell if the user should be accessing a section or not. 628 * 629 * @since 3.1.0 630 * 631 * @return bool True if inside WordPress user administration pages. 632 */ 633 function is_user_admin() { 634 if ( defined( 'WP_USER_ADMIN' ) ) 635 return WP_USER_ADMIN; 636 return false; 637 } 638 639 /** 624 640 * Whether Multisite support is enabled 625 641 * 626 642 * @since 3.0.0 -
wp-includes/admin-bar/admin-bar-class.php
15 15 $this->user->blogs = get_ordered_blogs_of_user( $current_user->id ); 16 16 if ( is_multisite() ) { 17 17 $this->user->active_blog = get_active_blog_for_user( $current_user->id ); 18 $this->user->domain = ( $this->user->active_blog == 'username only' ) ? get_dashboard_blog() : trailingslashit( get_home_url( $this->user->active_blog->blog_id ) );18 $this->user->domain = empty( $this->user->active_blog ) ? user_admin_url() : trailingslashit( get_home_url( $this->user->active_blog->blog_id ) ); 19 19 $this->user->account_domain = $this->user->domain; 20 20 } else { 21 21 $this->user->active_blog = $this->user->blogs[$blog_id]; -
wp-includes/link-template.php
2130 2130 } 2131 2131 2132 2132 /** 2133 * Retrieve the url to the admin area for the current user. 2134 * 2135 * @package WordPress 2136 * @since 3.0.0 2137 * 2138 * @param string $path Optional path relative to the admin url 2139 * @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. 2140 * @return string Admin url link with optional path appended 2141 */ 2142 function user_admin_url( $path = '', $scheme = 'admin' ) { 2143 $url = network_site_url('wp-admin/user/', $scheme); 2144 2145 if ( !empty($path) && is_string($path) && strpos($path, '..') === false ) 2146 $url .= ltrim($path, '/'); 2147 2148 return apply_filters('user_admin_url', $url, $path); 2149 } 2150 2151 /** 2133 2152 * Retrieve the url to the admin area for either the current blog or the network depending on context. 2134 2153 * 2135 2154 * @package WordPress … … 2142 2161 function self_admin_url($path = '', $scheme = 'admin') { 2143 2162 if ( is_network_admin() ) 2144 2163 return network_admin_url($path, $scheme); 2164 elseif ( is_user_admin() ) 2165 return user_admin_url($path, $scheme); 2145 2166 else 2146 2167 return admin_url($path, $scheme); 2147 2168 } -
wp-includes/capabilities.php
737 737 738 738 // Must have ALL requested caps 739 739 $capabilities = apply_filters( 'user_has_cap', $this->allcaps, $caps, $args ); 740 $capabilities['exist'] = true; // Everyone is allowed to exist 740 741 foreach ( (array) $caps as $cap ) { 741 742 //echo "Checking cap $cap<br />"; 742 743 if ( empty( $capabilities[$cap] ) || !$capabilities[$cap] ) -
wp-includes/pluggable.php
81 81 return; 82 82 83 83 if ( ! $user = wp_validate_auth_cookie() ) { 84 if ( is_ admin() || empty($_COOKIE[LOGGED_IN_COOKIE]) || !$user = wp_validate_auth_cookie($_COOKIE[LOGGED_IN_COOKIE], 'logged_in') ) {84 if ( is_blog_admin() || is_network_admin() || empty($_COOKIE[LOGGED_IN_COOKIE]) || !$user = wp_validate_auth_cookie($_COOKIE[LOGGED_IN_COOKIE], 'logged_in') ) { 85 85 wp_set_current_user(0); 86 86 return false; 87 87 } … … 775 775 } 776 776 } 777 777 778 if ( $user_id = wp_validate_auth_cookie( '', apply_filters( 'auth_redirect_scheme', '' ) ) ) { 778 if ( is_user_admin() ) 779 $scheme = 'logged_in'; 780 else 781 $scheme = apply_filters( 'auth_redirect_scheme', '' ); 782 783 if ( $user_id = wp_validate_auth_cookie( '', $scheme) ) { 779 784 do_action('auth_redirect', $user_id); 780 785 781 786 // If the user wants ssl but the session is not ssl, redirect. -
wp-includes/ms-functions.php
59 59 * 60 60 * @since MU 1.0 61 61 * @uses get_blogs_of_user() 62 * @uses get_dashboard_blog()63 62 * @uses add_user_to_blog() 64 63 * @uses update_user_meta() 65 64 * @uses wp_cache_delete() … … 72 71 function get_active_blog_for_user( $user_id ) { 73 72 global $wpdb; 74 73 $blogs = get_blogs_of_user( $user_id ); 75 if ( empty( $blogs ) ) { 76 $details = get_dashboard_blog(); 77 add_user_to_blog( $details->blog_id, $user_id, 'subscriber' ); 78 update_user_meta( $user_id, 'primary_blog', $details->blog_id ); 79 wp_cache_delete( $user_id, 'users' ); 80 return $details; 81 } 74 if ( empty( $blogs ) ) 75 return null; 82 76 77 if ( !is_multisite() ) 78 return $blogs[$wpdb->blogid]; 79 83 80 $primary_blog = get_user_meta( $user_id, 'primary_blog', true ); 84 $ details = get_dashboard_blog();81 $first_blog = current($blogs); 85 82 if ( $primary_blog ) { 86 if ( isset( $blogs[ $primary_blog ] ) == false) {87 add_user_to_blog( $ details->blog_id, $user_id, 'subscriber' );88 update_user_meta( $user_id, 'primary_blog', $ details->blog_id );89 wp_cache_delete( $user_id, 'users' );83 if ( ! isset( $blogs[ $primary_blog ] ) ) { 84 add_user_to_blog( $first_blog->blog_id, $user_id, 'subscriber' ); 85 update_user_meta( $user_id, 'primary_blog', $first_blog->blog_id ); 86 $primary = $first_blog; 90 87 } else { 91 $ details= get_blog_details( $primary_blog );88 $primary = get_blog_details( $primary_blog ); 92 89 } 93 90 } else { 94 add_user_to_blog( $details->blog_id, $user_id, 'subscriber' ); // Add subscriber permission for dashboard blog 95 update_user_meta( $user_id, 'primary_blog', $details->blog_id ); 91 add_user_to_blog( $first_blog->blog_id, $user_id, 'subscriber' ); 92 update_user_meta( $user_id, 'primary_blog', $first_blog->blog_id ); 93 $primary = $first_blog; 96 94 } 97 95 98 if ( ( is_object( $details ) == false ) || ( is_object( $details ) && $details->archived == 1 || $details->spam == 1 || $details->deleted == 1 ) ) {96 if ( ( ! is_object( $primary ) ) || ( is_object( $primary ) && $primary->archived == 1 || $primary->spam == 1 || $primary->deleted == 1 ) ) { 99 97 $blogs = get_blogs_of_user( $user_id, true ); // if a user's primary blog is shut down, check their other blogs. 100 98 $ret = false; 101 99 if ( is_array( $blogs ) && count( $blogs ) > 0 ) { … … 105 103 $details = get_blog_details( $blog_id ); 106 104 if ( is_object( $details ) && $details->archived == 0 && $details->spam == 0 && $details->deleted == 0 ) { 107 105 $ret = $blog; 108 $changed = false; 109 if ( get_user_meta( $user_id , 'primary_blog', true ) != $blog_id ) { 106 if ( get_user_meta( $user_id , 'primary_blog', true ) != $blog_id ) 110 107 update_user_meta( $user_id, 'primary_blog', $blog_id ); 111 $changed = true; 112 } 113 if ( !get_user_meta($user_id , 'source_domain', true) ) { 108 if ( !get_user_meta($user_id , 'source_domain', true) ) 114 109 update_user_meta( $user_id, 'source_domain', $blog->domain ); 115 $changed = true;116 }117 if ( $changed )118 wp_cache_delete( $user_id, 'users' );119 110 break; 120 111 } 121 112 } 122 113 } else { 123 // Should never get here 124 $dashboard_blog = get_dashboard_blog(); 125 add_user_to_blog( $dashboard_blog->blog_id, $user_id, 'subscriber' ); // Add subscriber permission for dashboard blog 126 update_user_meta( $user_id, 'primary_blog', $dashboard_blog->blog_id ); 127 return $dashboard_blog; 114 return null; 128 115 } 129 116 return $ret; 130 117 } else { 131 return $ details;118 return $primary; 132 119 } 133 120 } 134 121 … … 840 827 return new WP_Error( 'user_already_exists', __( 'That username is already activated.' ), $signup); 841 828 842 829 wpmu_welcome_user_notification($user_id, $password, $meta); 843 $user_site = get_site_option( 'dashboard_blog', $current_site->blog_id );844 830 845 if ( $user_site == false )846 add_user_to_blog( '1', $user_id, get_site_option( 'default_user_role', 'subscriber' ) );847 else848 add_user_to_blog( $user_site, $user_id, get_site_option( 'default_user_role', 'subscriber' ) );849 850 831 add_new_user_to_blog( $user_id, $user_email, $meta ); 851 832 do_action('wpmu_activate_user', $user_id, $password, $meta); 852 833 return array('user_id' => $user_id, 'password' => $password, 'meta' => $meta); … … 926 907 add_option( 'WPLANG', get_site_option( 'WPLANG' ) ); 927 908 update_option( 'blog_public', (int)$meta['public'] ); 928 909 929 if ( !is_super_admin() && get_user_meta( $user_id, 'primary_blog', true ) == get_site_option( 'dashboard_blog', 1) )910 if ( !is_super_admin() && ! get_user_meta( $user_id, 'primary_blog', true ) ) 930 911 update_user_meta( $user_id, 'primary_blog', $blog_id ); 931 912 932 913 restore_current_blog(); … … 1460 1441 } 1461 1442 add_action('update_option_blog_public', 'update_blog_public', 10, 2); 1462 1443 1463 /* Redirect all hits to "dashboard" blog to wp-admin/ Dashboard. */1464 function redirect_mu_dashboard() {1465 global $current_site, $current_blog;1466 1467 $dashboard_blog = get_dashboard_blog();1468 if ( $current_blog->blog_id == $dashboard_blog->blog_id && $dashboard_blog->blog_id != $current_site->blog_id ) {1469 $protocol = ( is_ssl() ? 'https://' : 'http://' );1470 wp_redirect( $protocol . $dashboard_blog->domain . trailingslashit( $dashboard_blog->path ) . 'wp-admin/' );1471 die();1472 }1473 }1474 add_action( 'template_redirect', 'redirect_mu_dashboard' );1475 1476 1444 function get_dashboard_blog() { 1477 1445 if ( $blog = get_site_option( 'dashboard_blog' ) ) 1478 1446 return get_blog_details( $blog ); -
wp-admin/users.php
18 18 $title = __('Users'); 19 19 $parent_file = 'users.php'; 20 20 21 add_screen_option( 'per_page', array('label' => _x( 'Users', 'users per page (screen options)' )) ); 22 21 23 // contextual help - choose Help on the top right of admin panel to preview this. 22 24 add_contextual_help($current_screen, 23 25 '<p>' . __('This screen lists all the existing users for your site. Each user has one of five defined roles as set by the site admin: Site Administrator, Editor, Author, Contributor, or Subscriber. Users with roles other than Administrator will see fewer options when they are logged in, based on their role.') . '</p>' . -
wp-admin/edit-comments.php
105 105 else 106 106 $title = __('Comments'); 107 107 108 add_screen_option( 'per_page', array('label' => _x( 'Comments', 'comments per page (screen options)' )) ); 109 108 110 add_contextual_help( $current_screen, '<p>' . __('You can manage comments made on your site similar to the way you manage Posts and other content. This screen is customizable in the same ways as other management screens, and you can act on comments using the on-hover action links or the Bulk Actions.') . '</p>' . 109 111 '<p>' . __('A yellow row means the comment is waiting for you to moderate it.') . '</p>' . 110 112 '<p>' . __('In the Author column, in addition to the author’s name, email address, and blog URL, the commenter’s IP address is shown. Clicking on this link will show you all the comments made from this IP address.') . '</p>' . -
wp-admin/includes/menu.php
9 9 10 10 if ( is_network_admin() ) 11 11 do_action('_network_admin_menu'); 12 elseif ( is_user_admin() ) 13 do_action('_user_admin_menu'); 12 14 else 13 15 do_action('_admin_menu'); 14 16 … … 89 91 90 92 if ( is_network_admin() ) 91 93 do_action('network_admin_menu', ''); 94 elseif ( is_user_admin() ) 95 do_action('user_admin_menu', ''); 92 96 else 93 97 do_action('admin_menu', ''); 94 98 -
wp-admin/includes/default-list-tables.php
2719 2719 2720 2720 function WP_Sites_Table() { 2721 2721 parent::WP_List_Table( array( 2722 'screen' => ' ms-sites',2722 'screen' => 'sites-network', 2723 2723 'plural' => 'sites', 2724 2724 ) ); 2725 2725 } … … 2734 2734 2735 2735 $mode = ( empty( $_REQUEST['mode'] ) ) ? 'list' : $_REQUEST['mode']; 2736 2736 2737 $per_page = $this->get_items_per_page( ' ms_sites_per_page' );2737 $per_page = $this->get_items_per_page( 'sites_network_per_page' ); 2738 2738 2739 2739 $pagenum = $this->get_pagenum(); 2740 2740 … … 3007 3007 3008 3008 function WP_MS_Users_Table() { 3009 3009 parent::WP_List_Table( array( 3010 'screen' => ' ms-users',3010 'screen' => 'users-network', 3011 3011 ) ); 3012 3012 } 3013 3013 … … 3024 3024 3025 3025 $usersearch = isset( $_REQUEST['s'] ) ? $_REQUEST['s'] : ''; 3026 3026 3027 $users_per_page = $this->get_items_per_page( ' ms_users_per_page' );3027 $users_per_page = $this->get_items_per_page( 'users_network_per_page' ); 3028 3028 3029 3029 $paged = $this->get_pagenum(); 3030 3030 -
wp-admin/includes/dashboard.php
16 16 function wp_dashboard_setup() { 17 17 global $wp_registered_widgets, $wp_registered_widget_controls, $wp_dashboard_control_callbacks; 18 18 $wp_dashboard_control_callbacks = array(); 19 $screen = get_current_screen(); 19 20 20 21 $update = false; 21 22 $widget_options = get_option( 'dashboard_widget_options' ); … … 25 26 /* Register Widgets and Controls */ 26 27 27 28 // Right Now 28 wp_add_dashboard_widget( 'dashboard_right_now', __( 'Right Now' ), 'wp_dashboard_right_now' ); 29 if ( is_blog_admin() && current_user_can('edit_posts') ) 30 wp_add_dashboard_widget( 'dashboard_right_now', __( 'Right Now' ), 'wp_dashboard_right_now' ); 29 31 30 32 // Recent Comments Widget 31 if ( !isset( $widget_options['dashboard_recent_comments'] ) || !isset( $widget_options['dashboard_recent_comments']['items'] ) ) { 32 $update = true; 33 $widget_options['dashboard_recent_comments'] = array( 34 'items' => 5, 35 ); 33 if ( is_blog_admin() && current_user_can('moderate_comments') ) { 34 if ( !isset( $widget_options['dashboard_recent_comments'] ) || !isset( $widget_options['dashboard_recent_comments']['items'] ) ) { 35 $update = true; 36 $widget_options['dashboard_recent_comments'] = array( 37 'items' => 5, 38 ); 39 } 40 $recent_comments_title = __( 'Recent Comments' ); 41 wp_add_dashboard_widget( 'dashboard_recent_comments', $recent_comments_title, 'wp_dashboard_recent_comments', 'wp_dashboard_recent_comments_control' ); 36 42 } 37 $recent_comments_title = __( 'Recent Comments' );38 wp_add_dashboard_widget( 'dashboard_recent_comments', $recent_comments_title, 'wp_dashboard_recent_comments', 'wp_dashboard_recent_comments_control' );39 43 40 44 // Incoming Links Widget 41 if ( !isset( $widget_options['dashboard_incoming_links'] ) || !isset( $widget_options['dashboard_incoming_links']['home'] ) || $widget_options['dashboard_incoming_links']['home'] != get_option('home') ) { 42 $update = true; 43 $num_items = isset($widget_options['dashboard_incoming_links']['items']) ? $widget_options['dashboard_incoming_links']['items'] : 10; 44 $widget_options['dashboard_incoming_links'] = array( 45 'home' => get_option('home'), 46 'link' => apply_filters( 'dashboard_incoming_links_link', 'http://blogsearch.google.com/blogsearch?scoring=d&partner=wordpress&q=link:' . trailingslashit( get_option('home') ) ), 47 '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') ) ), 48 'items' => $num_items, 49 'show_date' => isset($widget_options['dashboard_incoming_links']['show_date']) ? $widget_options['dashboard_incoming_links']['show_date'] : false 50 ); 45 if ( is_blog_admin() && current_user_can('publish_posts') ) { 46 if ( !isset( $widget_options['dashboard_incoming_links'] ) || !isset( $widget_options['dashboard_incoming_links']['home'] ) || $widget_options['dashboard_incoming_links']['home'] != get_option('home') ) { 47 $update = true; 48 $num_items = isset($widget_options['dashboard_incoming_links']['items']) ? $widget_options['dashboard_incoming_links']['items'] : 10; 49 $widget_options['dashboard_incoming_links'] = array( 50 'home' => get_option('home'), 51 'link' => apply_filters( 'dashboard_incoming_links_link', 'http://blogsearch.google.com/blogsearch?scoring=d&partner=wordpress&q=link:' . trailingslashit( get_option('home') ) ), 52 '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') ) ), 53 'items' => $num_items, 54 'show_date' => isset($widget_options['dashboard_incoming_links']['show_date']) ? $widget_options['dashboard_incoming_links']['show_date'] : false 55 ); 56 } 57 wp_add_dashboard_widget( 'dashboard_incoming_links', __( 'Incoming Links' ), 'wp_dashboard_incoming_links', 'wp_dashboard_incoming_links_control' ); 51 58 } 52 wp_add_dashboard_widget( 'dashboard_incoming_links', __( 'Incoming Links' ), 'wp_dashboard_incoming_links', 'wp_dashboard_incoming_links_control' );53 59 54 60 // WP Plugins Widget 55 if ( current_user_can( 'install_plugins' ) )61 if ( is_blog_admin() && current_user_can( 'install_plugins' ) ) 56 62 wp_add_dashboard_widget( 'dashboard_plugins', __( 'Plugins' ), 'wp_dashboard_plugins' ); 57 63 58 64 // QuickPress Widget 59 if ( current_user_can('edit_posts') )65 if ( is_blog_admin() && current_user_can('edit_posts') ) 60 66 wp_add_dashboard_widget( 'dashboard_quick_press', __( 'QuickPress' ), 'wp_dashboard_quick_press' ); 61 67 62 68 // Recent Drafts 63 if ( current_user_can('edit_posts') )69 if ( is_blog_admin() && current_user_can('edit_posts') ) 64 70 wp_add_dashboard_widget( 'dashboard_recent_drafts', __('Recent Drafts'), 'wp_dashboard_recent_drafts' ); 65 71 66 72 // Primary feed (Dev Blog) Widget … … 115 121 if ( $update ) 116 122 update_option( 'dashboard_widget_options', $widget_options ); 117 123 118 do_action('do_meta_boxes', 'dashboard', 'normal', '');119 do_action('do_meta_boxes', 'dashboard', 'side', '');124 do_action('do_meta_boxes', $screen->id, 'normal', ''); 125 do_action('do_meta_boxes', $screen->id, 'side', ''); 120 126 } 121 127 122 128 function wp_add_dashboard_widget( $widget_id, $widget_name, $callback, $control_callback = null ) { 129 $screen = get_current_screen(); 123 130 global $wp_dashboard_control_callbacks; 124 131 if ( $control_callback && current_user_can( 'edit_dashboard' ) && is_callable( $control_callback ) ) { 125 132 $wp_dashboard_control_callbacks[$widget_id] = $control_callback; 126 133 if ( isset( $_GET['edit'] ) && $widget_id == $_GET['edit'] ) { 127 134 list($url) = explode( '#', add_query_arg( 'edit', false ), 2 ); 128 135 $widget_name .= ' <span class="postbox-title-action"><a href="' . esc_url( $url ) . '">' . __( 'Cancel' ) . '</a></span>'; 129 add_meta_box( $widget_id, $widget_name, '_wp_dashboard_control_callback', 'dashboard', 'normal', 'core' );136 add_meta_box( $widget_id, $widget_name, '_wp_dashboard_control_callback', $screen->id, 'normal', 'core' ); 130 137 return; 131 138 } 132 139 list($url) = explode( '#', add_query_arg( 'edit', $widget_id ), 2 ); 133 140 $widget_name .= ' <span class="postbox-title-action"><a href="' . esc_url( "$url#$widget_id" ) . '" class="edit-box open-box">' . __( 'Configure' ) . '</a></span>'; 134 141 } 135 $side_widgets = array('dashboard_quick_press', 'dashboard_recent_drafts', 'dashboard_primary', 'dashboard_secondary'); 142 if ( is_user_admin() ) 143 $side_widgets = array(); 144 else 145 $side_widgets = array('dashboard_quick_press', 'dashboard_recent_drafts', 'dashboard_primary', 'dashboard_secondary'); 136 146 $location = 'normal'; 137 147 if ( in_array($widget_id, $side_widgets) ) 138 148 $location = 'side'; 139 add_meta_box( $widget_id, $widget_name , $callback, 'dashboard', $location, 'core' );149 add_meta_box( $widget_id, $widget_name , $callback, $screen->id, $location, 'core' ); 140 150 } 141 151 142 152 function _wp_dashboard_control_callback( $dashboard, $meta_box ) { … … 155 165 function wp_dashboard() { 156 166 global $screen_layout_columns; 157 167 168 $screen = get_current_screen(); 169 158 170 $hide2 = $hide3 = $hide4 = ''; 159 171 switch ( $screen_layout_columns ) { 160 172 case 4: … … 176 188 <div id="dashboard-widgets" class="metabox-holder"> 177 189 <?php 178 190 echo "\t<div class='postbox-container' style='$width'>\n"; 179 do_meta_boxes( 'dashboard', 'normal', '' );191 do_meta_boxes( $screen->id, 'normal', '' ); 180 192 181 193 echo "\t</div><div class='postbox-container' style='{$hide2}$width'>\n"; 182 do_meta_boxes( 'dashboard', 'side', '' );194 do_meta_boxes( $screen->id, 'side', '' ); 183 195 184 196 echo "\t</div><div class='postbox-container' style='{$hide3}$width'>\n"; 185 do_meta_boxes( 'dashboard', 'column3', '' );197 do_meta_boxes( $screen->id, 'column3', '' ); 186 198 187 199 echo "\t</div><div class='postbox-container' style='{$hide4}$width'>\n"; 188 do_meta_boxes( 'dashboard', 'column4', '' );200 do_meta_boxes( $screen->id, 'column4', '' ); 189 201 ?> 190 202 </div></div> 191 203 -
wp-admin/includes/misc.php
343 343 344 344 switch ( $map_option ) { 345 345 case 'edit_per_page': 346 case ' ms_sites_per_page':346 case 'sites_network_per_page': 347 347 case 'users_per_page': 348 case ' ms_users_per_page':348 case 'users_network_per_page': 349 349 case 'edit_comments_per_page': 350 350 case 'upload_per_page': 351 351 case 'edit_tags_per_page': -
wp-admin/includes/template.php
1390 1390 if ( is_string($screen) ) 1391 1391 $screen = convert_to_screen($screen); 1392 1392 1393 if ( $screen->is_user ) 1394 return; 1395 1393 1396 if ( isset($screen->post_type) ) { 1394 1397 $post_type_object = get_post_type_object($screen->post_type); 1395 1398 if ( 'add' != $screen->action ) … … 1635 1638 } 1636 1639 1637 1640 function screen_meta($screen) { 1638 global $wp_meta_boxes, $_wp_contextual_help, $wp_list_table ;1641 global $wp_meta_boxes, $_wp_contextual_help, $wp_list_table, $wp_current_screen_options; 1639 1642 1640 1643 if ( is_string($screen) ) 1641 1644 $screen = convert_to_screen($screen); … … 1669 1672 $show_screen = true; 1670 1673 break; 1671 1674 } 1672 if ( ! empty( $settings ) )1675 if ( ! empty( $settings ) ) 1673 1676 $show_screen = true; 1674 1677 1678 if ( !empty($wp_current_screen_options) ) 1679 $show_screen = true; 1680 1675 1681 ?> 1676 1682 <div id="screen-meta"> 1677 1683 <?php if ( $show_screen ) : ?> … … 1796 1802 } 1797 1803 1798 1804 function screen_layout($screen) { 1799 global $screen_layout_columns ;1805 global $screen_layout_columns, $wp_current_screen_options; 1800 1806 1801 1807 if ( is_string($screen) ) 1802 1808 $screen = convert_to_screen($screen); 1803 1809 1804 $columns = array('dashboard' => 4, 'link' => 2); 1810 // Back compat for plugins using the filter instead of add_screen_option() 1811 $columns = apply_filters('screen_layout_columns', array(), $screen->id, $screen); 1812 if ( !empty($columns) && isset($columns[$screen->id]) ) 1813 add_screen_option('layout_columns', array('max' => $columns[$screen->id]) ); 1805 1814 1806 // Add custom post types 1807 foreach ( get_post_types( array('show_ui' => true) ) as $post_type ) 1808 $columns[$post_type] = 2; 1809 1810 $columns = apply_filters('screen_layout_columns', $columns, $screen->id, $screen); 1811 1812 if ( !isset($columns[$screen->id]) ) { 1815 if ( !isset($wp_current_screen_options['layout_columns']) ) { 1813 1816 $screen_layout_columns = 0; 1814 1817 return ''; 1815 1818 } 1816 1819 1817 1820 $screen_layout_columns = get_user_option("screen_layout_$screen->id"); 1818 $num = $ columns[$screen->id];1821 $num = $wp_current_screen_options['layout_columns']['max']; 1819 1822 1820 if ( ! $screen_layout_columns ) 1823 if ( ! $screen_layout_columns ) { 1824 if ( isset($wp_current_screen_options['layout_columns']['default']) ) 1825 $screen_layout_columns = $wp_current_screen_options['layout_columns']['default']; 1826 else 1821 1827 $screen_layout_columns = 2; 1828 } 1822 1829 1823 1830 $i = 1; 1824 1831 $return = '<h5>' . __('Screen Layout') . "</h5>\n<div class='columns-prefs'>" . __('Number of Columns:') . "\n"; … … 1830 1837 return $return; 1831 1838 } 1832 1839 1840 /** 1841 * Register and configure an admin screen option 1842 * 1843 * @since 3.1.0 1844 * 1845 * @param string $option An option name. 1846 * @param mixed $args Option dependent arguments 1847 * @return void 1848 */ 1849 function add_screen_option( $option, $args = array() ) { 1850 global $wp_current_screen_options; 1851 1852 if ( !isset($wp_current_screen_options) ) 1853 $wp_current_screen_options = array(); 1854 1855 $wp_current_screen_options[$option] = $args; 1856 } 1857 1833 1858 function screen_options($screen) { 1859 global $wp_current_screen_options; 1860 1834 1861 if ( is_string($screen) ) 1835 1862 $screen = convert_to_screen($screen); 1836 1863 1837 switch ( $screen->base ) { 1838 case 'edit': 1839 case 'edit-pages': 1840 $post_type = 'post'; 1841 if ( isset($_GET['post_type']) && in_array( $_GET['post_type'], get_post_types( array( 'show_ui' => true ) ) ) ) 1842 $post_type = $_GET['post_type']; 1843 $post_type_object = get_post_type_object($post_type); 1844 $per_page_label = $post_type_object->labels->name; 1845 break; 1846 case 'ms-sites': 1847 $per_page_label = _x( 'Sites', 'sites per page (screen options)' ); 1848 break; 1849 case 'users': 1850 case 'ms-users': 1851 $per_page_label = _x( 'Users', 'users per page (screen options)' ); 1852 break; 1853 case 'edit-comments': 1854 $per_page_label = _x( 'Comments', 'comments per page (screen options)' ); 1855 break; 1856 case 'upload': 1857 $per_page_label = _x( 'Media items', 'items per page (screen options)' ); 1858 break; 1859 case 'edit-tags': 1860 global $tax; 1861 $per_page_label = $tax->labels->name; 1862 break; 1863 case 'plugins': 1864 $per_page_label = _x( 'Plugins', 'plugins per page (screen options)' ); 1865 break; 1866 default: 1867 return ''; 1868 } 1864 if ( !isset($wp_current_screen_options['per_page']) ) 1865 return ''; 1869 1866 1870 $ option = str_replace( '-', '_', "{$screen->id}_per_page" );1871 if ( 'edit_tags_per_page' == $option ) { 1872 if ( 'category' == $tax->name )1873 $option = 'categories_per_page';1874 elseif ( 'post_tag' != $tax->name )1875 $option = 'edit_' . $tax->name . '_per_page';1867 $per_page_label = $wp_current_screen_options['per_page']['label']; 1868 1869 if ( empty($wp_current_screen_options['per_page']['option']) ) { 1870 $option = str_replace( '-', '_', "{$screen->id}_per_page" ); 1871 } else { 1872 $option = $wp_current_screen_options['per_page']['option']; 1876 1873 } 1877 1874 1878 1875 $per_page = (int) get_user_option( $option ); 1879 1876 if ( empty( $per_page ) || $per_page < 1 ) { 1880 if ( 'plugins' == $screen->id)1881 $per_page = 999;1877 if ( isset($wp_current_screen_options['per_page']['default']) ) 1878 $per_page = $wp_current_screen_options['per_page']['default']; 1882 1879 else 1883 1880 $per_page = 20; 1884 1881 } … … 1998 1995 } 1999 1996 2000 1997 /** 1998 * Get the current screen object 1999 * 2000 * @since 3.1.0 2001 * 2002 * @return object Current screen object 2003 */ 2004 function get_current_screen() { 2005 global $current_screen; 2006 2007 if ( !isset($current_screen) ) 2008 return null; 2009 2010 return $current_screen; 2011 } 2012 2013 /** 2001 2014 * Set the current screen object 2002 2015 * 2003 2016 * @since 3.0.0 … … 2060 2073 } 2061 2074 2062 2075 $current_screen->is_network = is_network_admin() ? true : false; 2076 $current_screen->is_user = is_user_admin() ? true : false; 2077 2078 if ( $current_screen->is_network ) { 2079 $current_screen->base .= '-network'; 2080 $current_screen->id .= '-network'; 2081 } elseif ( $current_screen->is_user ) { 2082 $current_screen->base .= '-user'; 2083 $current_screen->id .= '-user'; 2084 } 2063 2085 2064 2086 $current_screen = apply_filters('current_screen', $current_screen); 2065 2087 } -
wp-admin/includes/ms.php
502 502 $c ++; 503 503 504 504 $blog = get_active_blog_for_user( get_current_user_id() ); 505 $dashboard_blog = get_dashboard_blog(); 505 506 506 if ( is_object( $blog ) ) { 507 507 wp_redirect( get_admin_url( $blog->blog_id, '?c=' . $c ) ); // redirect and count to 5, "just in case" 508 508 exit; 509 } else { 510 wp_redirect( user_admin_url( '?c=' . $c ) ); // redirect and count to 5, "just in case" 509 511 } 510 512 511 /*512 If the user is a member of only 1 blog and the user's primary_blog isn't set to that blog,513 then update the primary_blog record to match the user's blog514 */515 $blogs = get_blogs_of_user( get_current_user_id() );516 517 if ( !empty( $blogs ) ) {518 foreach( $blogs as $blogid => $blog ) {519 if ( $blogid != $dashboard_blog->blog_id && get_user_meta( get_current_user_id() , 'primary_blog', true ) == $dashboard_blog->blog_id ) {520 update_user_meta( get_current_user_id(), 'primary_blog', $blogid );521 continue;522 }523 }524 $blog = get_blog_details( get_user_meta( get_current_user_id(), 'primary_blog', true ) );525 wp_redirect( get_admin_url( $blog->blog_id, '?c=' . $c ) );526 exit;527 }528 513 wp_die( __( 'You do not have sufficient permissions to access this page.' ) ); 529 514 } 530 515 add_action( 'admin_page_access_denied', 'redirect_user_to_blog', 99 ); -
wp-admin/edit-tags.php
22 22 $submenu_file = "edit-tags.php?taxonomy=$taxonomy"; 23 23 } 24 24 25 add_screen_option( 'per_page', array('label' => $title, 'default' => 20, 'option' => 'edit_' . $tax->name . '_per_page') ); 26 25 27 switch ( $wp_list_table->current_action() ) { 26 28 27 29 case 'add-tag': -
wp-admin/js/dashboard.js
1 var ajaxWidgets,ajaxPopulateWidgets,quickPressLoad;jQuery(document).ready(function(a){ajaxWidgets=["dashboard_incoming_links","dashboard_primary","dashboard_secondary","dashboard_plugins","dashboard_quick_press"];ajaxPopulateWidgets=function(b){show=function(g,c){var f,d=a("#"+g+" div.inside:visible").find(".widget-loading");if(d.length){f=d.parent();setTimeout(function(){f.load("index-extra.php?jax="+g,"",function(){f.hide().slideDown("normal",function(){a(this).css("display","");if("dashboard_plugins"==g&&a.isFunction(tb_init)){tb_init("#dashboard_plugins a.thickbox")}if("dashboard_quick_press"==g&&a.isFunction(tb_init)){tb_init("#dashboard_quick_press a.thickbox");quickPressLoad()}})})},c*500)}};if(b){b=b.toString();if(a.inArray(b,ajaxWidgets)!=-1){show(b,0)}}else{a.each(ajaxWidgets,function(c){show(this,c)})}};ajaxPopulateWidgets();postboxes.add_postbox_toggles( "dashboard",{pbshow:ajaxPopulateWidgets});quickPressLoad=function(){var b=a("#quickpost-action"),c;c=a("#quick-press").submit(function(){a("#dashboard_quick_press #publishing-action img.waiting").css("visibility","visible");a('#quick-press .submit input[type="submit"], #quick-press .submit input[type="reset"]').attr("disabled","disabled");if("post"==b.val()){b.val("post-quickpress-publish")}a("#dashboard_quick_press div.inside").load(c.attr("action"),c.serializeArray(),function(){a("#dashboard_quick_press #publishing-action img.waiting").css("visibility","hidden");a('#quick-press .submit input[type="submit"], #quick-press .submit input[type="reset"]').attr("disabled","");a("#dashboard_quick_press ul").next("p").remove();a("#dashboard_quick_press ul").find("li").each(function(){a("#dashboard_recent_drafts ul").prepend(this)}).end().remove();tb_init("a.thickbox");quickPressLoad()});return false});a("#publish").click(function(){b.val("post-quickpress-publish")})}});2 No newline at end of file 1 var ajaxWidgets,ajaxPopulateWidgets,quickPressLoad;jQuery(document).ready(function(a){ajaxWidgets=["dashboard_incoming_links","dashboard_primary","dashboard_secondary","dashboard_plugins","dashboard_quick_press"];ajaxPopulateWidgets=function(b){show=function(g,c){var f,d=a("#"+g+" div.inside:visible").find(".widget-loading");if(d.length){f=d.parent();setTimeout(function(){f.load("index-extra.php?jax="+g,"",function(){f.hide().slideDown("normal",function(){a(this).css("display","");if("dashboard_plugins"==g&&a.isFunction(tb_init)){tb_init("#dashboard_plugins a.thickbox")}if("dashboard_quick_press"==g&&a.isFunction(tb_init)){tb_init("#dashboard_quick_press a.thickbox");quickPressLoad()}})})},c*500)}};if(b){b=b.toString();if(a.inArray(b,ajaxWidgets)!=-1){show(b,0)}}else{a.each(ajaxWidgets,function(c){show(this,c)})}};ajaxPopulateWidgets();postboxes.add_postbox_toggles(pagenow,{pbshow:ajaxPopulateWidgets});quickPressLoad=function(){var b=a("#quickpost-action"),c;c=a("#quick-press").submit(function(){a("#dashboard_quick_press #publishing-action img.waiting").css("visibility","visible");a('#quick-press .submit input[type="submit"], #quick-press .submit input[type="reset"]').attr("disabled","disabled");if("post"==b.val()){b.val("post-quickpress-publish")}a("#dashboard_quick_press div.inside").load(c.attr("action"),c.serializeArray(),function(){a("#dashboard_quick_press #publishing-action img.waiting").css("visibility","hidden");a('#quick-press .submit input[type="submit"], #quick-press .submit input[type="reset"]').attr("disabled","");a("#dashboard_quick_press ul").next("p").remove();a("#dashboard_quick_press ul").find("li").each(function(){a("#dashboard_recent_drafts ul").prepend(this)}).end().remove();tb_init("a.thickbox");quickPressLoad()});return false});a("#publish").click(function(){b.val("post-quickpress-publish")})}}); 2 No newline at end of file -
wp-admin/js/dashboard.dev.js
42 42 }; 43 43 ajaxPopulateWidgets(); 44 44 45 postboxes.add_postbox_toggles( 'dashboard', { pbshow: ajaxPopulateWidgets } );45 postboxes.add_postbox_toggles(pagenow, { pbshow: ajaxPopulateWidgets } ); 46 46 47 47 /* QuickPress */ 48 48 quickPressLoad = function() { -
wp-admin/admin.php
11 11 * 12 12 * @since unknown 13 13 */ 14 if ( ! defined('WP_ADMIN') )14 if ( ! defined('WP_ADMIN') ) 15 15 define('WP_ADMIN', TRUE); 16 16 17 if ( ! defined('WP_NETWORK_ADMIN') ) {17 if ( ! defined('WP_NETWORK_ADMIN') ) 18 18 define('WP_NETWORK_ADMIN', FALSE); 19 20 if ( ! defined('WP_USER_ADMIN') ) 21 define('WP_USER_ADMIN', FALSE); 22 23 if ( ! WP_NETWORK_ADMIN && ! WP_USER_ADMIN ) { 19 24 define('WP_BLOG_ADMIN', TRUE); 20 25 } 21 26 … … 97 102 98 103 if ( WP_NETWORK_ADMIN ) 99 104 require(ABSPATH . 'wp-admin/network/menu.php'); 105 elseif ( WP_USER_ADMIN ) 106 require(ABSPATH . 'wp-admin/user/menu.php'); 100 107 else 101 108 require(ABSPATH . 'wp-admin/menu.php'); 102 109 -
wp-admin/index.php
24 24 $title = __('Dashboard'); 25 25 $parent_file = 'index.php'; 26 26 27 if ( is_user_admin() ) 28 add_screen_option('layout_columns', array('max' => 4, 'default' => 1) ); 29 else 30 add_screen_option('layout_columns', array('max' => 4, 'default' => 2) ); 31 27 32 add_contextual_help($current_screen, 28 33 29 34 '<p>' . __('Welcome to your WordPress Dashboard! You will find helpful tips in the Help tab of each screen to assist you as you get to know the application.') . '</p>' . … … 42 47 '<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>' 43 48 ); 44 49 45 require_once('./admin-header.php');50 include (ABSPATH . 'wp-admin/admin-header.php'); 46 51 47 52 $today = current_time('mysql', 1); 48 53 ?> -
wp-admin/edit-link-form.php
37 37 do_action('do_meta_boxes', 'link', 'advanced', $link); 38 38 do_action('do_meta_boxes', 'link', 'side', $link); 39 39 40 add_screen_option('layout_columns', array('max' => 2) ); 41 40 42 add_contextual_help($current_screen, 41 43 '<p>' . __( 'You can add or edit links on this screen by entering information in each of the boxes. Only the link’s web address and name (the text you want to display on your site as the link) are required fields.' ) . '</p>' . 42 44 '<p>' . __( 'The boxes for link name, web address, and description have fixed positions, while the others may be repositioned using drag and drop. You can also hide boxes you don’t use in the Screen Options tab, or minimize boxes by clicking on the title bar of the box.' ) . '</p>' . -
wp-admin/upload.php
134 134 wp_enqueue_script( 'jquery-ui-draggable' ); 135 135 wp_enqueue_script( 'media' ); 136 136 137 add_screen_option( 'per_page', array('label' => _x( 'Media items', 'items per page (screen options)' )) ); 138 137 139 add_contextual_help( $current_screen, 138 140 '<p>' . __('All the files you’ve uploaded are listed in the Media Library, with the most recent uploads listed first. You can use the <em>Screen Options</em> tab to customize the display of this screen.') . '</p>' . 139 141 '<p>' . __('You can narrow the list by file type/status using the text link filters at the top of the screen. You also can refine the list by date using the dropdown menu above the media table.') . '</p>' . -
wp-admin/edit-form-advanced.php
163 163 do_action('do_meta_boxes', $post_type, 'advanced', $post); 164 164 do_action('do_meta_boxes', $post_type, 'side', $post); 165 165 166 add_screen_option('layout_columns', array('max' => 2) ); 167 166 168 if ( 'post' == $post_type ) { 167 169 add_contextual_help($current_screen, 168 170 '<p>' . __('The title field and the big Post Editing Area are fixed in place, but you can reposition all the other boxes that allow you to add metadata to your post using drag and drop, and can minimize or expand them by clicking the title bar of the box. You can also hide any of the boxes by using the Screen Options tab, where you can also choose a 1- or 2-column layout for this screen.') . '</p>' . -
wp-admin/network/settings.php
43 43 ?> 44 44 45 45 <div class="wrap"> 46 <?php screen_icon( ); ?>46 <?php screen_icon('options-general'); ?> 47 47 <h2><?php _e( 'Network Options' ) ?></h2> 48 48 <form method="post" action="edit.php?action=siteoptions"> 49 49 <?php wp_nonce_field( 'siteoptions' ); ?> … … 67 67 </td> 68 68 </tr> 69 69 </table> 70 <h3><?php _e( 'Dashboard Settings' ); ?></h3>71 <table class="form-table">72 <tr valign="top">73 <th scope="row"><label for="dashboard_blog"><?php _e( 'Dashboard Site' ) ?></label></th>74 <td>75 <?php76 if ( $dashboard_blog = get_site_option( 'dashboard_blog' ) ) {77 $details = get_blog_details( $dashboard_blog );78 $blogname = untrailingslashit( sanitize_user( str_replace( '.', '', str_replace( $current_site->domain . $current_site->path, '', $details->domain . $details->path ) ) ) );79 } else {80 $blogname = '';81 }?>82 <input name="dashboard_blog_orig" type="hidden" id="dashboard_blog_orig" value="<?php echo esc_attr( $blogname ); ?>" />83 <input name="dashboard_blog" type="text" id="dashboard_blog" value="<?php echo esc_attr( $blogname ); ?>" class="regular-text" />84 <br />85 <?php _e( 'Site path (“dashboard”, “control”, “manager”, etc.) or blog ID.<br />New users are added to this site as the user role defined below if they don’t have a site. Leave blank for the main site. Users with the Subscriber role on the old site will be moved to the new site if changed. The new site will be created if it does not exist.' ); ?>86 </td>87 </tr>88 <tr valign="top">89 <th scope="row"><label for="default_user_role"><?php _e( 'Dashboard User Default Role' ) ?></label></th>90 <td>91 <select name="default_user_role" id="default_user_role"><?php92 wp_dropdown_roles( get_site_option( 'default_user_role', 'subscriber' ) );93 ?>94 </select>95 <br />96 <?php _e( 'The default role for new users on the Dashboard site. “Subscriber” or “Contributor” roles are recommended.' ); ?>97 </td>98 </tr>99 <tr valign="top">100 <th scope="row"><label for="admin_notice_feed"><?php _e( 'Admin Notice Feed' ) ?></label></th>101 <td><input name="admin_notice_feed" class="large-text" type="text" id="admin_notice_feed" value="<?php echo esc_attr( get_site_option( 'admin_notice_feed' ) ) ?>" size="80" /><br />102 <?php _e( 'Display the latest post from this RSS or Atom feed on all site dashboards. Leave blank to disable.' ); ?><br />103 104 <?php if ( get_site_option( 'admin_notice_feed' ) != get_home_url( $current_site->id, 'feed/' ) )105 echo __( 'A good one to use would be the feed from your main site: ' ) . esc_url( get_home_url( $current_site->id, 'feed/' ) ) ?></td>106 </tr>107 </table>108 70 <h3><?php _e( 'Registration Settings' ); ?></h3> 109 71 <table class="form-table"> 110 72 <tr valign="top"> -
wp-admin/network/users.php
16 16 $title = __( 'Users' ); 17 17 $parent_file = 'users.php'; 18 18 19 add_screen_option( 'per_page', array('label' => _x( 'Users', 'users per page (screen options)' )) ); 20 19 21 add_contextual_help($current_screen, 20 22 '<p>' . __('This table shows all users across the network and the sites to which they are assigned.') . '</p>' . 21 23 '<p>' . __('Hover over any user on the list to make the edit links appear. The Edit link on the left will take you to his or her Edit User profile page; the Edit link on the right by any site name goes to an Edit Site screen for that site.') . '</p>' . -
wp-admin/network/edit.php
52 52 $user_dropdown = "<select name='blog[$val][{$key}]'>"; 53 53 $user_list = ''; 54 54 foreach ( $blog_users as $user ) { 55 if ( $user->user_id != $val && !in_array( $user-> user_id, $allusers ) )56 $user_list .= "<option value='{$user-> user_id}'>{$user->user_login}</option>";55 if ( $user->user_id != $val && !in_array( $user->id, $allusers ) ) 56 $user_list .= "<option value='{$user->id}'>{$user->user_login}</option>"; 57 57 } 58 58 if ( '' == $user_list ) 59 59 $user_list = $admin_out; … … 137 137 } else { 138 138 update_site_option( 'banned_email_domains', '' ); 139 139 } 140 update_site_option( 'default_user_role', $_POST['default_user_role'] );141 if ( trim( $_POST['dashboard_blog_orig'] ) == '' )142 $_POST['dashboard_blog_orig'] = $current_site->blog_id;143 if ( trim( $_POST['dashboard_blog'] ) == '' ) {144 $_POST['dashboard_blog'] = $current_site->blog_id;145 $dashboard_blog_id = $current_site->blog_id;146 } elseif ( ! preg_match( '/(--|\.)/', $_POST['dashboard_blog'] ) && preg_match( '|^([a-zA-Z0-9-\.])+$|', $_POST['dashboard_blog'] ) ) {147 $dashboard_blog = $_POST['dashboard_blog'];148 $blog_details = get_blog_details( $dashboard_blog );149 if ( false === $blog_details ) {150 if ( is_numeric( $dashboard_blog ) )151 wp_die( __( 'A dashboard site referenced by ID must already exist' ) );152 if ( is_subdomain_install() ) {153 $domain = $dashboard_blog . '.' . $current_site->domain;154 $path = $current_site->path;155 } else {156 $domain = $current_site->domain;157 $path = trailingslashit( $current_site->path . $dashboard_blog );158 }159 $wpdb->hide_errors();160 $dashboard_blog_id = wpmu_create_blog( $domain, $path, __( 'My Dashboard' ), $current_user->id , array( 'public' => 0 ), $current_site->id );161 $wpdb->show_errors();162 } else {163 $dashboard_blog_id = $blog_details->blog_id;164 }165 }166 if ( is_wp_error( $dashboard_blog_id ) )167 wp_die( __( 'Problem creating dashboard site: ' ) . $dashboard_blog_id->get_error_message() );168 if ( $_POST['dashboard_blog_orig'] != $_POST['dashboard_blog'] ) {169 $users = get_users_of_blog( get_site_option( 'dashboard_blog' ) );170 $move_users = array();171 foreach ( (array)$users as $user ) {172 $user_meta_value = unserialize( $user->meta_value );173 if ( is_array( $user_meta_value ) && array_pop( $var_by_ref = array_keys( $user_meta_value ) ) == 'subscriber' )174 $move_users[] = $user->user_id;175 }176 if ( false == empty( $move_users ) ) {177 foreach ( (array)$move_users as $user_id ) {178 remove_user_from_blog($user_id, get_site_option( 'dashboard_blog' ) );179 add_user_to_blog( $dashboard_blog_id, $user_id, get_site_option( 'default_user_role', 'subscriber' ) );180 update_user_meta( $user_id, 'primary_blog', $dashboard_blog_id );181 }182 }183 }184 update_site_option( 'dashboard_blog', $dashboard_blog_id );185 140 186 $options = array( 'registrationnotification', 'registration', 'add_new_users', 'menu_items', 'mu_media_buttons', 'upload_space_check_disabled', 'blog_upload_space', 'upload_filetypes', 'site_name', 'first_post', 'first_page', 'first_comment', 'first_comment_url', 'first_comment_author', 'welcome_email', 'welcome_user_email', 'fileupload_maxk', ' admin_notice_feed', 'global_terms_enabled' );141 $options = array( 'registrationnotification', 'registration', 'add_new_users', 'menu_items', 'mu_media_buttons', 'upload_space_check_disabled', 'blog_upload_space', 'upload_filetypes', 'site_name', 'first_post', 'first_page', 'first_comment', 'first_comment_url', 'first_comment_author', 'welcome_email', 'welcome_user_email', 'fileupload_maxk', 'global_terms_enabled' ); 187 142 $checked_options = array( 'mu_media_buttons' => array(), 'menu_items' => array(), 'registrationnotification' => 'no', 'upload_space_check_disabled' => 1, 'add_new_users' => 0 ); 188 143 foreach ( $checked_options as $option_name => $option_unchecked_value ) { 189 144 if ( ! isset( $_POST[$option_name] ) ) … … 255 210 $id = wpmu_create_blog( $newdomain, $path, $title, $user_id , array( 'public' => 1 ), $current_site->id ); 256 211 $wpdb->show_errors(); 257 212 if ( !is_wp_error( $id ) ) { 258 $dashboard_blog = get_dashboard_blog(); 259 if ( !is_super_admin( $user_id ) && get_user_option( 'primary_blog', $user_id ) == $dashboard_blog->blog_id ) 213 if ( !is_super_admin( $user_id ) && !get_user_option( 'primary_blog', $user_id ) ) 260 214 update_user_option( $user_id, 'primary_blog', $id, true ); 261 215 $content_mail = sprintf( __( "New site created by %1s\n\nAddress: http://%2s\nName: %3s"), $current_user->user_login , $newdomain . $path, stripslashes( $title ) ); 262 216 wp_mail( get_site_option('admin_email'), sprintf( __( '[%s] New Site Created' ), $current_site->site_name ), $content_mail, 'From: "Site Admin" <' . get_site_option( 'admin_email' ) . '>' ); … … 687 641 else 688 642 wp_new_user_notification( $user_id, $password ); 689 643 690 if ( get_site_option( 'dashboard_blog' ) == false )691 add_user_to_blog( $current_site->blog_id, $user_id, get_site_option( 'default_user_role', 'subscriber' ) );692 else693 add_user_to_blog( get_site_option( 'dashboard_blog' ), $user_id, get_site_option( 'default_user_role', 'subscriber' ) );694 695 644 wp_redirect( add_query_arg( array( 'updated' => 'true', 'action' => 'add' ), wp_get_referer() ) ); 696 645 exit(); 697 646 break; -
wp-admin/network/sites.php
18 18 $title = __( 'Sites' ); 19 19 $parent_file = 'sites.php'; 20 20 21 add_screen_option( 'per_page', array('label' => _x( 'Sites', 'sites per page (screen options)' )) ); 22 21 23 if ( isset( $_REQUEST['action'] ) && 'editblog' == $_REQUEST['action'] ) { 22 24 add_contextual_help($current_screen, 23 25 '<p>' . __('This extensive list of options has five modules: Site Info, Site Options, allowing Site Themes for this given site, changing user roles and passwords for that site, adding a new user, and Miscellaneous Site Actions (upload size limits).') . '</p>' . … … 109 111 require_once( '../admin-header.php' ); 110 112 ?> 111 113 <div class="wrap"> 112 <?php screen_icon( ); ?>114 <?php screen_icon('index'); ?> 113 115 <h2><?php _e( 'Edit Site' ); ?> - <a href="<?php echo esc_url( get_home_url( $id ) ); ?>"><?php echo esc_url( get_home_url( $id ) ); ?></a></h2> 114 116 <?php echo $msg; ?> 115 117 <form method="post" action="edit.php?action=updateblog"> … … 347 349 ?> 348 350 349 351 <div class="wrap"> 350 <?php screen_icon( ); ?>352 <?php screen_icon('index'); ?> 351 353 <h2><?php _e('Sites') ?> 352 354 <?php echo $msg; ?> 353 355 <a href="#form-add-site" class="button add-new-h2"><?php echo esc_html_x( 'Add New', 'sites' ); ?></a> -
wp-admin/network/upgrade.php
32 32 wp_die( __( 'You do not have permission to access this page.' ) ); 33 33 34 34 echo '<div class="wrap">'; 35 screen_icon( );35 screen_icon('tools'); 36 36 echo '<h2>' . __( 'Update Network' ) . '</h2>'; 37 37 38 38 $action = isset($_GET['action']) ? $_GET['action'] : 'show'; -
wp-admin/menu.php
232 232 'themes' => 'appearance', 233 233 ); 234 234 235 require (ABSPATH . 'wp-admin/includes/menu.php');235 require_once(ABSPATH . 'wp-admin/includes/menu.php'); 236 236 237 237 ?> -
wp-admin/plugins.php
290 290 wp_enqueue_script('plugin-install'); 291 291 add_thickbox(); 292 292 293 add_screen_option( 'per_page', array('label' => _x( 'Plugins', 'plugins per page (screen options)' ), 'default' => 999) ); 294 293 295 add_contextual_help($current_screen, 294 296 '<p>' . __('Plugins extend and expand the functionality of WordPress. Once a plugin is installed, you may activate it or deactivate it here.') . '</p>' . 295 297 '<p>' . sprintf(__('You can find additional plugins for your site by using the <a href="%1$s">Plugin Browser/Installer</a> functionality or by browsing the <a href="%2$s" target="_blank">WordPress Plugin Directory</a> directly and installing new plugins manually. To manually install a plugin you generally just need to upload the plugin file into your <code>/wp-content/plugins</code> directory. Once a plugin has been installed, you can activate it here.'), 'plugin-install.php', 'http://wordpress.org/extend/plugins/') . '</p>' . -
wp-admin/edit.php
163 163 ); 164 164 } 165 165 166 add_screen_option( 'per_page', array('label' => $title, 'default' => 20) ); 167 166 168 require_once('./admin-header.php'); 167 169 ?> 168 170 <div class="wrap"> -
wp-admin/index-extra.php
10 10 require_once( './admin.php' ); 11 11 12 12 /** Load WordPress Administration Dashboard API */ 13 require( './includes/dashboard.php' );13 require(ABSPATH . 'wp-admin/includes/dashboard.php' ); 14 14 15 15 @header( 'Content-Type: ' . get_option( 'html_type' ) . '; charset=' . get_option( 'blog_charset' ) ); 16 16 send_nosniff_header(); -
wp-admin/user-edit.php
31 31 $submenu_file = 'users.php'; 32 32 else 33 33 $submenu_file = 'profile.php'; 34 $parent_file = 'users.php';35 34 35 if ( current_user_can('edit_users') && !is_user_admin() ) 36 $parent_file = 'users.php'; 37 else 38 $parent_file = 'profile.php'; 39 36 40 // contextual help - choose Help on the top right of admin panel to preview this. 37 41 add_contextual_help($current_screen, 38 42 '<p>' . __('Your profile contains information about you (your “account”) as well as some personal options related to using WordPress.') . '</p>' . -
wp-admin/user/profile.php
1 <?php 2 3 require_once( './admin.php' ); 4 5 require( '../profile.php' ); 6 No newline at end of file -
wp-admin/user/user-edit.php
Property changes on: wp-admin/user/profile.php ___________________________________________________________________ Added: svn:eol-style + native
1 <?php 2 3 require_once( './admin.php' ); 4 5 require( '../user-edit.php' ); 6 No newline at end of file -
wp-admin/user/menu.php
Property changes on: wp-admin/user/user-edit.php ___________________________________________________________________ Added: svn:eol-style + native
1 <?php 2 3 /* translators: Network menu item */ 4 $menu[0] = array(__('Dashboard'), 'exist', 'index.php', '', 'menu-top menu-top-first menu-icon-site', 'menu-site', 'div'); 5 6 $menu[4] = array( '', 'exist', 'separator1', '', 'wp-menu-separator' ); 7 8 $menu[70] = array( __('Profile'), 'exist', 'profile.php', '', 'menu-top menu-icon-users', 'menu-users', 'div' ); 9 10 $menu[99] = array( '', 'exist', 'separator-last', '', 'wp-menu-separator-last' ); 11 12 $_wp_real_parent_file['users.php'] = 'profile.php'; 13 $compat = array(); 14 $submenu = array(); 15 16 require_once(ABSPATH . 'wp-admin/includes/menu.php'); 17 18 ?> 19 No newline at end of file -
wp-admin/user/index.php
Property changes on: wp-admin/user/menu.php ___________________________________________________________________ Added: svn:eol-style + native
1 <?php 2 3 require_once( './admin.php' ); 4 5 require( '../index.php' ); -
wp-admin/user/admin.php
Property changes on: wp-admin/user/index.php ___________________________________________________________________ Added: svn:eol-style + native
1 <?php 2 3 define('WP_USER_ADMIN', TRUE); 4 5 require_once( dirname(dirname(__FILE__)) . '/admin.php'); 6 7 if ( ! is_main_site() ) 8 wp_redirect( user_admin_url() ); 9 10 ?> -
wp-admin/user/index-extra.php
Property changes on: wp-admin/user/admin.php ___________________________________________________________________ Added: svn:eol-style + native
1 <?php 2 3 require_once( './admin.php' ); 4 5 require( '../index-extra.php' );