Commit Graph

29088 Commits

Author SHA1 Message Date
Scott Taylor 21568b8cc1 `detached` affects the `wp()` call for the media list table, so switch our new `$_GET` key to `detach`.
See #6820.


git-svn-id: https://develop.svn.wordpress.org/trunk@31624 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-05 15:58:02 +00:00
Boone Gorges c4e9c64233 Pinking shears in unit test files.
git-svn-id: https://develop.svn.wordpress.org/trunk@31623 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-05 13:14:28 +00:00
Boone Gorges 067fa3702e In PHPUnit test classes, `parent::tearDown()` should be the last thing done in `tearDown()` methods.
`WP_UnitTestCase::tearDown()` restores the test environment to the default
conditions, including rolling back the MySQL transaction that the test takes
place in, resetting globals, and unhooking test-specific filters. As such, all
teardown routines for specific tests should happen before the parent class's
`tearDown()` method is called. Failure to do so can cause database locks on
certain configurations, among other problems.

See #31537.

git-svn-id: https://develop.svn.wordpress.org/trunk@31622 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-05 13:14:15 +00:00
Andrew Ozz 889edda453 TinyMCE wpView: revert decoding of HTML entities. Doesn't work in old IE and needs to be more selective. Keep the change from `.html()` to `.text()` when getting the content of a node. See #31412.
git-svn-id: https://develop.svn.wordpress.org/trunk@31621 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-05 12:35:10 +00:00
Scott Taylor 4726669b3f Allow inline editing of `width` and `height` parameters while previewing an embed in the media modal:
* Use `wp.shortcode()` instead of manually constructing a shortcode in `views/embed/link`
* Allow a URL to transition to a shortcode (and vice versa) when returning an embed to TinyMCE
* In `WP_Embed`, store the last URL and last set of attributes requested in class properties
* `wp_ajax_parse_embed()`, allow `[embed]`s to have attributes. Return `attr` in the response.

This is a first pass to allow broad testing with recent MCE view changes. 

See #31139.


git-svn-id: https://develop.svn.wordpress.org/trunk@31620 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-05 05:59:10 +00:00
Scott Taylor 6c8322e8fa Allow attachments to be Detached from their parent in media grid and list modes.
See #6820.


git-svn-id: https://develop.svn.wordpress.org/trunk@31619 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-05 05:34:40 +00:00
Scott Taylor 26875b75a3 Media modules: set `$` to `Backbone.$`, instead of `jQuery`, so fewer globals are imported.
See #28510.


git-svn-id: https://develop.svn.wordpress.org/trunk@31618 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-05 04:11:23 +00:00
Boone Gorges 07abae914e In `get_next_comments_link()`, ensure proper pagination when no 'cpage' query var is found.
The 'cpage' query var is only set when using `comments_template()` to display
comments. If displaying them in a context where 'cpage' is not yet set, the
default value should be 1, not 0.

Props MomDad, couturefreak.
Fixes #20319.

git-svn-id: https://develop.svn.wordpress.org/trunk@31617 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-05 03:56:21 +00:00
Scott Taylor 18af27f550 [31468] reverted this in the 4.1 branch, also reverting in trunk.
See #30725.


git-svn-id: https://develop.svn.wordpress.org/trunk@31616 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-05 03:49:11 +00:00
Boone Gorges c1b30747d5 Respect `comment_date` and `comment_date_gmt` params in `wp_new_comment()`.
Props solarissmoke, oso96_2000.
Fixes #14279.

git-svn-id: https://develop.svn.wordpress.org/trunk@31615 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-05 02:59:47 +00:00
Boone Gorges 1ee4d99972 In `wp_get_attachment_url()`, convert to HTTPS when possible.
`wp_get_attachment_url()`, via `wp_upload_dir()`, uses 'siteurl' to generate
attachment URLs. When a site is SSL-optional on the front end - ie, 'siteurl'
is non-HTTPS, but SSL is available - a number of situations can arise where
non-HTTPS attachment URLs cause browser mixed-content warnings:

a) SSL is forced in the admin and `wp_get_attachment_url()` is used to generate the `<img>` tag for an inserted image. In these cases, the post content will contain non-HTTPS. Viewing/editing this post in the Dashboard will result in non-HTTPS images being served in an SSL environment.
b) `wp_get_attachment_url()` is used in a theme to generate an `<img>` `src` attribute on a public page. When viewing that page over SSL, the images will have HTTP URLs.

This changeset switches attachment URLs to HTTPS when it's determined that the
host supports SSL. This happens when 'siteurl' is non-SSL, but the current page
request *is* over SSL, and the host of the current request matches the host of
the URL being generated.

Props joemcgill, boonebgorges.
Fixes #15928.

git-svn-id: https://develop.svn.wordpress.org/trunk@31614 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-05 02:38:59 +00:00
Andrew Ozz bd69086dcb PressThis: remove the extra .length tests for strings from press-this.js.
Props stephdau, see #31373.

git-svn-id: https://develop.svn.wordpress.org/trunk@31613 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-04 21:00:52 +00:00
Andrew Ozz 5433303166 TinyMCE wpView: decode HTML entities before trying to insert view markers. Props iseulde. See #31412.
git-svn-id: https://develop.svn.wordpress.org/trunk@31612 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-04 20:34:35 +00:00
Helen Hou-Sandi 6b94742b72 Autocomplete: Update CSS based on both jQuery UI and general visual changes.
props rodrigosprimo for the initial patch.
fixes #31427.


git-svn-id: https://develop.svn.wordpress.org/trunk@31611 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-04 20:23:29 +00:00
Helen Hou-Sandi c4673e8c79 List tables: Display front and posts page indicators.
fixes #30190.


git-svn-id: https://develop.svn.wordpress.org/trunk@31610 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-04 19:44:22 +00:00
Andrew Ozz f9a6a7aa56 PressThis:
- Improve handling of the data, both from the bookmarklet and from server-side parsing.
- Standardize on processing the data in PHP and remove duplicate code from JS.
- Improve the bookmarklet code and remove pre-filtering of the data.
Part props stephdau, see #31373.

git-svn-id: https://develop.svn.wordpress.org/trunk@31609 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-04 19:28:53 +00:00
Drew Jaynes 44f0a2976a Correct a typo in the hash notation for `wp_insert_user()`: The argument name should be `$user_registered` not `$date_registered`.
Props floriansimeth.
Fixes #31513.


git-svn-id: https://develop.svn.wordpress.org/trunk@31608 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-04 09:50:34 +00:00
Helen Hou-Sandi 1c9b51a3e6 Remove the once-placeholder-esque "tag hint", which has not worked in quite some time.
It's not particularly useful, and adds visual noise when in place.

props welcher.
fixes #31485.


git-svn-id: https://develop.svn.wordpress.org/trunk@31607 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-03 21:52:35 +00:00
Andrew Ozz 6505f70ffb wpLink: fix the logic for prepending `http://` and trim the input.
Props iseulde. See #18149.

git-svn-id: https://develop.svn.wordpress.org/trunk@31606 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-03 21:20:35 +00:00
Helen Hou-Sandi dfe924ab99 Fix some inline doc typos that were missed in [31604]. see #25698.
git-svn-id: https://develop.svn.wordpress.org/trunk@31605 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-03 21:17:22 +00:00
Helen Hou-Sandi 84ec54e07e Nav menus: Better JS performance on initial load of edit screen.
The accessibility helpers previously processed all items when editing a menu, which was quite slow to the point of being unresponsive for large menus. They now only process items when they are expanded or a user comes near them in some way, such as hover or focus.

Also simplifies a redundant set of click event handlers down to one, which further enhances performance.

props atimmer, sevenspark.
fixes #25698.


git-svn-id: https://develop.svn.wordpress.org/trunk@31604 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-03 21:13:37 +00:00
Sergey Biryukov d9cd7a141c Themes: Avoid jumping when selecting a feature in the feature filter on Add Themes screen.
props abhishekfdd.
fixes #31497.

git-svn-id: https://develop.svn.wordpress.org/trunk@31603 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-03 19:46:27 +00:00
Andrew Ozz fc26b777dd wpLink:
- Prepend 'http://' to pasted URLs.
- Do not prepend it when typing an URL.
- Do not prepend it when pasting the same URL for the second time (trying to correct wrong guess).
Props iseulde. Fixes #18149.

git-svn-id: https://develop.svn.wordpress.org/trunk@31602 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-03 00:00:42 +00:00
Andrew Ozz 0b962e2238 Press This:
- Remove classes from suggested HTML for the editor.
- Improve the filter, pass an associative array as param.
- Use <em> instead of <cite>.
Props Michael-Arestad, kraftbj. Fixes #31493.

git-svn-id: https://develop.svn.wordpress.org/trunk@31601 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-02 23:40:13 +00:00
Drew Jaynes 340fa25658 Properly indent the hash notation of default arguments for `wp_page_menu()`.
See #28841.


git-svn-id: https://develop.svn.wordpress.org/trunk@31600 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-02 06:15:36 +00:00
Drew Jaynes 7b0e13670d Clean up and refine DocBlocks for a variety of functions and methods in wp-admin/includes/template.php.
* Also documents the default arguments of `wp_terms_checklist()` as a hash notation.

Props ipm-frommen, DrewAPicture.
Fixes #31248.


git-svn-id: https://develop.svn.wordpress.org/trunk@31599 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-02 06:10:08 +00:00
Andrew Ozz 7c516ad964 PressThis: fix and update buttons styles. Props Michael-Arestad. Fixes #31498.
git-svn-id: https://develop.svn.wordpress.org/trunk@31598 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-02 01:17:26 +00:00
Andrew Ozz 701d97b6d5 PressThis: make sure buttons.css is loaded before press-this.css. Use (int) $post_ID instead of $post->ID.
See #31373.

git-svn-id: https://develop.svn.wordpress.org/trunk@31597 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-02 00:57:34 +00:00
Andrew Ozz 2d19a3b446 PressThis:
- Replace all `%1$s` and `%2$s` in suggestedHTML in case plugins repeat them.
- Fix docs typo, props kraftbj.
See #31373.

git-svn-id: https://develop.svn.wordpress.org/trunk@31596 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-01 23:28:00 +00:00
Andrew Ozz aee04ab9a3 PressThis:
- Simplify `getSuggestedContent()` and helpers. No need to override the global `data`.
- Replace the `press_this_source_string` and `press_this_source_link` filters with `press_this_suggested_html` that allows filtering of the link and the wrapper HTML tags.
See #31373.

git-svn-id: https://develop.svn.wordpress.org/trunk@31595 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-01 22:43:36 +00:00
Andrew Ozz 0778a17875 Add `wp.a11y.speak()` for audible alerts/updates in screen readers. Props afercia, GrahamArmfield (for the idea), iseulde. Fixes #31368.
git-svn-id: https://develop.svn.wordpress.org/trunk@31594 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-01 19:10:58 +00:00
Drew Jaynes 753b3c6d38 Fix a typo in the `$args` parameter hash notation description for `add_settings_field()`.
See #28975, [31592].


git-svn-id: https://develop.svn.wordpress.org/trunk@31593 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-01 07:56:18 +00:00
Drew Jaynes 9013a5d088 Add a hash notation for the optional `$args` parameter in `add_settings_field()`, which includes a description for the new `$class` argument added in [31560].
Also adds a changelog entry to `add_settings_field()` DocBlock for the new `$class` argument.

See [31560].
Fixes #28975.


git-svn-id: https://develop.svn.wordpress.org/trunk@31592 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-01 07:52:46 +00:00
Drew Jaynes 79a3048412 Adjust the description for the `$extra_attr` argument in the DocBlocks for `get_avatar_data()` and `get_avatar()`.
See [31561]. See #31469.


git-svn-id: https://develop.svn.wordpress.org/trunk@31591 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-01 07:18:42 +00:00
Drew Jaynes c2d677a4a4 Add an entry to the changelog for `wp_get_mime_types()` mentioning that GIMP (xcf) file support was added in 4.2.
See [31578].
Fixes #31146.


git-svn-id: https://develop.svn.wordpress.org/trunk@31590 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-01 07:09:48 +00:00
Andrew Ozz cc3b0374ae PressThis:
- Remove unneeded passing of post formats strings to JS.
- Set the currently selected post format name with jQuery.
See #31373.

git-svn-id: https://develop.svn.wordpress.org/trunk@31589 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-28 20:07:45 +00:00
Dominik Schilling (ocean90) 91694337df Press This: Backwards compatibility enhancements.
* Add missing actions for printing styles/scripts.
* Since `$hook_suffix` is null, hardcode `press-this.php`.
* Restore body classes, add filter.
* Use boolean value instead of `__return_false()`.
* Use `wp_json_encode()`.
* Update docs for filters in script-loader.php.
* Make `<a href="%1$s">%2$s</a>` not translatable.

see #31373.

git-svn-id: https://develop.svn.wordpress.org/trunk@31588 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-28 10:35:27 +00:00
Gary Pendergast d258490653 When sanitizing a URL to redirect to, UTF-8 characters can be URL encoded, instead of being removed.
While RFC 3986 does not specify which character sets are allowed in URIs, Section 2.5 states that octects matching UTF-8 character encoding should be percent-encoded, then unreserved octets outside of the UTF-8 range should be percent-encoded. As browsers tend to only implement support for UTF-8 in URLs, this change only implements the UTF-8 encoding part. We may revisit the second part if it becomes an issue.

Fixes #31486



git-svn-id: https://develop.svn.wordpress.org/trunk@31587 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-28 02:20:52 +00:00
Andrew Ozz eb28f78cd3 TinyMCE wpView: update the "update" method. Props iseulde. See #31412.
git-svn-id: https://develop.svn.wordpress.org/trunk@31586 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-27 22:28:58 +00:00
Scott Taylor dc6246a548 In the `Insert From URL` state of the `Post` frame, add the necessary CSS for focus styles for images.
Example image to insert: https://flic.kr/p/rnsm5M 

See #28820.


git-svn-id: https://develop.svn.wordpress.org/trunk@31585 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-27 22:12:52 +00:00
Andrew Ozz c904f0f61e PressThis: when there is a protocol mismatch (http vs. https), use server-side media detection instead of submitting a form as it triggers "Unsafe data" warning in some browsers. Props stephdau. Fixes #31468.
git-svn-id: https://develop.svn.wordpress.org/trunk@31584 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-27 22:05:51 +00:00
Andrew Ozz a6bb04bd41 PressThis: fix selecting a post format (radio buttons) with the keyboard. Props afercia, Michael-Arestad. Fixes #31440.
git-svn-id: https://develop.svn.wordpress.org/trunk@31583 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-27 21:52:55 +00:00
Scott Taylor a46c2462da When viewing media in List mode, auto-submit the form for attachment filters when the value of a `<select>` changes. This makes it behave similar to Grid mode and "feels" more performant, even though it is a full page load.
Fixes #30333.


git-svn-id: https://develop.svn.wordpress.org/trunk@31582 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-27 21:26:42 +00:00
Boone Gorges 22179be8ca Introduce 'get_object_terms' filter in `wp_get_object_terms()`.
The existing 'wp_get_object_terms' filter accepts a parameter `$taxonomies`,
which is a list of taxonomy names formatted for direct use in a MySQL IN clause.
This formatting makes it difficult to make use of the taxonomy list in filter
callbacks. However, changing the parameters passed to the existing filter
raises backward compatibility concerns, so we introduce a new filter that
receives a structured `$taxonomy_array` parameter.

We also take this opportunity to correct and clean up some of the documentation
on the 'wp_get_object_terms' filter.

Props postpostmodern, doublesharp, wonderboymusic, nacin.
Fixes #18828.

git-svn-id: https://develop.svn.wordpress.org/trunk@31581 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-27 20:30:13 +00:00
Andrew Ozz c4adfac1b9 PressThis TinyMCE: set 'directionality' and add the LTR button when in RTL. Fixes #31474.
git-svn-id: https://develop.svn.wordpress.org/trunk@31580 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-27 20:20:31 +00:00
Dominik Schilling (ocean90) 4e7a4deca6 Build: Let RTLCSS handle swapping the codes for right/left arrows from Dashicons.
Exclude `wp-includes/css/dashicons.css` from core task since we don't want/need a RTL version of it.

fixes #31478.

git-svn-id: https://develop.svn.wordpress.org/trunk@31579 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-27 20:18:05 +00:00
Scott Taylor 7656a776af Support GIMP files in the Media Library. We already support Photoshop files.
Props MikeHansenMe.
Fixes #31146.


git-svn-id: https://develop.svn.wordpress.org/trunk@31578 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-27 19:46:19 +00:00
Dominik Schilling (ocean90) 964ba03e97 Press This: RTL improvements.
* Load the RTL version of press-this-editor.css.
* Use more semantic class names for the arrows, Makes it easier to swap the arrows in RTL, see #31478.

see #31474.

git-svn-id: https://develop.svn.wordpress.org/trunk@31577 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-27 19:43:33 +00:00
Scott Taylor fed3b8fd1f In the `->multi_resize()` method of the `WP_Image_Editor` subclasses, when looping through potential crops, we need to make sure the crop isn't the exact same dimensions as the original image before copying it as a new crop.
This ensures that we don't save multiple copies of the same image.

Supposedly broke in [30639], but this logic was always missing. When I tested reverting [30639], there were still 2 files being created.

Fixes #31296.


git-svn-id: https://develop.svn.wordpress.org/trunk@31576 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-27 19:37:47 +00:00
Scott Taylor 212d6d8046 Make a new function, `wp_delete_file()`. Use it.
Props scribu, wonderboymusic.
Fixes #17864.


git-svn-id: https://develop.svn.wordpress.org/trunk@31575 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-27 16:50:14 +00:00