Commit Graph

33468 Commits

Author SHA1 Message Date
Weston Ruter 5600ca6bf4 Customizer: Fix `click.preview` event handler for jump links and shift+clicks in preview.
* Prevent following jump links (starting with `#`), but instead scroll that element into view.
* Prevent following links clicked in the Customizer if shift key is pressed when clicking; this fixes an issue when trying to shift-click on a widget or nav menu item (#32681) to just focus on the control in the Customizer.

Fixes #26005.


git-svn-id: https://develop.svn.wordpress.org/trunk@36371 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-21 06:07:45 +00:00
Dion Hulse 51aee5ab1b Upgrade: Switch the locking mechanism to using static methods so that it can be accessed from other upgrade-classes.
Fixes #34878


git-svn-id: https://develop.svn.wordpress.org/trunk@36370 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-21 01:21:52 +00:00
Dominik Schilling (ocean90) 58082f28e6 Widgets: Show the "Clear Inactive Widgets" button only after the sidebar with inactive widgets.
Fixes #35447.

git-svn-id: https://develop.svn.wordpress.org/trunk@36368 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-20 21:54:01 +00:00
Drew Jaynes 832197c6e6 Docs: Update the `@access` tag value for `WP_Http::_get_first_available_transport()` from `private` to `public`.
When the method was introduced in [17914], the name was underscore-prefixed as is core style for private-use, though it was also introduced with a `public` access modifier for the declaration. Due to core's committment to backward-compatibility, the access modifier overrules in this case, meaning that while the method is underscore-prefixed and was originally-intentioned to be private, it is and always will be a public method, and the documentation should reflect that.

Props Frozzare.
Fixes #35289.


git-svn-id: https://develop.svn.wordpress.org/trunk@36367 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-20 18:45:04 +00:00
Jeremy Felt 77f8c5fc07 Themes: Enhance filtering options for allowed themes on a network.
* Move the legacy `allowed_themes` filter to `WP_Theme::get_allowed_on_network()`, where it will continue to filter themes allowed on the network.
* Add `network_allowed_themes` filter to `WP_Theme::get_allowed()` and pass `$blog_id` to provide context.
* Add `site_allowed_themes` filter to `WP_Theme::get_allowed_on_site()` and pass `$blog_id` to provide context.

Props pauldewouters, lamosty, michalzuber, dmsnell, johnnypea, rob.
Fixes #28436.


git-svn-id: https://develop.svn.wordpress.org/trunk@36366 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-20 18:28:33 +00:00
Drew Jaynes 8ae1899929 Docs: Add missing `@access` tags to DocBlocks for `WP` class methods and properties.
See #32246.


git-svn-id: https://develop.svn.wordpress.org/trunk@36365 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-20 18:18:53 +00:00
Scott Taylor 2ed7c6d857 Media: When reusing the initial values from the global MediaElement config object, the config object should first be cloned. Objects in JS are references that will retain any changes. This fixes an issue where player controls could get mixed up between instances when multiple players (namely, single audio and audio playlists, in a certain order) are on the same page.
Props Fab1en.
Fixes #34152.


git-svn-id: https://develop.svn.wordpress.org/trunk@36364 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-20 15:46:59 +00:00
Dion Hulse 65267f09fb Emoji: Work around a `mod_security` rule which prevents pages with 4 or more instances of `String.fromCharCode(` from being served.
Fixes #35412 for trunk.


git-svn-id: https://develop.svn.wordpress.org/trunk@36359 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-20 07:39:47 +00:00
Andrew Ozz 1d82f671a3 TinyMCE: update to 4.3.3. Update the QUnit tests and revert back to testing the non-minified files in /src.
Fixes #35539.

git-svn-id: https://develop.svn.wordpress.org/trunk@36352 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-20 04:17:22 +00:00
Dion Hulse 078b93863d Build Tools: Revert to using a human readable timestamp rather than the unix timestamp in [36315].
Fixes #28722


git-svn-id: https://develop.svn.wordpress.org/trunk@36351 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-20 02:01:57 +00:00
Jeremy Felt 18d9640a5a Themes: Add initial tests for the `allowed_themes` filter.
We'll be adjusting the placement of this filter and adding two other related filters, so we should make sure it continues to work as expected after the change.

See #28436.


git-svn-id: https://develop.svn.wordpress.org/trunk@36350 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-19 23:57:46 +00:00
Dion Hulse b9e62671f6 Core Upgrader: Add a locking mechanism to avoid two concurrent updates of WordPress occuring.
Fixes #34878


git-svn-id: https://develop.svn.wordpress.org/trunk@36349 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-19 05:06:46 +00:00
Boone Gorges 5eee5cfc3c Don't double-escape the 'name' param in `get_terms()`.
[32353] changed the way the 'name' param in `get_terms()` is sanitized, by
running it through `sanitize_term_field( 'name' )` before performing the SQL
query. An unintentional side effect of this change was that the string is
double-escaped: once by `wp_filter_kses()`, and once by `esc_sql()`. The
double-escaping was causing 'name' queries to fail when the param contained
apostrophes or other escaped characters.

Fixes #35493.

git-svn-id: https://develop.svn.wordpress.org/trunk@36348 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-19 04:09:32 +00:00
Eric Andrew Lewis d36d6cc630 Build/Test Tools: Move PHP factory classes into their own files.
This makes the code easier to browse.

`factory.php` loads the new files, so this is backwards compatible in case `factory.php` is loaded directly for access to one of the classes.

See #35492.


git-svn-id: https://develop.svn.wordpress.org/trunk@36347 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-19 03:55:19 +00:00
Boone Gorges 7ae3adfb80 Share post fixture in `WP_Comment_Query` tests.
See #30017.

git-svn-id: https://develop.svn.wordpress.org/trunk@36346 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-19 03:02:42 +00:00
Boone Gorges 1b8e03bd89 Ignore false values of 'search' in `WP_Comment_Query`.
Props danielbachhuber.
Fixes #35513.

git-svn-id: https://develop.svn.wordpress.org/trunk@36345 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-19 02:54:28 +00:00
Eric Andrew Lewis 43da0d3894 Themes: Show template loading error to users with `switch_themes` cap.
In [36338], a template loading error was shown only to users with the `install_themes` capability. This is now displayed users with the `switch_themes` capability, as users with this cap can at least switch to a different theme. Also, this will now show for site administrators in multisite, whereas `install_themes` is limited to superadmins.

Props dd32.
See #21931.


git-svn-id: https://develop.svn.wordpress.org/trunk@36344 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-18 19:56:54 +00:00
Rachel Baker 7c6d2b0d61 Comments: Remove unused `$default_comments_page` variable in `get_comment_link()`.
Left in r34735, fetches the `default_comments_page` option twice since this variable is unused. 

See #34073 and #35511.

Props Latz.

git-svn-id: https://develop.svn.wordpress.org/trunk@36343 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-18 16:34:54 +00:00
Dion Hulse 1dbc5b2918 CSS: Reference the original location of the CSS rule being overridden.
See #35229


git-svn-id: https://develop.svn.wordpress.org/trunk@36342 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-18 09:58:21 +00:00
Dion Hulse 834ba4367f CSS: Stop using `wp-admin.min.css` and instead queue the individual stylesheets up through `load-styles.php`.
We still generate the `wp-admin.*` files for compabitility purposes, however they only include the `@import()` lines.

Fixes #35229


git-svn-id: https://develop.svn.wordpress.org/trunk@36341 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-18 09:56:06 +00:00
Jeremy Felt e62a20e5b6 Docs: Fix type documentation for `WP_Network` properties.
* `$cookie_domain` was incorrectly documented as an `int`.
* `$id` and `$blog_id`, though numeric, are provided as strings and should be documented as such.

Fixes #35404.


git-svn-id: https://develop.svn.wordpress.org/trunk@36340 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-18 02:58:22 +00:00
Rachel Baker 2da13dda2e List Tables: Use the $GLOBALS array when unsetting the global post and comment in `WP_Comments_List_Table::single_row()`.
In r35674 only the local variables were unset, when using `unset()` with a global variable the `$GLOBALS` array must be used.


Fixes #35506.


git-svn-id: https://develop.svn.wordpress.org/trunk@36339 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-18 02:49:40 +00:00
Eric Andrew Lewis 7c6c3a081f Themes: Only users with proper capability should see theme errors.
After [36335], if a template file is not loaded, an error is displayed
to logged-in users. As logged-in users may have no capabilities,
this check is insubstantial. Limit the display of this error to users
with the `install_themes` capability, i.e. someone who has the capacity
to deal with the error.

See #21931.


git-svn-id: https://develop.svn.wordpress.org/trunk@36338 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-17 23:58:04 +00:00
Ella Iseulde Van Dorpe 342d132b37 Fix unit tests after [36336]
git-svn-id: https://develop.svn.wordpress.org/trunk@36337 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-17 23:37:51 +00:00
Ella Iseulde Van Dorpe 70430c8076 Emoji: adjust $wpsmiliestrans
Swap simple-smile.png with SLIGHTLY SMILING FACE
and frownie.png with SLIGHTLY FROWNING FACE

Fixes #31710.



git-svn-id: https://develop.svn.wordpress.org/trunk@36336 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-17 22:27:52 +00:00
Eric Andrew Lewis 34898422b6 Themes: Show an error message to logged-in users if a template file isn't loaded.
On the off-chance the active theme folder is renamed or deleted, a "white screen 
of death" was displayed to the user. Instead, the user is shown a useful error
screen displaying any errors the theme has (e.g. if the theme can't be found).

Props MikeHansenMe, SergeyBiryukov.
See #21931.



git-svn-id: https://develop.svn.wordpress.org/trunk@36335 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-17 17:28:50 +00:00
Andrea Fercia 2e78169eee After [36333] correctly use `esc_attr()` instead of `esc_attr__()`.
See #35313.

git-svn-id: https://develop.svn.wordpress.org/trunk@36334 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-17 16:02:24 +00:00
Andrea Fercia 838f953d4d Accessibility: Remove title attributes from the Posts list table.
Fixes #35313.

git-svn-id: https://develop.svn.wordpress.org/trunk@36333 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-17 15:46:01 +00:00
Rachel Baker 00f2890de5 Comments: Correct description of `comment_author` property in WP_Comment class.
The `comment_author` property is the comment author’s name, not an ID.

Props meitar.

Fixes #35464.


git-svn-id: https://develop.svn.wordpress.org/trunk@36332 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-17 14:59:42 +00:00
Andrea Fercia f8f12bf78a Accessibility: Remove title attributes from the Media Library list table.
Fixes #35136.

git-svn-id: https://develop.svn.wordpress.org/trunk@36331 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-17 14:45:26 +00:00
Eric Andrew Lewis a3dda7e716 Docs: Nav menu location functions relate to nav menu locations, not nav menus.
Fixes #35471.


git-svn-id: https://develop.svn.wordpress.org/trunk@36330 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-17 01:42:16 +00:00
Pascal Birchler 3541f7b90b Posts: Correctly pass `$post` to `post_password_required()` in `get_the_excerpt()`.
Corrects the relevant test.

Props sebastian.pisula for initial patch.
Fixes #35486.

git-svn-id: https://develop.svn.wordpress.org/trunk@36329 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-16 10:13:27 +00:00
Dominik Schilling (ocean90) 54abada4cc Media: Update some attach/detach strings in the columns view.
* Show a "Media attachment reattached."/"Media attachment detached." message when only one attachment was attached/detached. 
* Use the string placeholder as `number_format_i18n()` returns a string.
* Add translator comments.
* Update help text to refer to the new dropdown menus.
* Add a more generic title to the attach modal.

Fixes #33237.

git-svn-id: https://develop.svn.wordpress.org/trunk@36328 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-15 22:28:15 +00:00
Boone Gorges 7ee3e02d72 Correct documentation for `post_author` param of `WP_Comment_Query`.
Props chriscct7.
Fixes #35481.

git-svn-id: https://develop.svn.wordpress.org/trunk@36327 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-15 20:13:33 +00:00
Boone Gorges ac9e991dc8 Respect all post-related filters in `WP_Comment_Query`.
The refactor of `WP_Comment_Query`'s SQL generation in [34542] introduced a bug
that caused only the last post-related filter to be respected in comment
queries. In other words, if querying for comments using params
`post_status=draft&post_author=3`, only the last-processed of these params
would be respected. The current changeset fixes the logic so that these clauses
don't overwrite each other.

Props chriscct7.
Fixes #35478.

git-svn-id: https://develop.svn.wordpress.org/trunk@36326 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-15 20:09:36 +00:00
Rachel Baker 63e9eb7e5e Comments: Use TEXT column type in fallback for `wp_get_comment_column_max_length()`.
Fixes #10377.


git-svn-id: https://develop.svn.wordpress.org/trunk@36325 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-15 20:09:08 +00:00
Boone Gorges 50068ee5b9 Respect custom pagination params when using `wp_list_comments()` in a query loop.
[36157] fixed a problem, introduced in 4.4, that caused custom pagination
parameters passed to `wp_list_comments()`. However, the fix introduced in that
changeset was limited to the `is_singular()` context, so that the bug remained
when `wp_list_comments()` is used within a non-singular `WP_Query` loop. We
fix this by removing the `is_singular()` check and using the more general
`get_the_ID()` to identify the correct post_id to use for the secondary
comment query.

Fixes #35402.

git-svn-id: https://develop.svn.wordpress.org/trunk@36324 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-15 19:47:17 +00:00
Boone Gorges 4d17d22a47 Populate term cache with proper clone of term objects.
[34999] modified the cache strategy for terms in the context of
`wp_get_object_terms()`. As part of these changes, the `object_id` property of
term objects had to be unset before being cached. To avoid modifying passed-by-
reference terms, `update_term_cache()` attempted to make a copy of the terms
passed to the function; however, it failed to use the `clone` keyword, and thus
only created a reference instead of a copy.

Props berengerzyla.
Fixes #35462.

git-svn-id: https://develop.svn.wordpress.org/trunk@36323 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-15 19:34:16 +00:00
Pascal Birchler 03efa5ca83 Comments: Remove unneeded `$req` variable in `comments_template()`.
Props Latz.
Fixes #35473.

git-svn-id: https://develop.svn.wordpress.org/trunk@36322 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-15 19:32:23 +00:00
Pascal Birchler 20580bed82 Post: After [36319], add `$post` parameter to the `get_the_excerpt` filter.
Props sebastian.pisula.
Fixes #35474.

git-svn-id: https://develop.svn.wordpress.org/trunk@36321 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-15 19:27:57 +00:00
Pascal Birchler 13e7e78ddd Add tests missed and announced in [36319].
See #27246.

git-svn-id: https://develop.svn.wordpress.org/trunk@36320 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-15 14:49:54 +00:00
Pascal Birchler 57978063cf Posts: Add a `$post` parameter to `get_the_excerpt()`.
This allows getting the excerpt for a specific post, similar to how most other template tags work.
A deprecation notice is thrown if a boolean value is passed, which is deprecated since 2.3 and has not been used for a long time.
Adds unit tests.

Fixes #27246.

git-svn-id: https://develop.svn.wordpress.org/trunk@36319 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-15 14:47:00 +00:00
Pascal Birchler 63e442bbb8 Comments: Add a new `pre_wp_update_comment_count_now` filter.
This allows filtering a post's comment count before it is queried and updated in the database.

Props peterwilsoncc for initial patch.
Fixes #35060.

git-svn-id: https://develop.svn.wordpress.org/trunk@36318 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-15 13:41:35 +00:00
Eric Andrew Lewis cdae7b8214 Docs: Use "site" rather than "blog" in `get_current_blog_id()` docs.
Fixes #35415.


git-svn-id: https://develop.svn.wordpress.org/trunk@36317 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-15 13:17:08 +00:00
Pascal Birchler a111eafd41 Post Types: Introduce `unregister_post_type()`.
This new function can be used to completely unregister non built-in post types.

Fixes #14761.

git-svn-id: https://develop.svn.wordpress.org/trunk@36316 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-15 12:19:15 +00:00
Pascal Birchler 8e8cdb2ef4 Build Tools: Append the timestamp to `$wp_version` instead of only the current date.
This ensures the `Etag` header added in [36312] changes for every build.

Fixes #28722.

git-svn-id: https://develop.svn.wordpress.org/trunk@36315 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-15 11:53:29 +00:00
Dominik Schilling (ocean90) 57a589fef5 Docs: Fix `@return` type for `wp_get_current_user()` after [36313].
See #19615.

git-svn-id: https://develop.svn.wordpress.org/trunk@36314 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-15 11:15:51 +00:00
Pascal Birchler 40c948c1a6 Users: Always return `$current_user` in `wp_get_current_user()`, never a boolean.
Fixes unit tests affected by [36311].

See #19615.

git-svn-id: https://develop.svn.wordpress.org/trunk@36313 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-15 10:46:38 +00:00
Pascal Birchler 29147d223a Script Loader: Add `Etag: $wp_version` header in `load-scripts.php` and `load-styles.php`.
This improves performance since browsers won't re-download the scripts and styles when there was no change in `$wp_version`.

Props sergej.mueller, dd32, swissspidy.
Fixes #28722.

git-svn-id: https://develop.svn.wordpress.org/trunk@36312 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-15 10:22:24 +00:00
Pascal Birchler c7ae3fb3ee Users: Deprecate the `get_currentuserinfo()` pluggable function.
It encourages an ugly pattern like `global $userdata; get_currentuserinfo();` in plugins/themes. `wp_get_current_user()` should be used instead, e.g. `$current_user = wp_get_current_user();`.

Props scribu for initial patch.
Fixes #19615.

git-svn-id: https://develop.svn.wordpress.org/trunk@36311 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-15 10:15:21 +00:00