Commit Graph

34168 Commits

Author SHA1 Message Date
Weston Ruter
f660ffb601 Widgets: Provide PHP 5.2 fallback for spl_object_hash() if disabled in logic for registering and unregistering pre-instantiated widgets.
Fixes #28216.


git-svn-id: https://develop.svn.wordpress.org/trunk@37333 602fd350-edb4-49c9-b593-d223f7449a82
2016-04-30 22:35:27 +00:00
Dominik Schilling (ocean90)
d62141c38d Plugins: In plugin_basename() normalize the file path before unresolving symlinks.
`$wp_plugin_paths` contains normalized paths, see `wp_register_plugin_realpath()`.

Props jdgrimes, voldemortensen, flyingdr, ocean90.
Fixes #29154.

git-svn-id: https://develop.svn.wordpress.org/trunk@37332 602fd350-edb4-49c9-b593-d223f7449a82
2016-04-30 15:08:06 +00:00
Dominik Schilling (ocean90)
c39a438d65 Plugins: In uninstall_plugin() pass the plugin file to wp_register_plugin_realpath().
`wp_register_plugin_realpath()` calls `dirname( $file );` to remove the basename. The basename must be included in the argument or the symlinked directory won't be registered.

Props andy.
Fixes #36709.

git-svn-id: https://develop.svn.wordpress.org/trunk@37331 602fd350-edb4-49c9-b593-d223f7449a82
2016-04-30 15:03:14 +00:00
Andrea Fercia
ee30b90714 Accessibility: improve the Star Ratings hiding empty elements for assistive technologies.
Fixes #36725.

git-svn-id: https://develop.svn.wordpress.org/trunk@37330 602fd350-edb4-49c9-b593-d223f7449a82
2016-04-30 14:32:40 +00:00
Weston Ruter
7ad11aaad8 Widgets: Allow WP_Widget subclass instances (objects) to be registered/unregistered in addition to WP_Widget subclass names (strings).
Allows widgets to be registered which rely on dependency injection. Also will allow for new widget types to be created dynamically (e.g. a Recent Posts widget for each registered post type).

See #35990.
Props mdwheele, PeterRKnight, westonruter.
Fixes #28216.


git-svn-id: https://develop.svn.wordpress.org/trunk@37329 602fd350-edb4-49c9-b593-d223f7449a82
2016-04-29 18:48:27 +00:00
Scott Taylor
ec0614cf17 Media/Unit Tests: ensure that image sizes are indeed removed when errors are raised before assertions in Tests_Media.
See #36588.


git-svn-id: https://develop.svn.wordpress.org/trunk@37328 602fd350-edb4-49c9-b593-d223f7449a82
2016-04-29 17:51:54 +00:00
Scott Taylor
fe85e78329 Media/Unit Tests: ensure that the GD absrtraction is used for GD unit tests for Images. Some of the procedural GD API functions can still throw ImagickException, which is fun.
See #36588.


git-svn-id: https://develop.svn.wordpress.org/trunk@37327 602fd350-edb4-49c9-b593-d223f7449a82
2016-04-29 16:15:37 +00:00
Jeremy Felt
32dfe766e8 Multisite: Add the pre_get_blogs_of_user filter
This allows a plugin to short circuit `get_blogs_of_user()` in cases where the default behavior of the function is unnecessary or slow. (e.g. A user is a member of thousands of sites.)

Props jsternberg.
See #31746, Fixes #36707.


git-svn-id: https://develop.svn.wordpress.org/trunk@37326 602fd350-edb4-49c9-b593-d223f7449a82
2016-04-29 15:52:34 +00:00
Scott Taylor
6dcd17ff9c Comments: pass $comment to comment_text() in Walker_Comment::comment() instead of using a function which can skip the cache.
Props rachelbaker.
Fixes #35433.


git-svn-id: https://develop.svn.wordpress.org/trunk@37325 602fd350-edb4-49c9-b593-d223f7449a82
2016-04-29 15:46:39 +00:00
Boone Gorges
00c39a3f98 Query: Discard non-scalar 'm' instead of attempting to sanitize.
`WP_Query` discards most non-array date values ('year', 'monthnum', etc) by
casting to integer. Since [25138], the 'm' parameter has been handled
as a string; see #24884. However, the string-handling introduced in [25138]
blindly attempted to handle arrays and other non-scalar types as strings,
resulting in PHP notices and invalid MySQL syntax.

Props vortfu.
Fixes #36718.

git-svn-id: https://develop.svn.wordpress.org/trunk@37324 602fd350-edb4-49c9-b593-d223f7449a82
2016-04-29 13:14:18 +00:00
Rachel Baker
d73d355250 Widgets: When the Inactive Widgets section is hidden also hide the “Clear Inactive Widgets” button description text.
Props welcher.

Fixes #35592.



git-svn-id: https://develop.svn.wordpress.org/trunk@37323 602fd350-edb4-49c9-b593-d223f7449a82
2016-04-28 20:39:22 +00:00
Weston Ruter
5989bc82ba Customize: Remove format placeholders from widget templates and selectors, fixing a jQuery selector syntax error and the broken highlight/shift-click behaviors.
The issues occur in themes that register sidebars that reference a single format placeholder (`%1$s` and `%2$s`) multiple times, such as in the `id` and `class` attributes for `$before_widget`.

Props martin.krcho, westonruter.
Fixes #36473.


git-svn-id: https://develop.svn.wordpress.org/trunk@37322 602fd350-edb4-49c9-b593-d223f7449a82
2016-04-28 18:19:15 +00:00
Michael Arestad
88de2831b9 Component: Administration
Setting the background color on `body` is more flexible than on the `html` element. This patch assigns the background color to `body` instead of the `html` element.

Fixes #35314


git-svn-id: https://develop.svn.wordpress.org/trunk@37321 602fd350-edb4-49c9-b593-d223f7449a82
2016-04-28 03:15:08 +00:00
Eric Andrew Lewis
878343d4d1 Database: Set MySQL connection collation.
Fixes #36649.


git-svn-id: https://develop.svn.wordpress.org/trunk@37320 602fd350-edb4-49c9-b593-d223f7449a82
2016-04-28 01:38:31 +00:00
Eric Andrew Lewis
8692cdbecd Build/Test Tools: Document WP_UnitTestCase->go_to()
Fixes #36679.


git-svn-id: https://develop.svn.wordpress.org/trunk@37319 602fd350-edb4-49c9-b593-d223f7449a82
2016-04-27 18:24:34 +00:00
Jeremy Felt
967eb06e1b Tests: Reduce unnecessary count in create_many() in multisite user tests
The tests for `is_blog_user()` and `is_user_member_of_blog()` should be refactored. Until then, we can shave several seconds from the test time by avoiding unnecessary loops of the same tests.

See #36566.


git-svn-id: https://develop.svn.wordpress.org/trunk@37318 602fd350-edb4-49c9-b593-d223f7449a82
2016-04-27 06:32:47 +00:00
Jeremy Felt
28d12c612e Users: Prevent spammy users from resetting their passwords in multisite
Props r-a-y, websupporter.
Fixes #24617.


git-svn-id: https://develop.svn.wordpress.org/trunk@37317 602fd350-edb4-49c9-b593-d223f7449a82
2016-04-27 05:54:40 +00:00
Jeremy Felt
534f0e92a0 Users: Provide a full user object when checking for a spammy multisite user
`is_user_spammy()` falls back to the current user if one is not provided. There is no current user during authentication, so the result is always `false`. Pass a user to fill the void.

Adds tests for `wp_authenticate_spam_check()`.

Props websupporter.
Fixes #36546.


git-svn-id: https://develop.svn.wordpress.org/trunk@37316 602fd350-edb4-49c9-b593-d223f7449a82
2016-04-27 05:35:37 +00:00
Eric Andrew Lewis
ff8553ea6b Users: Correct inline docs for cookie expiration.
Props kjbenk.
Fixes #35568.


git-svn-id: https://develop.svn.wordpress.org/trunk@37315 602fd350-edb4-49c9-b593-d223f7449a82
2016-04-27 02:51:31 +00:00
Rachel Baker
024c8003c9 Users: Remove the “Name” column of the Users table from appearing sortable.
The “Name” column of the Users WP List Table is not sortable because this column displays a concatenation of two optional values, `first_name` and `last_name`. Even if WP_User_Query supported ordering queries in this manner, the resulting sequence would be chaotic.

Fixes #28064.

Props jesin, and rachelbaker.

git-svn-id: https://develop.svn.wordpress.org/trunk@37314 602fd350-edb4-49c9-b593-d223f7449a82
2016-04-26 20:34:05 +00:00
Rachel Baker
1bee2ff07a Post Thumbnails: Fix logic bug and tests from [37308] where post-thumbnails support wasn’t added if there were no previous post_types with support already.
See #22080

git-svn-id: https://develop.svn.wordpress.org/trunk@37313 602fd350-edb4-49c9-b593-d223f7449a82
2016-04-26 20:28:46 +00:00
Rachel Baker
3518df091f Tests: Fix typo current_theme_support() -> current_theme_supports() from [37308]
git-svn-id: https://develop.svn.wordpress.org/trunk@37309 602fd350-edb4-49c9-b593-d223f7449a82
2016-04-26 17:30:19 +00:00
Rachel Baker
2ff19ab7d3 Post Thumbnails: When using add_theme_support( ‘post-thumbnails’, array( $post_types) ) merge the supported post_types.
Allow the adding of post-thumbnail support for one or more post_types without unsetting any previously added post_types. This matches the behavior of other uses of `add_theme_support()` and the expectations of a function with a prefix of “add”.
To unset post-thumbnail support use `remove_theme_support()` instead.

Fixes #22080

Props alexkingorg, jmichaelward, and flixos90.

git-svn-id: https://develop.svn.wordpress.org/trunk@37308 602fd350-edb4-49c9-b593-d223f7449a82
2016-04-26 17:04:25 +00:00
Sergey Biryukov
274902b03a Build/Test Tools: Reset the PHPMailer mock in Tests_Mail::tearDown().
Props welcher.
Fixes #36609.

git-svn-id: https://develop.svn.wordpress.org/trunk@37307 602fd350-edb4-49c9-b593-d223f7449a82
2016-04-23 08:15:11 +00:00
Scott Taylor
aba30dc390 Unit Tests: prevent rewrite spillage from @group author unit tests.
See #36587.


git-svn-id: https://develop.svn.wordpress.org/trunk@37306 602fd350-edb4-49c9-b593-d223f7449a82
2016-04-22 23:47:27 +00:00
Scott Taylor
a776b0b6df Comments: add a $comment parameter to get_comment_author_url_link().
Add unit tests (none exist).

Props flixos90, wonderboymusic.
Fixes #36573.


git-svn-id: https://develop.svn.wordpress.org/trunk@37305 602fd350-edb4-49c9-b593-d223f7449a82
2016-04-22 22:44:33 +00:00
Rachel Baker
7dd7992179 Comments: Add unordered list styling to Comments List Table rows and Moderate Comment screen.
Fixes #36160

Props juanfra.

git-svn-id: https://develop.svn.wordpress.org/trunk@37304 602fd350-edb4-49c9-b593-d223f7449a82
2016-04-22 21:46:06 +00:00
Rachel Baker
9e81e20916 Comments: Keep comments safe in the Edit Post screen.
Warns users that have added a new Comment or began editing an existing without saving their changes, before they press the “update” button which would wipe out their comment changes.

Fixes #32818.

Props polevaultweb.

git-svn-id: https://develop.svn.wordpress.org/trunk@37303 602fd350-edb4-49c9-b593-d223f7449a82
2016-04-22 21:42:38 +00:00
Scott Taylor
e2b9072267 Dashboard: toggle the "View" link for comments when Approving / Unapproving from the Dashboard widget.
Fixes #35518.


git-svn-id: https://develop.svn.wordpress.org/trunk@37302 602fd350-edb4-49c9-b593-d223f7449a82
2016-04-22 21:29:19 +00:00
Andrew Ozz
457f5ac6a0 TinyMCE: prevent showing the placeholder URL when adding a link and clicking more than once on the Insert Link button.
Props iseulde.
Fixes #36637 for trunk.

git-svn-id: https://develop.svn.wordpress.org/trunk@37301 602fd350-edb4-49c9-b593-d223f7449a82
2016-04-22 19:10:18 +00:00
Jeremy Felt
5af20a3de3 Tests: Account for flexible IDs in main network deletion test
After [37299], the network IDs encountered by this test may be larger than "100".

This adjusts the test to respond accordingly until we have a better way to delete networks.

See #36566.


git-svn-id: https://develop.svn.wordpress.org/trunk@37300 602fd350-edb4-49c9-b593-d223f7449a82
2016-04-22 15:21:14 +00:00
Boone Gorges
7c79386135 Tests: Use the same incrementor for all fields belonging to a given text fixture.
[35244] changed the way that `WP_UnitTest_Generator_Sequence()` created an
incrementor for object fields (like 'post_name' and 'user_email'), by making
incrementor static across the entire run of the test suite. While this helped
to enforce uniqueness across the tests, it has the side effect of bumping the
incrementor between fields on the same object (so that, eg, the same post might
have `post_name` "post-12" but `post_title` "Post 13". By switching to a
technique that uses the same incrementor for each field belonging to a given
fixture, we conform better to the expectations of developers using
`WP_UnitTest_Factory`.

Fixes #35199.

git-svn-id: https://develop.svn.wordpress.org/trunk@37299 602fd350-edb4-49c9-b593-d223f7449a82
2016-04-22 14:35:52 +00:00
Gary Pendergast
f9e1cf5de0 Smilies: Move convert_smilies to happen later in the the_content filter.
In particular, we want it to occur after shortcode handling. The smiley conversion routine doesn't have any concept of shortcode structure, so may inadvertantly replace a smiley with HTML inside a shortcode attribute, which will cause the shortcode to not be parsed correctly.

Props Unyson for the initial suggested fix.

Fixes #36306. 



git-svn-id: https://develop.svn.wordpress.org/trunk@37298 602fd350-edb4-49c9-b593-d223f7449a82
2016-04-22 07:07:03 +00:00
Sergey Biryukov
0cc8d27fda Text Changes: Consistently refer to https://wordpress.org/plugins/ and https://wordpress.org/themes/ as WordPress Plugin Directory and WordPress Theme Directory, respectively.
Props mpol.
Fixes #35938.

git-svn-id: https://develop.svn.wordpress.org/trunk@37297 602fd350-edb4-49c9-b593-d223f7449a82
2016-04-22 06:56:20 +00:00
Gary Pendergast
74e88010c0 Emoji: The :roll: smiley is now an emoji.
Unicode 8 added `U+1F644`, "Face with Rolling Eyes", which matches our `:roll:` smiley. Continuing our ever present quest to rid the world of legacy smilies, we now translate that smiley into its emoji form.

Sadly, `:mrgreen:` remains sorely under-represented in the Unicode standard, I'm inclined to think that we should buy a voting membership of the Unicode Consortium, in order to rectify that situation. (Personally, I'm hoping for a green skin tone modifier.)

Fixes #36365.
 



git-svn-id: https://develop.svn.wordpress.org/trunk@37296 602fd350-edb4-49c9-b593-d223f7449a82
2016-04-22 06:28:51 +00:00
Gary Pendergast
9a4c6dc3de Database: Suppress connection error messages when WP_DEBUG isn't enabled.
This is a partial revert of [35860], which has been causing un-catchable warnings to be generated on some server configurations.

Fixes #36629 for trunk.
See #21870.



git-svn-id: https://develop.svn.wordpress.org/trunk@37292 602fd350-edb4-49c9-b593-d223f7449a82
2016-04-22 05:18:08 +00:00
Dominik Schilling (ocean90)
153610292d Media: Remove an extra quote when sending a link of a media file to the editor.
Introduced in [37035].

Props joemcgill, swissspidy, boonebgorges.
Fixes #36578.

git-svn-id: https://develop.svn.wordpress.org/trunk@37288 602fd350-edb4-49c9-b593-d223f7449a82
2016-04-21 21:20:26 +00:00
Dominik Schilling (ocean90)
d434c58404 Themes: Update list of WordPress theme features.
* Remove color tags.
* Layout: Add Grid Layout, remove Fixed Layout, Fluid Layout, and Responsive Layout.
* Features: Add Footer Widgets, remove Blavatar.
* Subject: Add Blog, E-Commerce, Education, Entertainment, Food & Drink, Holiday, News, Photography and Portfolio, remove Photoblogging and Seasonal.

Props grapplerulrich, davewarfel.
Fixes #33407.

git-svn-id: https://develop.svn.wordpress.org/trunk@37287 602fd350-edb4-49c9-b593-d223f7449a82
2016-04-21 21:10:03 +00:00
Dominik Schilling (ocean90)
8be6905a89 Media: Don't cache the results of wp_mkdir_p() in a persistent cache.
To improve the performance of `wp_upload_dir()` the result of `wp_mkdir_p()` was stored in a persistent cache, introduced in [36565]. But this becomes an issue when WordPress is scaled horizontally. You may end up caching a value for a server where the directory doesn't exist which will prevent further uploads on other servers because of the persistent cache.
The fix is to use a non-persistent cache.

Props azaozz, ocean90.
See #34359.
Fixes #36621.

git-svn-id: https://develop.svn.wordpress.org/trunk@37285 602fd350-edb4-49c9-b593-d223f7449a82
2016-04-21 19:57:03 +00:00
Weston Ruter
842274b66d Customize/Formatting: Move sanitize_hex_color(), sanitize_hex_color_no_hash(), and maybe_hash_hex_color() from class-wp-customize-manager.php into formatting.php.
Adds missing braces.

See #33413.
Props downstairsdev, tollmanz.
Fixes #27583.


git-svn-id: https://develop.svn.wordpress.org/trunk@37283 602fd350-edb4-49c9-b593-d223f7449a82
2016-04-21 19:21:40 +00:00
John Blackbourn
b41fc5595b Feeds: Revert [36230] which removed the rss-http feed content type. Removing this means that any feeds which are using this feed content type are now being served as application/octet-stream instead of text/xml.
See #36620


git-svn-id: https://develop.svn.wordpress.org/trunk@37282 602fd350-edb4-49c9-b593-d223f7449a82
2016-04-21 18:56:37 +00:00
Sergey Biryukov
ee2b95d273 Docs: Move the clarification of is_tax() and WP_Query::is_tax() return value added in [37235] to @return description.
Props DrewAPicture.
Fixes #36331.

git-svn-id: https://develop.svn.wordpress.org/trunk@37281 602fd350-edb4-49c9-b593-d223f7449a82
2016-04-21 17:46:46 +00:00
Boone Gorges
ce350d5d5d Tests: More explicit fixture content when testing s=0 query string.
After [36647], the unit test generator sequence can put a 0 into the
'post_excerpt' field of a post fixture, causing false positives.

See [36520] for a parallel fix involving 'post_content'.

Fixes #36622.

git-svn-id: https://develop.svn.wordpress.org/trunk@37280 602fd350-edb4-49c9-b593-d223f7449a82
2016-04-21 15:52:33 +00:00
Sergey Biryukov
23d737bc53 Administration: Introduce admin_print_footer_scripts-$hook_suffix", a dynamic version of the admin_print_footer_scripts hook.
This is now more consistent with the generic `admin_print_scripts` and the dynamic `admin_print_scripts-$hook_suffix` hooks fired in `wp-admin/admin-header.php`.

Props tfrommen.
Fixes #34334.

git-svn-id: https://develop.svn.wordpress.org/trunk@37279 602fd350-edb4-49c9-b593-d223f7449a82
2016-04-21 15:16:52 +00:00
Sergey Biryukov
80601ba5f7 Docs: Reflect the new 'user' option for wp_new_user_notification()'s $notify parameter added in [37276] in wp_send_new_user_notifications() docs as well.
Props ocean90.
Fixes #36009.

git-svn-id: https://develop.svn.wordpress.org/trunk@37278 602fd350-edb4-49c9-b593-d223f7449a82
2016-04-21 12:00:44 +00:00
Sergey Biryukov
d5e795ca9e Users: Add a unit test for [37276].
See #36009.

git-svn-id: https://develop.svn.wordpress.org/trunk@37277 602fd350-edb4-49c9-b593-d223f7449a82
2016-04-21 11:51:59 +00:00
Sergey Biryukov
cbe4f5d9c7 Users: In wp_new_user_notification(), sdd 'user' option for the $notify parameter, which allows for sending notification only to the user created.
Props akibjorklund.
Fixes #36009.

git-svn-id: https://develop.svn.wordpress.org/trunk@37276 602fd350-edb4-49c9-b593-d223f7449a82
2016-04-21 10:19:42 +00:00
Pascal Birchler
c52f851308 Rewrite Rules: After [36953], correctly replace existing rules on IIS when updating them.
Props WiZZarD_.
Fixes #36506 for trunk.

git-svn-id: https://develop.svn.wordpress.org/trunk@37273 602fd350-edb4-49c9-b593-d223f7449a82
2016-04-21 09:32:42 +00:00
Dominik Schilling (ocean90)
eec3f16b24 Upgrader: Clear plugin/theme caches directly after a plugin/theme has been updated.
`wp_update_plugins()` and `wp_update_themes()` are both hooked into `upgrader_process_complete` with priority 10. But at this stage the caches in `get_plugins()`, `search_theme_directories()`, and `wp_get_themes()` aren't refreshed yet so both functions couldn't fetch any translations for the new plugin/theme.
To reset the caches, `wp_clean_themes_cache()` and `wp_clean_plugins_cache()` are now hooked into `upgrader_process_complete` with priority 9.

This is a follow-up to [34751].

See #34029.
Fixes #36383.

git-svn-id: https://develop.svn.wordpress.org/trunk@37272 602fd350-edb4-49c9-b593-d223f7449a82
2016-04-21 09:08:11 +00:00
Drew Jaynes
6c4c867b89 Tests: Pre-declare the $year_url property before initialization in Tests_Get_Archives::setUp().
Props pbearne.
Fixes #36611.


git-svn-id: https://develop.svn.wordpress.org/trunk@37271 602fd350-edb4-49c9-b593-d223f7449a82
2016-04-21 02:55:52 +00:00