Wordpress/wp-includes
Ryan Boren 20a1def1c0 switch_to_blog() and restore_current_blog() housekeeping.
wp-includes/admin-bar.php:

* Replace get_admin_url() and get_home_url() with admin_url() and home_url() and place them inside a switch/restore. Likewise replace current_user_can_for_blog() with current_user_can(). This avoids doing multiple switch restores.

wp-includes/ms-blogs.php:

* Deprecate the $validate argument to switch_to_blog(). This avoids a not very necessary call to get_blog_details(), possibly saving a few queries.
* Use $_wp_switched and $_wp_switched_stack instead of $switched and $switched_stack to make it less likely these globals will be stomped.
* Use GLOBALS to access blog_id and other globals. I've preferred this style lately since it makes it obvious a global is being used and avoids global blog_id being stomped by a local variable.
* Lose some is_object() checks. wp_get_current_user() always returns an object, for example.
* Call the new WP_Roles::reinit() method.

wp-includes/class-wp-xmlrpc-server.php:

* Replace current_user_can_for_blog() with current_user_can() and move it inside the switch/restore pair. This eliminates a switch/restore.

wp-includes/capabilities.php:

* Use array_keys() instead of $role => $data since $data is unused. I *think* this is a bit faster.
* Introduce WP_Roles::reinit(). This reinitializes WP_Roles and is used after switch_to_blog() has already update the blog ID in the wpdb object. If a global roles array is being used instead of the db, reinit is skipped.
* current_user_can_for_blog() now does a switch/restore. It didn't before meaning it could be reinitializing the user with the wrong role information for the current blog.

wp-includes/ms-settings.php:

* Define $_wp_switched_stack and $_wp_switched. This way switch_to_blog() and restore_current_blog() can rely on it being set.

wp-settings.php:

* Instantiate the WP_Roles global. This was it is always defined during init. To remove the WP_Roles checks from WP_Role and WP_User this would probably have to move before plugins are loaded, which might not be a good thing.

wp-includes/functions.php:

* Update wp_upload_dir() to reference _wp_switched.



git-svn-id: https://develop.svn.wordpress.org/trunk@21485 602fd350-edb4-49c9-b593-d223f7449a82
2012-08-09 16:28:15 +00:00
..
Text
css Compress scripts/styles: 3.5-alpha-21460. 2012-08-06 18:58:29 +00:00
images Retina: fix the icon positions in the original editor buttons sprite, reset the css tweaks and adjust the positions in the 2x sprite, see #21019 2012-07-20 23:07:48 +00:00
js TinyMCE: fix typo in button tooltips. 2012-08-07 03:28:20 +00:00
pomo
theme-compat Introduce get_edit_user_link(). Props scribu, georgestephanis, johnbillion. fixes #14787 see #20307 2012-07-30 18:30:03 +00:00
admin-bar.php switch_to_blog() and restore_current_blog() housekeeping. 2012-08-09 16:28:15 +00:00
atomlib.php
author-template.php
bookmark-template.php Bunch of PHPDoc corrections and cleanups. props c3mdigital. props SergeyBiryukov. fixes #21149 2012-07-09 05:03:53 +00:00
bookmark.php
cache.php Introduce wp_cache_switch_to_blog() and WP_Object_Cache::switch_to_blog() as a lighter/faster way to switch the cache to a new blog id. 2012-08-02 18:31:14 +00:00
canonical.php Also switch back the @uses annotation for [21215]. props duck_. see #20484. see #16639 2012-07-05 20:09:28 +00:00
capabilities.php switch_to_blog() and restore_current_blog() housekeeping. 2012-08-09 16:28:15 +00:00
category-template.php
category.php
class-IXR.php
class-feed.php
class-http.php Fix typo in HTTP docblock. props ocean90. fixes #21215. 2012-07-20 15:09:11 +00:00
class-json.php
class-oembed.php
class-phpass.php
class-phpmailer.php Do not pass mail() a fourth argument when safe_mode is in effect. 2012-06-26 03:54:17 +00:00
class-pop3.php
class-simplepie.php
class-smtp.php
class-snoopy.php
class-wp-admin-bar.php Accessibility: add off-screen Log Out link in the toolbar, tweak the class names of the accessible links in #adminbar, see #21312 2012-08-06 00:34:44 +00:00
class-wp-ajax-response.php
class-wp-atom-server.php
class-wp-customize-control.php Fix @since blocks... since we already released 3.4.1. see #21355. 2012-08-01 07:20:44 +00:00
class-wp-customize-manager.php phpdoc for Customizer classes and methods. Props bananastalktome. see #21303 2012-07-26 21:45:33 +00:00
class-wp-customize-section.php phpdoc for Customizer classes and methods. Props bananastalktome. see #21303 2012-07-26 21:45:33 +00:00
class-wp-customize-setting.php phpdoc for Customizer classes and methods. Props bananastalktome. see #21303 2012-07-26 21:45:33 +00:00
class-wp-editor.php Add translation context for the Text editor tab name, props obenland, fixes #20993 2012-08-03 21:08:52 +00:00
class-wp-error.php
class-wp-http-ixr-client.php
class-wp-theme.php Deprecate get_blog_option(), add_blog_option(), update_blog_option(), and delete_blog_option(). 2012-08-03 17:51:42 +00:00
class-wp-walker.php
class-wp-xmlrpc-server.php switch_to_blog() and restore_current_blog() housekeeping. 2012-08-09 16:28:15 +00:00
class-wp.php Allow home page of multisite (subdir install) sites to resolve regardless of capitalization, as they already do for URLs other than the home page. props SergeyBiryukov. fixes #16200 2012-07-05 13:50:24 +00:00
class.wp-dependencies.php When WP_Dependencies accept a string for a single dependency, make sure the string is not empty, see #20683 2012-08-08 17:21:24 +00:00
class.wp-scripts.php Allow protocol-relative URLs when registering/enqueueing scripts and styles. 2012-06-28 20:18:38 +00:00
class.wp-styles.php Allow protocol-relative URLs when registering/enqueueing scripts and styles. 2012-06-28 20:18:38 +00:00
comment-template.php Introduce get_edit_user_link(). Props scribu, georgestephanis, johnbillion. fixes #14787 see #20307 2012-07-30 18:30:03 +00:00
comment.php Move most instances of new WP_User to get_userdata(). see #21120. 2012-08-03 01:06:05 +00:00
compat.php
cron.php Introduce cron_request filter. Props ikailo. fixes #13449 2012-07-20 15:15:22 +00:00
default-constants.php s/inval/intval/. props PeteMall. see #14889. 2012-06-28 20:24:50 +00:00
default-filters.php
default-widgets.php
deprecated.php Deprecate sticky_class() in favor of post_class(). props solarissmoke, fixes #16675. 2012-07-09 21:10:59 +00:00
feed-atom-comments.php Use get_search_query() in feed-rss2-comments.php. Props SergeyBiryukov. fixes #21365 2012-07-25 18:04:17 +00:00
feed-atom.php Use html_type for alternate link elements in atom feeds, as done in atom comment feeds. props niallkennedy. fixes #21305. 2012-07-20 15:08:45 +00:00
feed-rdf.php
feed-rss.php
feed-rss2-comments.php Use get_search_query() in feed-rss2-comments.php. Props SergeyBiryukov. fixes #21365 2012-07-25 18:04:17 +00:00
feed-rss2.php Use the_content_feed() when looking for zero-length post content for RSS2 feeds. Now you can have blank posts with content generated by the_content filters. props SergeyBiryukov. fixes #15604 2012-07-09 03:33:01 +00:00
feed.php Supply the missing @return doc for get_the_content_feed(). props c3mdigital. fixes #21148 2012-07-09 04:51:00 +00:00
formatting.php Only run stripslashes() in stripslashes_deep() for strings, not other scalar values. props Kawauso, knutsp. props coffee2code for [UT698]. fixes #18026. 2012-07-20 15:14:26 +00:00
functions.php switch_to_blog() and restore_current_blog() housekeeping. 2012-08-09 16:28:15 +00:00
functions.wp-scripts.php
functions.wp-styles.php
general-template.php Move get_current_blog_id() to load.php so it is available during multisite bootstrap. fixes #21432 2012-08-09 13:17:14 +00:00
http.php
kses.php
l10n.php
link-template.php Deprecate get_blog_option(), add_blog_option(), update_blog_option(), and delete_blog_option(). 2012-08-03 17:51:42 +00:00
load.php Move get_current_blog_id() to load.php so it is available during multisite bootstrap. fixes #21432 2012-08-09 13:17:14 +00:00
locale.php
media.php Introduce wp_oembed_remove_provider(). Props r-a-y. fixes #16327 2012-07-26 20:18:27 +00:00
meta.php Add NOT EXISTS to meta queries, allowing you to query for the non-existence of a meta key. 2012-06-29 19:59:29 +00:00
ms-blogs.php switch_to_blog() and restore_current_blog() housekeeping. 2012-08-09 16:28:15 +00:00
ms-default-constants.php
ms-default-filters.php Multisite: Make it easy to replace or augment the over-quota message displayed when you try and upload new media and you have reached your quota. 2012-07-10 13:33:44 +00:00
ms-deprecated.php Undeprecate *_blog_option() by popular demand. Put them back in ms-blogs.php since direct inclusion of ms-blogs.php/ms-functions.php is unforntunately common. 2012-08-08 17:11:15 +00:00
ms-files.php
ms-functions.php Move most instances of new WP_User to get_userdata(). see #21120. 2012-08-03 01:06:05 +00:00
ms-load.php
ms-settings.php switch_to_blog() and restore_current_blog() housekeeping. 2012-08-09 16:28:15 +00:00
nav-menu-template.php Remove unused global reference. props ampt. fixes #20863. 2012-07-09 19:48:04 +00:00
nav-menu.php
option.php
pluggable-deprecated.php
pluggable.php Move most instances of new WP_User to get_userdata(). see #21120. 2012-08-03 01:06:05 +00:00
plugin.php Revert [21287] until #21169 goes through. see #21321. 2012-07-21 20:24:21 +00:00
post-template.php Fix some spelling errors. Props thee17. fixes #21191 2012-07-25 18:06:13 +00:00
post-thumbnail-template.php
post.php Remove unused arguments (hierarchical, _edit_link, capability_type) from register_post_status 2012-07-22 08:45:35 +00:00
query.php Use is_main_query() method, rather than the function. Only decode the search query variable if we are executing the main query and it came from the /search/ base, rather than the query string. fixes #13961. 2012-07-09 17:28:55 +00:00
registration-functions.php
registration.php
rewrite.php
rss-functions.php
rss.php
script-loader.php Fix the plupload script enqueue, props SergeyBiryukov, Fixes #21467. See #20683. 2012-08-05 12:16:16 +00:00
shortcodes.php
taxonomy.php
template-loader.php
template.php
theme.php Allow switch_theme() to take a single $stylesheet argument. 2012-06-26 05:21:04 +00:00
update.php
user.php Move most instances of new WP_User to get_userdata(). see #21120. 2012-08-03 01:06:05 +00:00
vars.php TinyMCE: better exclusion of Opera mobile, fixes #21416 2012-07-30 19:40:52 +00:00
version.php Compress scripts/styles: 3.5-alpha-21466. 2012-08-06 22:58:30 +00:00
widgets.php
wlwmanifest.xml
wp-db.php Declare, document, and protect $dbuser, $dbpassword, $dbname, $dbhost and $dbh in wpdb. 2012-08-08 06:28:57 +00:00
wp-diff.php