Commit Graph

2201 Commits

Author SHA1 Message Date
John Blackbourn
87c1b26ee7 Docs: Correct various documentation around object and stdClass types.
See #37770


git-svn-id: https://develop.svn.wordpress.org/trunk@38369 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-26 16:48:17 +00:00
Scott Taylor
4de1595d47 i18n: move is_rtl() to l10n.php (which loads way earlier). Load WP_Locale file in wp-settings.php. Retire wp-includes/locale.php - it only loaded the class and the one function, is_rtl(). If someone loaded this file for fun somewhere else, it would be a fatal error.
See #37827.


git-svn-id: https://develop.svn.wordpress.org/trunk@38364 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-26 10:19:26 +00:00
Scott Taylor
1ff3356d22 OEmbed: move _wp_oembed_get_object() to embed.php, where all of the other embed functions live. WP_oEmbed is then in a file by itself. Load class-oembed.php in wp-settings.php and remove extraneous include calls.
See #37827.


git-svn-id: https://develop.svn.wordpress.org/trunk@38361 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-26 09:48:32 +00:00
Scott Taylor
a02d79cf73 Site Icon: There is no good reason for class-wp-site-icon.php to drop a global instance of itself whenever the file is loaded. The lone use of the global instance of WP_Site_Icon is in an AJAX action that provides virtually no way to override - the file is loaded immediately before the global is used.
Let us remove the `$wp_site_icon` global. I will fall on the sword if this comes back to bite us (waiting with bated breath).

See #37699.


git-svn-id: https://develop.svn.wordpress.org/trunk@38355 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-25 19:08:38 +00:00
Scott Taylor
3aee745492 AJAX: add a new function, wp_doing_ajax(), which can replace... (wait for it...) DOING_AJAX checks via the constant.
Props Mte90, sebastian.pisula, swissspidy.
Fixes #25669.


git-svn-id: https://develop.svn.wordpress.org/trunk@38334 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-23 14:32:18 +00:00
Scott Taylor
b1de6df8b4 Media: remove function_exists() call for ini_get() in _load_image_to_edit_path().
Props dd32.
Fixes #37681.


git-svn-id: https://develop.svn.wordpress.org/trunk@38333 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-23 14:23:41 +00:00
Sergey Biryukov
afd7e3b16d I18N: Allow for WordPress Plugin/Theme Directory URLs to be localized.
Props ramiy.
Fixes #37501.

git-svn-id: https://develop.svn.wordpress.org/trunk@38325 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-23 01:18:53 +00:00
Sergey Biryukov
e408cbe86d I18N: Replace unnecessary context with a translator comment for %s Sites string in network_step1().
Props ramiy.
Fixes #37777.

git-svn-id: https://develop.svn.wordpress.org/trunk@38323 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-23 00:16:43 +00:00
Scott Taylor
46d7304d4a Nav Menus: remove unnecessary variable assignment in wp_nav_menu_item_post_type_meta_box().
See #37771.


git-svn-id: https://develop.svn.wordpress.org/trunk@38311 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-22 20:57:41 +00:00
Drew Jaynes
b4fca4a558 Hooks: Standardize naming of dynamic hooks to use interpolation vs concatenation.
Benefits gained in discoverability and self-documentation throughout core trump the negligible performance hit in using interpolation in hook names.

Props ramiy.
See #37748.


git-svn-id: https://develop.svn.wordpress.org/trunk@38307 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-22 18:24:48 +00:00
Scott Taylor
45cd115bf6 Media: add a function, wp_get_additional_image_sizes(), that wraps the retrieval of the global $_wp_additional_image_sizes. Removes 6 global imports.
See #37699.


git-svn-id: https://develop.svn.wordpress.org/trunk@38303 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-22 04:36:42 +00:00
Scott Taylor
d911ef44dc Media: when calling pathinfo(), also pass a PATHINFO_* constant to avoid array notices for unset keys.
Props JaworskiMatt.
Fixes #37608.


git-svn-id: https://develop.svn.wordpress.org/trunk@38294 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-20 23:35:50 +00:00
John Blackbourn
e784e65d68 Permalinks: Correct the documentation for the get_sample_permalink filter, and improve the documentation for the get_sample_permalink() function.
Props sebastian.pisula for the original patch
Fixes #37682


git-svn-id: https://develop.svn.wordpress.org/trunk@38272 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-17 18:29:47 +00:00
Drew Jaynes
19a85950ad Docs: Add a period missed in an argument description in [38253] for #36338.
git-svn-id: https://develop.svn.wordpress.org/trunk@38254 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-13 17:43:42 +00:00
Drew Jaynes
77aa4a8b72 Docs: Add documentation for all arguments accepted by export_wp().
Props theMikeD for the initial patch.
Fixes #36338.


git-svn-id: https://develop.svn.wordpress.org/trunk@38253 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-13 17:42:05 +00:00
Dominik Schilling
1ca2426e77 Upgrader: Rename class-wp-automatic-upgrader.php to class-wp-automatic-updater.php.
The class is named `WP_Automatic_Updater` not `WP_Automatic_Upgrader` like all the other upgrader classes. 

Introduced in [37409].
See #37628.

git-svn-id: https://develop.svn.wordpress.org/trunk@38242 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-10 19:50:18 +00:00
Andrew Ozz
a0a6262f17 Update/Install error messages: do not escape from the template, escape the error message string before inserting it.
Props swissspidy, ocean90.
Fixes #37623 for trunk.

git-svn-id: https://develop.svn.wordpress.org/trunk@38240 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-10 19:02:09 +00:00
Dominik Schilling
3844065c1a Media: In _wp_handle_upload() use call_user_func_array() to call the upload error handler.
The default error handler `wp_handle_upload_error()` expects a reference for the first parameter but `call_user_func()` doesn't pass parameters by reference. The current code didn't produce any issues until now. PHP 7.0.9 (and PHP 7.1) is now stricter and prevents calling the error handler with a warning:
> PHP Warning:  Parameter 1 to wp_handle_upload_error() expected to be a reference, value given.

To restore the error handler `_wp_handle_upload()` now uses `call_user_func_array()`.

Props jbrinley.
Props jorbin for review.
Fixes #37570.

git-svn-id: https://develop.svn.wordpress.org/trunk@38235 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-09 21:53:12 +00:00
Dominik Schilling
dfed8d47a6 Dashboard: Don't escape widget titles in screen reader text.
Introduced in [37972]. The title for the Quick Draft widget contains HTML to provide a JS/no-JS version.

Props SergeyBiryukov for review.
See #37595.
Fixes #37594.

git-svn-id: https://develop.svn.wordpress.org/trunk@38225 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-09 09:06:15 +00:00
Aaron Jorbin
7044243aa2 Updates: Improve experience for Bulk Actions when FTP is dismissed.
Before this change, when a bulk update was canceled due dismissing the FTP credentials modal, part of the actions didn't get canceled.  This meant the "There is a new version of…” notices become blank and the updates you had checked became unchecked.  Now, the notices remain and you are essentially returned to the screen you had before. Strings are also updated to improve ARIA usage.

Fixes #37563.
Props ocean90, swissspidy, obenland, afercia.



git-svn-id: https://develop.svn.wordpress.org/trunk@38221 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-09 01:13:08 +00:00
Dominik Schilling
a02d4c4a16 Update/Install: Replace "error" and "-1" failure messages with a more meaningful one.
* "-1" is an invalid nonce error, show 'An error has occurred. Please reload the page and try again.'.
* "error" means that the connection to the server was lost, show 'Connection lost or the server is busy. Please try again later.'.
* Escape the message in `wp-updates-admin-notice` because the response may include HTML.
* Remove HTML tags in `wp.updates.isValidResponse()` to make PHP's error messages more readable.

Props azaozz for review.
Fixes #37583.

git-svn-id: https://develop.svn.wordpress.org/trunk@38205 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-05 19:27:56 +00:00
John Blackbourn
5cc963a721 Docs: Correct and clarify various @since docs.
Fixes #37562


git-svn-id: https://develop.svn.wordpress.org/trunk@38201 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-04 22:53:40 +00:00
Dominik Schilling
152fba56cc Upgrade/Install: Make some install/update failures more verbose.
An upgrader class is used in conjunction with an upgrader skin class. A skin class handles the logging for an upgrade and informs a user about the progress and failures.
The current Ajax install/update handlers are using the `Automatic_Upgrader_Skin` class because during an Ajax request no output is intended. The difference between Ajax updates and automatic updates is that you will see the full log (usually by email) while Ajax updates focus only on success or failure. For that `Automatic_Upgrader_Skin` has one disadvantage: It doesn't provide a way to retrieve failure messages which were passed through `WP_Upgrader_Skin::error()` by the upgrader.
To solve this issue a new skin `WP_Ajax_Upgrader_Skin` has been introduced. The skin extends `Automatic_Upgrader_Skin` and overrides the `error()` and `feedback()` methods to intercept all errors, which can be a `WP_Error` object or a string.

This updates all four Ajax handler for installing/updating themes/plugins to use the new skin. They now also check the skin for any intercepted errors and pass them on to the user.

Props flixos90, obenland, ocean90.
Props DrewAPicture, pento for review.
Fixes #37531.

git-svn-id: https://develop.svn.wordpress.org/trunk@38199 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-04 22:17:44 +00:00
Aaron Jorbin
10906c673f Updates: Improve bulk update failure notice
When doing a bulk update, if there are failures the user needs to know about that. This makes it clearer that you can click on the notification to see more details, especially for screen reader users.

Fixes #37510.
Props  juhise, Ankit K Gupta, afercia, jorbin, ocean90. 



git-svn-id: https://develop.svn.wordpress.org/trunk@38185 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-03 22:23:50 +00:00
Dominik Schilling
dbe140910b Plugins: Use install_plugins_upload action to print the upload form.
Since [37221] the upload form is added to every plugin install screen via `install_plugins_upload()`. Previously the form was added through the `install_plugins_upload` (alias of `install_plugins_$tab`) action which allowed plugin authors to replace the form. This restores the previous behaviour.

* Add the form only to non-upload plugin install screens.
* Replace `install_plugins_upload()` with the `install_plugins_upload` and `install_plugins_pre_upload` actions.
* Remove `$upload_tab_class` and add a CSS class for the current tab to `.wrap`
* Adjust CSS selectors and toggle the whole container to support upload without an `upload-plugin` class.

Props DavidAnderson, ocean90.
Fixes #37495.

git-svn-id: https://develop.svn.wordpress.org/trunk@38172 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-31 18:10:45 +00:00
Dominik Schilling
af6b1a5388 Plugins: Move capability checks further up in wp_ajax_update_plugin() and wp_ajax_delete_plugin().
Add tests for both Ajax handlers.

Props Yorick Koster, swissspidy.
Fixes #37490.

git-svn-id: https://develop.svn.wordpress.org/trunk@38168 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-27 17:42:01 +00:00
Dominik Schilling
d097c1d916 Filesystem API: Output buffering for request_filesystem_credentials() should wrap the function directly.
Previously `ob_end_clean()` was only called when the previous condition was successful which led to unexpected results when another output buffering was involved, like PHPUnit's.

Fixes #37488.

git-svn-id: https://develop.svn.wordpress.org/trunk@38167 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-27 17:09:27 +00:00
Andrew Ozz
d16d808d8b TinyMCE, inline link:
- Remove proxying through WordPress to test if an URL exists.
- Fix and enhance the regex that tests if the URL is well formed.

Fixes #36638.

git-svn-id: https://develop.svn.wordpress.org/trunk@38159 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-26 23:23:21 +00:00
Dominik Schilling
076cbcdb71 Filesystem API: Prevent an endless self-calling loop in wp_tempnam().
Under certain conditions upgrades on Windows may fail because `wp_tempnam()` gets called in a loop.
This can happen when `wp_tempnam()` is called with `\.maintenance` for the `$filename` parameter. The function strips the extension, in this case `.maintenance`, which results in an empty filename. Because it's empty, `wp_tempnam()` calls itself with `dirname( '\.maintenance' )`. On *nix systems this would be `"/"` which allows `wp_tempnam()` to fall back on `time()`. But on Windows it's `"\"`.

This change adds the backslash to the list of characters which allow `wp_tempnam()` to fall back on `time()`.

See [32322], [31936].
Fixes #33999.

git-svn-id: https://develop.svn.wordpress.org/trunk@38151 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-25 15:27:43 +00:00
Sergey Biryukov
cc9e4262ca Plugins: Add a missing space between classes on <td> element for custom columns of the Plugins list table.
Props crstauf.
Fixes #37460.

git-svn-id: https://develop.svn.wordpress.org/trunk@38149 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-25 13:27:42 +00:00
Sergey Biryukov
22b3bdc333 Posts, Post Types: Remove a redundant function_exists( 'mb_strlen' ) check in get_sample_permalink_html().
`mb_strlen()` is always available since [32114].

See #30633.

git-svn-id: https://develop.svn.wordpress.org/trunk@38147 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-23 13:04:47 +00:00
Dominik Schilling
6f5f178e8c List Table: Improve WP_Plugins_List_Table::search_box() which was added in [38033].
* Update DocBlock to use third-person singular verb and to include a period at the end.
* Use `submit_button()` for the submit button.
* Escape the ID attribute.
* Apply the same to `WP_List_Table::search_box()`.

See #37230.

git-svn-id: https://develop.svn.wordpress.org/trunk@38146 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-23 10:58:23 +00:00
Sergey Biryukov
65ba451f5b Docs: Update the description of the $box argument of wp_nav_menu_item_taxonomy_meta_box() for consistency with [38129].
Missed in [38130].

See #37211.

git-svn-id: https://develop.svn.wordpress.org/trunk@38142 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-22 16:50:01 +00:00
Dominik Schilling
0780b19984 Plugins: Make search field placeholder translatable.
See #37230.

git-svn-id: https://develop.svn.wordpress.org/trunk@38141 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-22 14:50:22 +00:00
Dominik Schilling
ec783d67b9 Docs: Fix minor formatting issue for a comment added in [38113].
See #32171.

git-svn-id: https://develop.svn.wordpress.org/trunk@38139 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-22 13:45:33 +00:00
Dominik Schilling
92231118dd Filesystem API: Change the default value for the $context parameter of get_filesystem_method() and request_filesystem_credentials() to an empty string.
`$context` is a full path to the directory that is tested for being writable. A path shouldn't be a boolean value.
This also updates `WP_Upgrader_Skin::request_filesystem_credentials()` and `Automatic_Upgrader_Skin::request_filesystem_credentials()` and adds missing docs.

Props DrewAPicture, ocean90.
Fixes #37412.


git-svn-id: https://develop.svn.wordpress.org/trunk@38138 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-22 12:09:55 +00:00
Dominik Schilling
b19f91f4bb Post Thumbnails: Remove an unused nonce in _wp_post_thumbnail_html().
See #12922.



git-svn-id: https://develop.svn.wordpress.org/trunk@38137 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-22 11:43:36 +00:00
Dominik Schilling
4fd98bb5ed Media: Remove global import for $content_width in _wp_post_thumbnail_html().
`$content_width` is unused since [35023].

See #28512.

git-svn-id: https://develop.svn.wordpress.org/trunk@38136 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-22 11:39:28 +00:00
Dominik Schilling
db037aad34 Docs: Change type of WP_Upgrader_Skin::$result to 'string|bool|WP_Error'.
`$result` can be `true` too, see `Language_Pack_Upgrader::bulk_upgrade()`.

See #32246.

git-svn-id: https://develop.svn.wordpress.org/trunk@38134 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-22 10:42:35 +00:00
Sergey Biryukov
0c1b988a63 Docs: In meta box functions, clarify that "Meta box ID" refers to the id attribute of the meta box and not a numeric ID.
Fixes #37211.

git-svn-id: https://develop.svn.wordpress.org/trunk@38131 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-21 19:23:56 +00:00
Sergey Biryukov
58e390d1ac Menus: In wp_nav_menu_item_taxonomy_meta_box():
* Rename the `$taxonomy` parameter to `$box` for clarity and consistency with other meta box functions.
* Make the docs more consistent with `post_categories_meta_box()` and other meta box functions.

See #37211.

git-svn-id: https://develop.svn.wordpress.org/trunk@38130 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-21 19:20:50 +00:00
Sergey Biryukov
48f6fddb49 Menus: In wp_nav_menu_item_post_type_meta_box():
* Rename the `$post_type` parameter to `$box` for clarity and consistency with other meta box functions.
* Make the docs more consistent with `post_format_meta_box()` and other meta box functions.
* Correct type and description for the third argument of `nav_menu_items_{$post_type_name}_recent` filter.

See #37211.

git-svn-id: https://develop.svn.wordpress.org/trunk@38129 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-21 19:18:36 +00:00
Sergey Biryukov
068ecc915c Docs: Correct and expand the docs for the $taxonomy argument of wp_nav_menu_item_taxonomy_meta_box().
Props mehulkaklotar for initial patch.
See #37211.

git-svn-id: https://develop.svn.wordpress.org/trunk@38128 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-21 18:00:41 +00:00
Sergey Biryukov
1db7b8441a Docs: Correct and expand the docs for the $post_type argument of wp_nav_menu_item_post_type_meta_box().
Props mehulkaklotar for initial patch.
See #37211.

git-svn-id: https://develop.svn.wordpress.org/trunk@38127 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-21 17:59:52 +00:00
Andrew Ozz
fb1fbcfdc0 TinyMCE, link check:
- Use `wp.a11y.speak()` to announce bad URLs.
- Do not add a title to the link toolbar.
- Better error message.

Props afercia, azaozz.
See #36638.

git-svn-id: https://develop.svn.wordpress.org/trunk@38126 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-21 03:41:17 +00:00
Dominik Schilling
44676ab38f Plugins: Improve Ajax search of new plugins.
Fixes a few accessibility issues, restores the "Search Results" tab and the search type selector, and improves compatibility with older browsers.

Props rahulsprajapati, swissspidy, adamsilverstein, ocean90
See #37233.

git-svn-id: https://develop.svn.wordpress.org/trunk@38119 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-20 16:31:50 +00:00
Joe McGill
2586eeeeca Post Thumbnails: Only update featured images when saving a post.
Previously, changing the post thumbnail of a published post in the edit screen
would immediately apply the change, rather than waiting for the post to be
saved before applying the update. This could lead to someone unintentionally
editing the post thumbnail on a published post, and made it impossible to
preview changes to post thumbnails on published posts before saving the change.

This introduces a new Ajax handler, `wp_ajax_get_post_thumbnail_html()` to
retrieve the HTML for the post thumbnail meta box without updating the post
meta value for `_thumbnail_id`. It also allows post thumbnail changes to be
previewed by passing the `_thumbnail_id` as a query variable to the preview
screen and adding a new filter, `_wp_preview_post_thumbnail_filter()`, which
gets applied to `get_post_metadata` during the post preview process.

Props flixos90.
Fixes #12922.

git-svn-id: https://develop.svn.wordpress.org/trunk@38118 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-20 16:23:36 +00:00
Mike Schroder
ffb2db0521 Media: Clean up prior image edits if IMAGE_EDIT_OVERWRITE is true.
When `IMAGE_EDIT_OVERWRITE` is set to true, edited image files are
supposed to be deleted when an image is restored to the original.

However, when an image was edited more than once, and then restored,
files created during previous edits were left behind.

Fixes this behavior by updating `wp_save_image()` to clean up
leftover images after each edit when `IMAGE_EDIT_OVERWRITE` is true.

Props bradt, chriscct7, joemcgill.
Fixes #32171.

git-svn-id: https://develop.svn.wordpress.org/trunk@38113 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-20 07:34:54 +00:00
Sergey Biryukov
79e7fca981 Permalinks: In wp_install_maybe_enable_pretty_permalinks():
* Use `get_page_by_path()` instead of a hardcoded ID, which may not always exist.
* Remove the "test against a random 404 page" part, which is no longer relevant after [34442].

Fixes #36628.

git-svn-id: https://develop.svn.wordpress.org/trunk@38109 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-19 23:11:25 +00:00
Dominik Schilling
b9606d3c4a Filesystem API: Ensure memory limit calculations by PclZip are using integers.
This prevents a warning in PHP trunk, see https://wiki.php.net/rfc/invalid_strings_in_arithmetic.

See #36435.

git-svn-id: https://develop.svn.wordpress.org/trunk@38101 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-19 11:54:09 +00:00