Commit Graph

10224 Commits

Author SHA1 Message Date
Andrew Nacin
c11a4c09e8 Eliminate error suppression for mysql_free_result() and only call it when the result is actually a resource. Depending on the query, mysql_query() can return a boolean rather than a resource, hence the original use of error suppression.
Fixes a warning introduced in [21472] when calling mysql_free_result() was moved to flush().

fixes #20838.



git-svn-id: http://core.svn.wordpress.org/trunk@21511 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-08-14 20:21:10 +00:00
Ryan Boren
17f544b798 Update wp_update_user() phpdoc to reflect a possible return of WP_Error. Props SergeyBiryukov. fixes #21439
git-svn-id: http://core.svn.wordpress.org/trunk@21509 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-08-14 19:29:40 +00:00
Ryan Boren
dc58551658 Add isset() check to avoid notice. Props c3mdigital. fixes #21512
git-svn-id: http://core.svn.wordpress.org/trunk@21506 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-08-14 19:07:56 +00:00
Bot (Assets)
a84e9aebfd Compress scripts/styles: 3.5-alpha-21505.
git-svn-id: http://core.svn.wordpress.org/trunk@21505 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-08-14 18:58:20 +00:00
Ryan Boren
15dd7f70b0 Remove post type from post nonces. Fixes attachment deletion when EMPTY_TRASH_DAYS is 0. Props c3mdigital, kurtpayne, SergeyBiryukov. fixes #21194
git-svn-id: http://core.svn.wordpress.org/trunk@21504 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-08-14 18:39:15 +00:00
Andrew Nacin
4d014c4f40 Fix WP_Theme's get_template_directory_uri() method. props batmoo. see #21549 for trunk.
git-svn-id: http://core.svn.wordpress.org/trunk@21503 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-08-14 18:38:26 +00:00
Andrew Nacin
84c3a86036 Hide the link manager from the UI on upgrade, if the site has no links. New DB option, link_manager_enabled.
Enforce this by denying the 'manage_links' capability, which hides the All Links, Add New Link, and Link Categories screens. Hide WP_Widget_Links and the UI for the default_link_category as well.

Convert all references to 'posts and links' when handling reassignment on user deletion to just 'posts'.

see #21307.



git-svn-id: http://core.svn.wordpress.org/trunk@21501 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-08-13 16:18:42 +00:00
Bot (Assets)
0802777be2 Compress scripts/styles: 3.5-alpha-21499.
git-svn-id: http://core.svn.wordpress.org/trunk@21499 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-08-11 02:58:19 +00:00
Andrew Ozz
64033c4645 Remove unused images, props helenyhou, coffee2code, ocean90, fixes #20980
git-svn-id: http://core.svn.wordpress.org/trunk@21498 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-08-11 02:36:01 +00:00
Ryan Boren
1fd3c5471e Avoid fatal error in the customizer when the current theme doesn't support custom headers. Props c3mdigital. fixes #21515
git-svn-id: http://core.svn.wordpress.org/trunk@21497 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-08-10 20:15:06 +00:00
Ryan Boren
cbd6a8becd Allow passing stdClass and WP_User to wp_insert_user() and wp_update_user(). Introduce WP_User::to_array(). Eliminate uses of get_object_vars() when passing to wp_*_user(). fixes #21429
git-svn-id: http://core.svn.wordpress.org/trunk@21496 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-08-10 15:36:54 +00:00
Andrew Ozz
ed1698e29b Better editor background, take one, see #21536
git-svn-id: http://core.svn.wordpress.org/trunk@21495 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-08-10 07:11:03 +00:00
ryan
d286875515 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: http://core.svn.wordpress.org/trunk@21485 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-08-09 16:28:15 +00:00
ryan
14ecba530b Move get_current_blog_id() to load.php so it is available during multisite bootstrap. fixes #21432
git-svn-id: http://core.svn.wordpress.org/trunk@21484 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-08-09 13:17:14 +00:00
azaozz
cbc9aabfa4 When WP_Dependencies accept a string for a single dependency, make sure the string is not empty, see #20683
git-svn-id: http://core.svn.wordpress.org/trunk@21481 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-08-08 17:21:24 +00:00
ryan
87dc511c0f 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.
see #21432


git-svn-id: http://core.svn.wordpress.org/trunk@21480 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-08-08 17:11:15 +00:00
nacin
f02bacd9f1 Declare, document, and protect $dbuser, $dbpassword, $dbname, $dbhost and $dbh in wpdb.
These properties, while protected, are still accessible thanks to the magic getter added in [21472].

props pento, nvartolomei, joelhardi. fixes #18510.



git-svn-id: http://core.svn.wordpress.org/trunk@21473 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-08-08 06:28:57 +00:00
nacin
1425762319 Lazy-load column info in wpdb. props pento. fixes #20838.
git-svn-id: http://core.svn.wordpress.org/trunk@21472 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-08-08 06:24:59 +00:00
nacin
4e5fd4de46 Introduce wpdb::get_charset_collate() to return the DEFAULT CHARACTER SET and COLLATE for use in table schemas.
props simonwheatley, pento. fixes #18451.



git-svn-id: http://core.svn.wordpress.org/trunk@21471 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-08-08 06:13:48 +00:00
nacin
73c74cf8f7 Deprecate wpdb::supports_collation() in favor of wpdb::has_cap().
props hakre, pento. fixes #16757.



git-svn-id: http://core.svn.wordpress.org/trunk@21470 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-08-08 06:06:57 +00:00
azaozz
7de126df1f Fix typo in wp_login_form(), props greenshady, fixes #21514
git-svn-id: http://core.svn.wordpress.org/trunk@21469 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-08-07 23:13:31 +00:00
azaozz
cb618f5858 TinyMCE: fix typo in button tooltips.
git-svn-id: http://core.svn.wordpress.org/trunk@21468 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-08-07 03:28:20 +00:00
bumpbot
e27c374cf0 Compress scripts/styles: 3.5-alpha-21466.
git-svn-id: http://core.svn.wordpress.org/trunk@21466 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-08-06 22:58:30 +00:00
bumpbot
704304d6fe Compress scripts/styles: 3.5-alpha-21463.
git-svn-id: http://core.svn.wordpress.org/trunk@21463 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-08-06 20:58:37 +00:00
bumpbot
cbacfc849c Compress scripts/styles: 3.5-alpha-21460.
git-svn-id: http://core.svn.wordpress.org/trunk@21460 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-08-06 18:58:29 +00:00
azaozz
853df37fe8 Replace last remaining gradients with css, standardize the gradient css cascade, props ocean90, fixes #16461
git-svn-id: http://core.svn.wordpress.org/trunk@21459 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-08-06 17:21:41 +00:00
bumpbot
59eb150fdc Compress scripts/styles: 3.5-alpha-21458.
git-svn-id: http://core.svn.wordpress.org/trunk@21458 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-08-06 04:58:26 +00:00
bumpbot
6ce8c8872b Compress scripts/styles: 3.5-alpha-21456.
git-svn-id: http://core.svn.wordpress.org/trunk@21456 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-08-06 02:58:33 +00:00
bumpbot
f8ce3f7163 Compress scripts/styles: 3.5-alpha-21453.
git-svn-id: http://core.svn.wordpress.org/trunk@21453 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-08-06 00:58:32 +00:00
azaozz
4ef4df2f3e Accessibility: add off-screen Log Out link in the toolbar, tweak the class names of the accessible links in #adminbar, see #21312
git-svn-id: http://core.svn.wordpress.org/trunk@21452 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-08-06 00:34:44 +00:00
bumpbot
fc62ad5e57 Compress scripts/styles: 3.5-alpha-21443.
git-svn-id: http://core.svn.wordpress.org/trunk@21443 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-08-05 22:58:29 +00:00
azaozz
83d04bb82a CSS cleanup: take out -moz-box-shadow, fixes #21482
git-svn-id: http://core.svn.wordpress.org/trunk@21439 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-08-05 22:41:49 +00:00
azaozz
c368f0e6a1 Accessibility: fix the Skip to content link, show it on :focus, improve the styling of the skip links when shown, see #21310, see #21471
git-svn-id: http://core.svn.wordpress.org/trunk@21435 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-08-05 21:37:57 +00:00
bumpbot
bb04145462 Compress scripts/styles: 3.5-alpha-21429.
git-svn-id: http://core.svn.wordpress.org/trunk@21429 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-08-05 20:58:19 +00:00
azaozz
30dd9b1aa6 Accessibility: add text to the updates link in the toolbar, props SergeyBiryukov, fixes #21333
git-svn-id: http://core.svn.wordpress.org/trunk@21425 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-08-05 19:10:11 +00:00
bumpbot
e2c2d70548 Compress scripts/styles: 3.5-alpha-21424.
git-svn-id: http://core.svn.wordpress.org/trunk@21424 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-08-05 18:58:19 +00:00
azaozz
6bf5d66d5b Add "Skip to toolbar" accessibility shortcut, see #21471
git-svn-id: http://core.svn.wordpress.org/trunk@21423 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-08-05 18:41:52 +00:00
dd32
5c59400d74 Fix the plupload script enqueue, props SergeyBiryukov, Fixes #21467. See #20683.
git-svn-id: http://core.svn.wordpress.org/trunk@21421 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-08-05 12:16:16 +00:00
markjaquith
eedce37675 Let WP_Dependencies accept a string for a single dependency instead of requiring an array wrapper. props vhauri. fixes #20683
git-svn-id: http://core.svn.wordpress.org/trunk@21420 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-08-04 17:59:55 +00:00
bumpbot
81286bad53 Compress scripts/styles: 3.5-alpha-21419.
git-svn-id: http://core.svn.wordpress.org/trunk@21419 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-08-03 22:58:18 +00:00
azaozz
3fc7495aca Quicktags: don't call the callback on pressing the access key when a button is not visible, see #21460
git-svn-id: http://core.svn.wordpress.org/trunk@21418 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-08-03 21:47:58 +00:00
azaozz
49c29501ef Add translation context for the Text editor tab name, props obenland, fixes #20993
git-svn-id: http://core.svn.wordpress.org/trunk@21417 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-08-03 21:08:52 +00:00
bumpbot
fce47c7cef Compress scripts/styles: 3.5-alpha-21416. TinyMCE updated.
git-svn-id: http://core.svn.wordpress.org/trunk@21416 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-08-03 18:58:19 +00:00
azaozz
f56f339aaf TinyMCE: revert Firefox shortcuts to match all other browsers (Alt+Shift+letter), fix the labels for the shortcuts, update description in wp-mce-help, fixes #21197
git-svn-id: http://core.svn.wordpress.org/trunk@21415 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-08-03 18:12:45 +00:00
ryan
5ca54e7d2f Deprecate get_blog_option(), add_blog_option(), update_blog_option(), and delete_blog_option().
Use the regular option functions wrapped in switch_to_blog() and restore_current_blog() instead.

Group multiple operations within a single switch where possible.

fixes #21432


git-svn-id: http://core.svn.wordpress.org/trunk@21414 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-08-03 17:51:42 +00:00
nacin
7127ed1197 Move most instances of new WP_User to get_userdata(). see #21120.
git-svn-id: http://core.svn.wordpress.org/trunk@21413 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-08-03 01:06:05 +00:00
ryan
295ca4d76f 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.
Add the blog id to the cache keys for multisite installs.

Use wp_cache_switch_to_blog() instead of wp_cache_init() in switch_to_blog().

Use wp_cache_switch_to_blog() instead of wp_cache_reset() in wp_start_object_cache().

Deprecate wp_cache_reset().

This avoids the many queries needed to re-prime the cache after switch_to_blog() on multisite installs using the default cache backend.

fixes #21434



git-svn-id: http://core.svn.wordpress.org/trunk@21403 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-08-02 18:31:14 +00:00
bumpbot
606c472881 Compress scripts/styles: 3.5-alpha-21400.
git-svn-id: http://core.svn.wordpress.org/trunk@21400 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-08-01 22:58:25 +00:00
westi
4443baaab9 Multisite: Rework the upload space usage tracking code so as to be fully pluggable.
* Moves some admin only functions into wp-admin/includes/ms.php from wp-includes/ms-functions.php
 * Reworked the variable naming to be more in line with the Coding Standards
 * Introduced a new get_space_used() function instead of calculating it in multiple places.

Fixes #21181 props dllh and jkudish for inital work on this.


git-svn-id: http://core.svn.wordpress.org/trunk@21387 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-08-01 13:52:06 +00:00
koopersmith
29f2b5b903 Fix @since blocks... since we already released 3.4.1. see #21355.
git-svn-id: http://core.svn.wordpress.org/trunk@21386 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-08-01 07:20:44 +00:00