Commit Graph

34573 Commits

Author SHA1 Message Date
Joe McGill 726057bc41 Media: Add action to display attachments on the edit screen.
This adds a new action hook, `wp_edit_form_attachment_display` to
`edit_form_image_editor()`, which can be used as a fallback to render
previews of an attachment that isn't an image, audio, or video file
included in the media library.

Props georgestephanis.
Fixes #36502.

git-svn-id: https://develop.svn.wordpress.org/trunk@37879 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-26 22:37:00 +00:00
Drew Jaynes 095c705ffa Docs: Further improve the note of caution within the DocBlock description for `query_posts()`.
See #32246.


git-svn-id: https://develop.svn.wordpress.org/trunk@37878 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-26 18:05:22 +00:00
Drew Jaynes 6089491477 Docs: Add a note to the DocBlock for `query_posts()` to caution against general usage, including a pointer to the `pre_get_posts` action.
Also adds missing parameter and return descriptions.

See #32246.


git-svn-id: https://develop.svn.wordpress.org/trunk@37877 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-26 17:46:10 +00:00
Drew Jaynes 36e36e3b1d Docs: Make the DocBlock summary for `get_option()` more explicit and convert to using a third-person singular verb.
See #32246.


git-svn-id: https://develop.svn.wordpress.org/trunk@37876 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-26 17:28:30 +00:00
Jeremy Felt 269512cd6b Multisite: Remove unused `site_count` property from `WP_Site_Query`.
Related: [37837].

Props flixos90.
See #35791.


git-svn-id: https://develop.svn.wordpress.org/trunk@37875 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-26 14:32:07 +00:00
Jeremy Felt 90b85743a7 Multisite: Clear incomplete objects from cache in `get_blog_details()` when found.
In [37657], the `blog_id` and `site_id` properties were changed to private. Any `WP_Site` objects previously stored in cache with public properties should now be considered invalid. We can detect this by checking for these missing properties and clearing the dirty cache if found.

Props flixos90.
Fixes #36717.


git-svn-id: https://develop.svn.wordpress.org/trunk@37874 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-26 14:28:35 +00:00
Sergey Biryukov b28ca0f4b8 Comments: Remove the assignment of an undocumented `$comment_count` property in `WP_Comment_Query::get_comments()`, which appears to be accidentally introduced in [34544].
Props flixos90.
Fixes #37187.

git-svn-id: https://develop.svn.wordpress.org/trunk@37873 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-26 14:27:49 +00:00
Konstantin Kovshenin 9b536c37d4 Themes: Wrap unusually long theme names on the Theme Details screen.
Props xavortm
Fixes #37033


git-svn-id: https://develop.svn.wordpress.org/trunk@37872 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-26 14:19:31 +00:00
Jeremy Felt 8cde06c4e4 Multisite: Set `WP_Network` `blog_id` property default to string as expected.
The `blog_id` property is always returned (and expected) as a string, so we should set it as one by default.

Props flixos90.
See #36717.


git-svn-id: https://develop.svn.wordpress.org/trunk@37871 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-26 13:24:58 +00:00
Jeremy Felt 421888d9f4 Multisite: Change `WP_Network` `id` property to an integer.
For consistency and developer sanity.

Props flixos90.
Fixes #37050.


git-svn-id: https://develop.svn.wordpress.org/trunk@37870 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-26 13:22:36 +00:00
Jeremy Felt eb2ce329f1 Multisite: Cache `found_sites` and `max_num_pages` in `WP_Site_Query`.
This avoids a second uncached query used to determine found rows. Instead, we can cache the number of found sites and the max number of pages for reuse when the same query is requested in the future.

Props spacedmonkey.
See #35791.


git-svn-id: https://develop.svn.wordpress.org/trunk@37868 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-26 12:45:29 +00:00
Weston Ruter d3211979ae Customize: Always define functions `reflowPaneContents`, `findControlsForSettings`, and `_handleSettingValidities` on `wp.customize`.
Moves definitions of functions outside of a `jQuery.ready()` callback, as these functions needn't be deferred to DOM ready. This change also ensures that the functions are available if `customize-controls` is enqueued outside of the Customizer context, as the ready callback short-circuits if `_wpCustomizeSettings` is not defined. The `findControlsForSettings` and `_handleSettingValidities` functions were misplaced in r37700.

See #34893.
See #36944.
See #29071.


git-svn-id: https://develop.svn.wordpress.org/trunk@37867 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-26 11:54:20 +00:00
Peter Wilson 9ea1a7eb4f Posts: Fix back-compat for filters in get the modified time and date functions after [37738].
When no valid post exists for `get_the_modified_time` or `get_the_modified_date` calls, the result (`false`) is passed through the functions respective filters to maintain back-compat.

Introduces unit tests to ensure filters are applied and for the `get_the_modified_date` function.

Fixes #37059.


git-svn-id: https://develop.svn.wordpress.org/trunk@37866 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-26 11:29:13 +00:00
Sergey Biryukov 9853789382 Docs: Fix typo in `wp-includes/shortcodes.php` file description.
Props ixkaito.
Fixes #37175.

git-svn-id: https://develop.svn.wordpress.org/trunk@37865 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-26 10:14:08 +00:00
Sergey Biryukov 4a158e621d Database: Explicitly globalize `$wpdb` in `wp-settings.php` in case WordPress isn't loaded in global scope.
See [18993] for `$table_prefix`.

Props danielbachhuber.
Fixes #37123.

git-svn-id: https://develop.svn.wordpress.org/trunk@37864 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-26 10:05:20 +00:00
Drew Jaynes 8a7a62bb11 Docs: Add two simple usage examples to the DocBlock for `wp_redirect()`.
See #32246.


git-svn-id: https://develop.svn.wordpress.org/trunk@37863 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-26 07:45:31 +00:00
Drew Jaynes b36a6b44ed Docs: Improve the syntax and tensing within the DocBlock for `is_home()`.
See #32246.


git-svn-id: https://develop.svn.wordpress.org/trunk@37862 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-26 07:31:42 +00:00
Boone Gorges c97f234e6f Allow action and filter hooks to be deprecated.
When a filter or action hook is deprecated, the corresponding `apply_filters()`
or `do_action()` calls should be switched out with `apply_filters_deprecated()`
or `do_action_deprecated()`. The latter functions will throw a deprecation
before invoking the original hook.

Props solarissmoke, SergeyBiryukov, DrewAPicture.
Fixes #10441.

git-svn-id: https://develop.svn.wordpress.org/trunk@37861 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-25 19:56:19 +00:00
Boone Gorges 255aaa471e Fix orderby meta handling for `WP_Term_Query`.
In order to allow meta-related values of `orderby` to be handled properly,
the term query's `meta_query` object must run its `get_sql()` method before
`orderby` parsing.

Fixing this bug required addressing another bug in `WP_Meta_Query`, which
caused the table alias index not to be reset when calling `get_sql()`
multiple times on the same object.

Props littler.chicken.
Fixes #37151.

git-svn-id: https://develop.svn.wordpress.org/trunk@37860 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-25 16:22:55 +00:00
Gary Pendergast d4c360d186 Media: Prompt when deleting multiple items from the Media Library
We prompt when deleting a single item from the Media Library, but not when deleting multiple items. This inconsistency is now rectified.

Props southp.
Fixes #28235.



git-svn-id: https://develop.svn.wordpress.org/trunk@37859 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-24 15:55:26 +00:00
Pascal Birchler 044064dcce I18N: Remove HTML tags from translatable string in `wp-admin/maint/repair.php`.
Props anilbasnet.
Fixes #37147.

git-svn-id: https://develop.svn.wordpress.org/trunk@37858 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-23 16:11:47 +00:00
Pascal Birchler bdaede85d7 Posts: Add hooks for post sticky status changes.
This adds a new `post_stuck` action that fires when a post is made sticky and a `post_unstuck` action that fires when the sticky flag is removed again.

Props ojrask.
Fixes #35600.

git-svn-id: https://develop.svn.wordpress.org/trunk@37857 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-23 15:51:03 +00:00
Pascal Birchler 70693b520f Posts list table: Add a filter to disable the categories dropdown.
This allows one to short-circuit its output before any queries are run, similar to how it was done for the months dropdown in [31438].

Props davidmosterd for initial patch.
Fixes #36152.

git-svn-id: https://develop.svn.wordpress.org/trunk@37856 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-23 15:36:33 +00:00
Pascal Birchler d0555f9544 I18N: Enable unloading of text domains that have been loaded just in time.
[37415] removed the requirement to call `load_plugin_textdomain()` / `load_theme_textdomain()`. This caused `unload_textdomain()` to not work properly anymore in these cases.

With this change, unloaded text domains need to be explicitly loaded manually if you want to use them again.

Props swissspidy, ocean90.
Fixes #37113. See #34114.

git-svn-id: https://develop.svn.wordpress.org/trunk@37855 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-23 14:47:44 +00:00
Pascal Birchler 048bb7b250 Revisions: Remove unused post meta data during database upgrade.
Introduced in [23811], WordPress displayed some additional information for restored revisions for a short period of time. This was removed again in [25194], but the meta data was still being saved unnecessarily.

After 3 years and no plugins ever using this meta data, it's time to stop collecting it.

Fixes #36526.

git-svn-id: https://develop.svn.wordpress.org/trunk@37854 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-23 14:31:15 +00:00
Dominik Schilling (ocean90) a35a1a9c75 I18N: Add support for the Catalan flown dot in `remove_accents()`.
Props xavivars, SergeyBiryukov.
Fixes #37086.

git-svn-id: https://develop.svn.wordpress.org/trunk@37853 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-23 13:27:32 +00:00
Drew Jaynes f78e4becba Docs: Improve the formatting and usefulness of information in the DocBlock for `sanitize_text_field()`.
Also adds missing parameter and return descriptions.

See #32246.


git-svn-id: https://develop.svn.wordpress.org/trunk@37852 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-23 05:23:47 +00:00
Rachel Baker eadd8d0948 Utils: Update `wp.template` to match parameter changes to `_.template` in Underscore 1.8.3.
Removes passing a `null` value for the back-compat only `data` parameter to `_.template`.

Props jnylen0.
Fixes #36695. 



git-svn-id: https://develop.svn.wordpress.org/trunk@37851 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-23 02:29:15 +00:00
Jeremy Felt 5640b2b02c Multisite: Move call of `get_blog_details()` inside `ms_site_check()`.
This allows the `ms_site_check` filter or `is_super_admin()` check to return `true` before `get_blog_details()` is used.

Props danielbachhuber.
Fixes #37118.


git-svn-id: https://develop.svn.wordpress.org/trunk@37850 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-22 21:33:20 +00:00
Drew Jaynes 6b35519559 Docs: Add some missing changelog entries to the DocBlock for `add_theme_support()`.
Part props sirjonathan.
See #32246.


git-svn-id: https://develop.svn.wordpress.org/trunk@37849 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-22 14:24:28 +00:00
Drew Jaynes e2705a8718 Docs: Correct the `$request` parameter datatype in the hook doc for the `posts_request` filter.
It's a string, not an array.

Props coffee2code.
Fixes #37142.


git-svn-id: https://develop.svn.wordpress.org/trunk@37848 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-21 22:21:55 +00:00
Drew Jaynes 75351068df Bump version number for nightly builds.
git-svn-id: https://develop.svn.wordpress.org/trunk@37847 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-21 22:06:28 +00:00
Nikolay Bachiyski 8b0e466232 Admin: escape URL-encoded permalinks
git-svn-id: https://develop.svn.wordpress.org/trunk@37801 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-21 14:45:54 +00:00
Rachel Baker f28d567989 Revisions: Change the capability needed to view revision diffs to `edit_post`.
git-svn-id: https://develop.svn.wordpress.org/trunk@37779 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-21 14:19:26 +00:00
Nikolay Bachiyski 6e9a0fb948 Admin: Escape attachment name in case it contains special characters
git-svn-id: https://develop.svn.wordpress.org/trunk@37774 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-21 14:18:27 +00:00
Joe McGill 93cae978dd Media: Improve handling of extensionless filenames.
This ensures files retain a filename after sanitization.

Fixes 37111.

git-svn-id: https://develop.svn.wordpress.org/trunk@37756 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-21 13:43:59 +00:00
Joe McGill b428df51e5 Media: Restore keyboard navigation of the media grid.
This changes the binding of event listeners in the Attachments Browser
to use `on` instead of `listenTo` for the `attachment:keydown:arrow` and
`attachment:details:shift-tab` events. The existing listeners broke
when we upgraded Backbone in [36546].

Props adamsilverstein.
Fixes #36900.

git-svn-id: https://develop.svn.wordpress.org/trunk@37755 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-21 13:34:19 +00:00
Drew Jaynes ce565d2fb2 Docs: Clarify documentation for `wp_logout_url()` and `wp_login_url()` and corresponding hooks to highlight whether HTML-encoded or un-encoded values should be expected.
The return from `wp_logout_url()` is HTML-encoded due to its value passing through `wp_nonce_url()` and thus `esc_html()`. Adversely `wp_login_url()` passes through no such escaping and therefore should not be expected to return an HTML-encoded value.

Props akibjorklund for the initial patch.
Fixes #34352.


git-svn-id: https://develop.svn.wordpress.org/trunk@37753 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-20 08:47:20 +00:00
Drew Jaynes 01bfb1342b Docs: Improve the summaries and return descriptions for `get_registered_nav_menus()` and `get_nav_menu_locations()`.
Props rabmalin for the initial patch.
Fixes #37106.


git-svn-id: https://develop.svn.wordpress.org/trunk@37752 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-20 08:25:16 +00:00
Andrew Ozz 6304560fb7 Editor, link checker:
- Add white outline for contrast on darker backgrounds.
- Change red colour in toolbar.

Props iseulde. Props rockwell15 for the initial patch.
See #36638.

git-svn-id: https://develop.svn.wordpress.org/trunk@37751 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-19 13:00:30 +00:00
Pascal Birchler 6bf5465f67 Menus: Fix `_wp_expand_nav_menu_post_data()` for PHP 5.2.
[37748] introduced `_wp_expand_nav_menu_post_data()` together with an `array_replace_recursive()` compatibility function for PHP 5.2.
Even though that compat function is tried and tested in other projects like BuddyPress, we need to add additional `isset()` checks in order to avoid 'Undefined index' notices in our case.

See #36590.

git-svn-id: https://develop.svn.wordpress.org/trunk@37750 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-19 12:50:15 +00:00
Andrew Ozz 7e53f5e404 Grunt: when running `precommit` use regex to check which files have been modified.
Fixes #36528.

git-svn-id: https://develop.svn.wordpress.org/trunk@37749 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-19 12:31:15 +00:00
Pascal Birchler 3f050f87c3 Menus: Support nested array variables in POST data when saving menus.
[36510] allowed larger menus to be created in the Edit Menu screen by JSON-encoding the entire form into a single input field. However, it did not correctly handle nested arrays.

This introduces a new `_wp_expand_nav_menu_post_data()` helper function to handle this POST data which uses `array_replace_recursive()` internally. Since the latter is only available on PHP 5.3+, we add a compatibility function to ensure PHP 5.2 support.

Props ericlewis, neverything, swissspidy.
Fixes #36590 for trunk. See #14134.

git-svn-id: https://develop.svn.wordpress.org/trunk@37748 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-19 12:24:23 +00:00
Pascal Birchler d40f2eed2c Permalinks: Validate custom permalink structures.
Custom permalink structures require at least one valid structure tag, e.g. `%postname%`. If none is included, it would leave users with broken permalinks.
Let's make sure this won't happen by validating the permalink structure.

Adds unit tests.

Props rockwell15 for initial patch.
Fixes #35936.

git-svn-id: https://develop.svn.wordpress.org/trunk@37747 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-19 12:01:11 +00:00
Pascal Birchler db843d80ab L10n: Add unit tests for the `override_load_textdomain` filter.
Fixes #36398.

git-svn-id: https://develop.svn.wordpress.org/trunk@37746 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-18 10:09:26 +00:00
Pascal Birchler c3394e2c93 Embeds: Improve height calculation for slow loading images.
When the featured image takes longer to load, the browser might not know its exact dimensions yet and therefore sends an incorrect document height to the embedding site.

By sending the document's height again after the featured image has been loaded, we ensure that the iframe doesn't get cut off.

Fixes #35657.

git-svn-id: https://develop.svn.wordpress.org/trunk@37745 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-18 09:59:54 +00:00
Pascal Birchler ddd6c2d94d Embeds: Remove support for Google Video.
While the service has been retired for years, it now has completely stopped working. Thus there is no reason to keep it.

Props Viper007Bond.
Fixes #36304.

git-svn-id: https://develop.svn.wordpress.org/trunk@37744 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-18 09:46:17 +00:00
Rachel Baker cf783103fc Comments: Wrap or unwrap the List Table comment_date as comment status changes via Ajax.
Introduced in [36521].

Fixes #36742.
Props imath, adamsilverstein.

git-svn-id: https://develop.svn.wordpress.org/trunk@37743 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-17 21:47:58 +00:00
Andrea Fercia 090ecc34f9 Accessibility: Theme Installer, make the "Upload Theme" button... a button.
UI controls that "do something" on a page shouldn't be links. This link behaves
like a toggle to expand the uploader panel and should be a `button` element with
an aria-expanded attribute. Also:

- improves consistency with the Plugin uploader
- keeps the themes list visible when the uploader is open
- displays a notice when JavaScript is off
- adds some `hide-if-no-js` CSS classes
- removes the `themes.router.navigate()` "upload" route: seems unnecessary and breaks history

Fixes #35457.

git-svn-id: https://develop.svn.wordpress.org/trunk@37742 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-17 20:46:08 +00:00
Andrew Ozz faf7576562 Editor: after inserting a link detect if the URL is broken, first run.
Props iseulde, azaozz.
See #36638.

git-svn-id: https://develop.svn.wordpress.org/trunk@37741 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-17 20:40:04 +00:00