`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
* 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
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
`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
- 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
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
- 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
- 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
* 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
- 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
- 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
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
- 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
* 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
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
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
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
* 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
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