Commit Graph

34751 Commits

Author SHA1 Message Date
Dominik Schilling (ocean90)
970b7c43ab HTTP: Add unit tests for wp_get_http_headers() and wp_remote_retrieve_headers().
Props borgesbruno, jipmoors.
Fixes #37090.

git-svn-id: https://develop.svn.wordpress.org/trunk@37907 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-29 12:46:59 +00:00
Andrew Ozz
faa1a087e3 TinyMCE, inline link dialog:
- Reset the internal state when doing `unlink`, pressing `Escape`, and clicking elsewhere in the editor.
- Add the unlink shortcut from the wplink plugin as it triggers the new `wp_unlink` command.

Fixes #36781, #36732, #37153.

git-svn-id: https://develop.svn.wordpress.org/trunk@37906 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-29 09:41:50 +00:00
Rachel Baker
0e6a328782 REST API: Include a refreshed nonce in a X-WP-Nonce header when responding to an authenticated request.
Props adamsilverstein, welcher, markjaquith, aidvu.
Fixes #35662.




git-svn-id: https://develop.svn.wordpress.org/trunk@37905 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-29 03:00:54 +00:00
Rachel Baker
e81a5da327 Customize: Text change on Widgets and Menus screens for buttons directing users to the Customizer.
"Manage in Customizer" -> "Manage with Live Preview".

Props patilswapnilv and noahsilverstein.
Fixes #37159.




git-svn-id: https://develop.svn.wordpress.org/trunk@37904 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-29 02:09:46 +00:00
Rachel Baker
9e9adb0bfe REST API: Include auto-discovery Link header when serving API requests.
The Link header allows clients to verify if a site has made the REST API available, as well as indicating how to access it.

Props danielbachhuber.
Fixes #35580.




git-svn-id: https://develop.svn.wordpress.org/trunk@37903 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-29 01:56:32 +00:00
Dominik Schilling (ocean90)
a6d5755af0 I18N: Make "That's all, stop editing! Happy blogging." translatable.
The string is used during the network installation process to inform the user about where to store additional configuration data. Since the wp-config.php file can be translated the string should be too.

Props julesaus.
Fixes #36945.

git-svn-id: https://develop.svn.wordpress.org/trunk@37902 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-28 23:23:40 +00:00
Dominik Schilling (ocean90)
3fff76a15f Customize: Improve flow from menu locations to editing a menu.
Adds an Edit button beside the menu location to allow users to switch to the selected menu for further edits.

Props celloexpressions.
Fixes #36795.

git-svn-id: https://develop.svn.wordpress.org/trunk@37901 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-28 23:06:22 +00:00
Dominik Schilling (ocean90)
c174aa2b6f Customize: Link "widget areas" to widgets panel in menu locations section description.
Props celloexpressions.
Fixes #36796.

git-svn-id: https://develop.svn.wordpress.org/trunk@37900 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-28 22:43:31 +00:00
Jeremy Felt
2e9bb996b9 Multisite: Add a ms_sites_list_table_query_args filter to WP_MS_Sites_List_Table.
This allows a developer to filter the arguments used to query sites during the `prepare_items()` method.

Props flixos90.
Fixes #26580.


git-svn-id: https://develop.svn.wordpress.org/trunk@37899 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-28 22:25:33 +00:00
Jeremy Felt
d790268b48 KSES: Add list-style-type to the list of allowed CSS attributes.
Props azaozz.
Fixes #35877.


git-svn-id: https://develop.svn.wordpress.org/trunk@37898 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-28 22:09:55 +00:00
Jeremy Felt
cc87a1a7f9 KSES: Adjust the list of safecss attributes for readability.
Props azaozz.
See #35877.


git-svn-id: https://develop.svn.wordpress.org/trunk@37897 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-28 22:05:08 +00:00
Jeremy Felt
204dedb99a Multisite: Replace wp_get_network() internals with get_network().
`get_network()` should be considered a replacement for `wp_get_network()`.

Props flixos90.
Fixes #32504.


git-svn-id: https://develop.svn.wordpress.org/trunk@37896 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-28 21:28:48 +00:00
Jeremy Felt
d93bc1943c Multisite: Introduce get_networks().
`get_networks()` is a wrapper for `WP_Network_Query`.

Props flixos90.
See #32504.


git-svn-id: https://develop.svn.wordpress.org/trunk@37895 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-28 21:27:41 +00:00
Jeremy Felt
d277dd8ef1 Multisite: Introduce WP_Network_Query.
Provides a consistent way to query `$wpdb->site` for `WP_Network` objects based on domain, path, network ID, and (main) site ID.

Introduces and uses update_network_cache() and _prime_network_caches() to maintain a cached list of WP_Network objects for use in multiple queries.

Props flixos90.
See #32504.


git-svn-id: https://develop.svn.wordpress.org/trunk@37894 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-28 21:26:48 +00:00
Jeremy Felt
7de7b36b9f Multisite: Introduce get_network().
Given a network ID or network object, `get_network()` retrieves network data in the same vein as `get_site()` or `get_post()`. This will allow for clean retrieval of networks from a primed cache when `WP_Network_Query` is implemented.

Props flixos90.
See #32504.


git-svn-id: https://develop.svn.wordpress.org/trunk@37893 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-28 21:17:30 +00:00
Pascal Birchler
41b39bae16 Embeds: Add tests for the WP_Embed class.
Fixes #37214. See #34115.

git-svn-id: https://develop.svn.wordpress.org/trunk@37892 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-28 20:30:15 +00:00
Dominik Schilling (ocean90)
267d165ae4 External Libraries: Update Masonry to 3.3.2 and imagesLoaded to 3.2.0.
Also split imagesLoaded and Masonry into separate files so imagesLoaded can be used independently.

Diff Masonry: https://github.com/desandro/masonry/compare/v3.1.4...v3.3.2
Diff imagesLoaded: https://github.com/desandro/imagesloaded/compare/v3.1.4...v3.2.0

Props Ninos Ego, grapplerulrich.
Fixes #32802.

git-svn-id: https://develop.svn.wordpress.org/trunk@37891 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-28 18:47:01 +00:00
Dominik Schilling (ocean90)
bded47a1b6 Posts: Introduce WP_Post_Type and use it in register_post_type() and unregister_post_type().
This changes the global `$wp_post_types` to an array of `WP_Post_Type` objects. `WP_Post_Type` includes methods to handle post type supports, rewrite rules, meta boxes, hooks, and taxonomies.
Each post type argument becomes a property of `WP_Post_Type`.

Props swissspidy, flixos90.
Fixes #36217.

git-svn-id: https://develop.svn.wordpress.org/trunk@37890 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-28 16:40:33 +00:00
Dominik Schilling (ocean90)
78eb45a959 I18N: Move the WP_Locale class to its own file.
The new `class-wp-locale.php` file is loaded in `locale.php` for backward compatibility purposes.

See #26511.
Fixes #37209.

git-svn-id: https://develop.svn.wordpress.org/trunk@37889 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-28 11:52:45 +00:00
Dominik Schilling (ocean90)
a196640640 Comments: Improve author and content of the default comment.
The new comment:

> A WordPress Commenter <!wapuu@wordpress.example>:
>
> Hi, this is a comment.
> To moderate comments, just log in. There you will have the option to edit or delete them.
> Commenter avatars come from <a href="!https://gravatar.com">Gravatar</a>.

Also introduces a network setting to set the email address of the first comment author on a new site.

Props Ipstenu, rachelbaker, jorbin, jeremyfelt.
Fixes #36702, #14268.

git-svn-id: https://develop.svn.wordpress.org/trunk@37888 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-28 10:02:19 +00:00
Dominik Schilling (ocean90)
607641864f External Libraries: Update MediaElement.js to 2.21.2.
Includes a fix for broken YouTube embeds in Firefox.

Changelog: https://github.com/johndyer/mediaelement/blob/2.21.1/changelog.md
Diff: https://github.com/johndyer/mediaelement/compare/2.18.1...2.21.1

Props swissspidy.
Fixes #36759.

git-svn-id: https://develop.svn.wordpress.org/trunk@37887 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-28 09:25:14 +00:00
Drew Jaynes
eec7c2432a Docs: Improve formatting and syntax of the defaullt label docs in the DocBlock for get_post_type_labels().
See #32246.


git-svn-id: https://develop.svn.wordpress.org/trunk@37886 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-28 07:17:19 +00:00
Drew Jaynes
730d562648 Docs: Add a more complete $labels parameter description to the DocBlock for register_post_type().
Directly references `get_post_type_labels()` for the full list of supported labels.

See #32246.


git-svn-id: https://develop.svn.wordpress.org/trunk@37885 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-28 06:41:23 +00:00
Drew Jaynes
d150e9e54f Docs: Improve the $post_type parameter description in the DocBlock for register_post_type().
See #32246.


git-svn-id: https://develop.svn.wordpress.org/trunk@37884 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-28 06:36:24 +00:00
Drew Jaynes
e80747265f Docs: Add more complete documentation for the $supports argument in register_post_type().
See #32246.


git-svn-id: https://develop.svn.wordpress.org/trunk@37883 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-28 06:31:05 +00:00
Drew Jaynes
8a9b76d0aa Docs: Improve the usefulness, accuracy, and syntax of the register_post_type() DocBlock summary and description.
See #32246.


git-svn-id: https://develop.svn.wordpress.org/trunk@37882 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-28 06:26:40 +00:00
Dominik Schilling (ocean90)
f147b02783 Nav Menus: Use WP_Query for quick searches.
`the_post()` sets the `$in_the_loop` property to true which is unexpected in the admin if you're using filters which should only affect real loops.

Props ruud@joyo.
Fixes #27042.

git-svn-id: https://develop.svn.wordpress.org/trunk@37881 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-27 11:50:31 +00:00
Joe McGill
2705524260 Docs: Add missing variable reference for wp_edit_form_attachment_display.
This adds the missing `$post` reference in the inline docblock for
the `wp_edit_form_attachment_display` hook after [37879].

Props DrewAPicture.
See 36052.

git-svn-id: https://develop.svn.wordpress.org/trunk@37880 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-27 01:53:23 +00:00
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