Commit Graph

32364 Commits

Author SHA1 Message Date
Konstantin Obenland 7e923cc0fe Template: Add fallback for empty containers.
Since [14031] the container can be omitted in `wp_nav_menu()`. It can not
however in `wp_page_menu()`, which creates a conflict if it is set as
the fallback, Let's make sure there is always a valid container tag.

Fixes #33974.



git-svn-id: https://develop.svn.wordpress.org/trunk@34950 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-08 18:26:13 +00:00
Sergey Biryukov ab296be565 REST API: Add some missing documentation.
Props swissspidy.
Fixes #34215.

git-svn-id: https://develop.svn.wordpress.org/trunk@34949 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-08 18:00:45 +00:00
Helen Hou-Sandi df1b726ed0 Buttons: Update styles and colors.
* Aligns with the color standards. See https://make.wordpress.org/design/handbook/foundations/colors/
* Creates a consistent interaction experience between states.
* Improves contrast and accessibility.

props hugobaeta, afercia, melchoyce, michael-arestad.
fixes #31459.


git-svn-id: https://develop.svn.wordpress.org/trunk@34948 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-08 17:30:57 +00:00
Boone Gorges a1389117b2 Allow a null `id` to do a `name` lookup in `wp_set_current_user()`.
Previously, the `name` fallback was failing in the case where the current user
was 0, due to a loose comparison between 0 (the current user) and `null` (the
value that is used to trigger the `name` fallback).

Props bobbingwide.
Fixes #20845.

git-svn-id: https://develop.svn.wordpress.org/trunk@34947 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-08 17:28:34 +00:00
John Blackbourn 17e2841eea Improve the parameter names and inline documentation for `add_rewrite_rule()`, `WP_Rewrite::add_rule()`, and `WP_Rewrite::add_external_rule()`.
Fixes #34197


git-svn-id: https://develop.svn.wordpress.org/trunk@34946 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-08 17:27:05 +00:00
Boone Gorges 5c496e841a Add tests for current behavior of `wp_set_current_user()`.
See #20845.

git-svn-id: https://develop.svn.wordpress.org/trunk@34945 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-08 17:19:00 +00:00
Drew Jaynes 4dc569f748 Docs: Fix third-person singular verbs in DocBlock summaries throughout `WP_Rewrite`.
See #34218.


git-svn-id: https://develop.svn.wordpress.org/trunk@34944 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-08 17:11:52 +00:00
Sergey Biryukov 017e097daf Add `wp_load_translations_early()` to `wpdb::check_connection()`.
Fixes #29306. See #34216.

git-svn-id: https://develop.svn.wordpress.org/trunk@34943 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-08 17:10:58 +00:00
Sergey Biryukov 9a80bffdb3 Split database error messages into separate strings to remove unnecessary HTML tags from translations.
Add translator comments for placeholders.

Fixes #34216.

git-svn-id: https://develop.svn.wordpress.org/trunk@34942 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-08 16:51:50 +00:00
Drew Jaynes ee6b1ae7c8 Docs: Relocate some more DocBlock-level `@see` tags and add some missing `@access` tags in `WP_Rewrite`.
See #34218.


git-svn-id: https://develop.svn.wordpress.org/trunk@34941 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-08 16:50:52 +00:00
Drew Jaynes e0dd9fa33a Docs: Relocate some DocBlock-level `@see` tags in `WP_Rewrite`.
See #34218.


git-svn-id: https://develop.svn.wordpress.org/trunk@34940 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-08 16:48:04 +00:00
Drew Jaynes ac7ef64dde Docs: Remove invalid inline `@link` tags from a variety of DocBlocks in `WP_Rewrite`.
See #34218.


git-svn-id: https://develop.svn.wordpress.org/trunk@34939 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-08 16:46:16 +00:00
Drew Jaynes 60a5a56f40 Docs: Add a file header to wp-includes/class-wp-rewrite.php.
See #34218.


git-svn-id: https://develop.svn.wordpress.org/trunk@34938 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-08 16:40:11 +00:00
Dominik Schilling (ocean90) 4b897ef9d4 Embeds: Update `$wp_db_version` to flush rewrite rules for [34903].
Fixes #34209.

git-svn-id: https://develop.svn.wordpress.org/trunk@34937 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-08 11:11:11 +00:00
Dominik Schilling (ocean90) f771be9e2c Term Meta: Prevent a "Multiple primary key defined" error during database upgrades.
You must have two spaces between the words `PRIMARY KEY` and the definition of your primary key. Yes, seriously.

See [34529].
Fixes #34210.

git-svn-id: https://develop.svn.wordpress.org/trunk@34936 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-08 11:08:15 +00:00
Gary Pendergast 633a9870dd Posts: Add the `pre_get_lastpostmodified` filter to `get_lastpostmodified()`.
This allows `get_lastpostmodified()` to be short circuited when the site wants to avoid running the occasionally slow queries in `_get_last_post_time()`.

Fixes #34205.



git-svn-id: https://develop.svn.wordpress.org/trunk@34935 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-08 05:56:57 +00:00
Boone Gorges 9c9cdf28ca Allow excluded keywords when searching posts.
Pass a keyword with a leading hyphen to exclude posts containing that keyword.
For example, 'taco -onions' will return posts that contain the word 'taco' but
do not contain the word 'onions'.

Props akibjorklund.
Fixes #33988.

git-svn-id: https://develop.svn.wordpress.org/trunk@34934 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-08 03:17:22 +00:00
John Blackbourn ba7dc01639 Abstract the shortcode attribute parsing regex into its own function, update the JavaScript counterpart, and introduce a test to ensure they do not diverge again.
Fixes #34191
Props miqrogroove, johnbillion


git-svn-id: https://develop.svn.wordpress.org/trunk@34933 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-08 03:11:59 +00:00
John Blackbourn 9b156ee2a9 Correctly set the `secure` flag on the post password cookie based on the scheme of the referring URL, if it's available, instead of the home URL.
Fixes #29641


git-svn-id: https://develop.svn.wordpress.org/trunk@34932 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-08 03:08:05 +00:00
John Blackbourn 855991c578 Correctly set the `secure` flag for the test cookie based on the login URL scheme, and the same for the user settings cookies based on the admin URL scheme.
Fixes #34159


git-svn-id: https://develop.svn.wordpress.org/trunk@34931 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-08 03:04:41 +00:00
Ryan McCue 1e223ff16b REST API: Add missing reference to WP_HTTP_Response
See #33982


git-svn-id: https://develop.svn.wordpress.org/trunk@34930 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-08 02:39:06 +00:00
Ryan McCue 007e7b8cd4 REST API: Unbreak everything.
Obviously, it wouldn't have been a good commit unless I botched it.

See #33982.


git-svn-id: https://develop.svn.wordpress.org/trunk@34929 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-08 02:33:51 +00:00
Ryan McCue b39211475d REST API: Introduce baby API to the world.
Baby API was born at 2.8KLOC on October 8th at 2:30 UTC. API has lots
of growing to do, so wish it the best of luck.

Thanks to everyone who helped along the way:

Props rmccue, rachelbaker, danielbachhuber, joehoyle, drewapicture,
adamsilverstein, netweb, tlovett1, shelob9, kadamwhite, pento,
westonruter, nikv, tobych, redsweater, alecuf, pollyplummer, hurtige,
bpetty, oso96_2000, ericlewis, wonderboymusic, joshkadis, mordauk,
jdgrimes, johnbillion, jeremyfelt, thiago-negri, jdolan, pkevan,
iseulde, thenbrent, maxcutler, kwight, markoheijnen, phh, natewr,
jjeaton, shprink, mattheu, quasel, jmusal, codebykat, hubdotcom,
tapsboy, QWp6t, pushred, jaredcobb, justinsainton, japh, matrixik,
jorbin, frozzare, codfish, michael-arestad, kellbot, ironpaperweight,
simonlampen, alisspers, eliorivero, davidbhayes, JohnDittmar, dimadin,
traversal, cmmarslender, Toddses, kokarn, welcher, and ericpedia.

Fixes #33982.


git-svn-id: https://develop.svn.wordpress.org/trunk@34928 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-08 02:30:18 +00:00
Ryan McCue 374b39d6ba REST API: Add wp_is_numeric_array helper function
The API uses this to do special operations on list responses (used
for collections), so we need to detect whether an array is
associative or numeric-indexed.

After much discussion, the bikeshed is to be painted green and gold.

See #33982.


git-svn-id: https://develop.svn.wordpress.org/trunk@34927 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-08 02:13:02 +00:00
Ryan McCue 0f657d21cc REST API: Add JsonSerializable compatibility to wp_json_encode
Following on from r34845, the JsonSerializable shim needs support
on the encoding side too. _wp_json_prepare_data handles this when
we've loaded the shim.

Props chriscct7.

See #33982. 


git-svn-id: https://develop.svn.wordpress.org/trunk@34926 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-08 01:29:50 +00:00
John Blackbourn 88779c7b67 Revert [34917] until the broken test is fixed.
See #13382


git-svn-id: https://develop.svn.wordpress.org/trunk@34925 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-08 01:03:39 +00:00
Dion Hulse ebbe91ad8d Revert [34922] pending PHP 5.2 compatibility.
See #28633


git-svn-id: https://develop.svn.wordpress.org/trunk@34924 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-08 00:16:07 +00:00
Sergey Biryukov 6cc5757f10 Reset Password: Move the code for creating password reset key into a new function, `get_password_reset_key()`, and use it in `retrieve_password()`.
Previously: [25231].

Props DH-Shredder.
Fixes #34180.

git-svn-id: https://develop.svn.wordpress.org/trunk@34923 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-08 00:10:41 +00:00
Dion Hulse ffb7ae1389 Use PHP7's `random_int()` CSPRNG functionality in `wp_rand()` with a fallback to the `random_compat` library for PHP 5.x.
`random_compat` offers a set of compatible functions for older versions of PHP, filling in the gap by using other PHP extensions when available.
We still include our existing `wp_rand()` functionality as a fallback for when no proper CSPRNG exists on the system.

Props sarciszewski
See #28633


git-svn-id: https://develop.svn.wordpress.org/trunk@34922 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-08 00:01:26 +00:00
Sergey Biryukov 1fc41894d2 Customizer: Replace context for two strings added in [30306] with a translator comment.
Fixes #34203.

git-svn-id: https://develop.svn.wordpress.org/trunk@34921 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-07 23:53:35 +00:00
John Blackbourn 4046919a11 Avoid stripping square brackets from URLs, and instead correctly encode them. Square brackets must be encoded in the path, path parameters, query parameters, and fragment, but must not be encoded in anything up to the domain and port.
Adds tests.

Fixes #16859


git-svn-id: https://develop.svn.wordpress.org/trunk@34920 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-07 23:38:22 +00:00
Boone Gorges f9f92b223d Handle `WP_User` objects properly in `update_user_caches()`.
We should not be storing the `WP_User` object in the cache, as it may contain
usermeta and other data that's cache elsewhere.

Props dd32.
See #24635.

git-svn-id: https://develop.svn.wordpress.org/trunk@34919 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-07 22:41:07 +00:00
Boone Gorges e1d7108e79 Add tests for `update_user_caches()`.
See #24635.

git-svn-id: https://develop.svn.wordpress.org/trunk@34918 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-07 22:34:32 +00:00
John Blackbourn ee251924b3 Pass the `$post` parameter to the `_wp_post_revision_fields` filter. This provides more context to the filter, which allows for different fields to be displayed on the revisions screen depending on the post.
The `_wp_post_revision_fields()` function now also accepts a `WP_Post` object (in addition to an array of post fields) to facilitate this change.

Fixes #13382
Props adamsilverstein


git-svn-id: https://develop.svn.wordpress.org/trunk@34917 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-07 21:52:18 +00:00
John Blackbourn e40575aa99 Correctly set the scheme of the `home` and `siteurl` options when creating a new site on multisite that uses some combination of HTTPS in the admin area or on the front end.
Fixes #33620
Props tryon, johnbillion


git-svn-id: https://develop.svn.wordpress.org/trunk@34916 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-07 21:45:17 +00:00
John Blackbourn 6705184dcc Correctly encode the `url` parameter that gets passed to WordPress' own oEmbed endpoint URL.
Fixes #34193
Props ocean90


git-svn-id: https://develop.svn.wordpress.org/trunk@34915 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-07 21:42:36 +00:00
John Blackbourn b877e3c692 Add an optional `$description` parameter to `status_header()` so custom HTTP status descriptions can be provided.
Fixes #21472
Props nbachiyski, iamfriendly


git-svn-id: https://develop.svn.wordpress.org/trunk@34914 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-07 21:25:54 +00:00
Andrea Fercia 8483316de5 Bump H3 headings to H2 on the Network Admin > Sites > Edit Site screens.
The navigation tabs appear in an `<h3>` heading immediately following the main `<h1>` and need to have a proper hierarchy.
Also, fix the tabs focus style and introduce a new `.nav-tab-small` CSS class.

Fixes #34079.

git-svn-id: https://develop.svn.wordpress.org/trunk@34913 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-07 17:34:56 +00:00
Jeremy Felt 599fb50e09 Revert [34778], continue using `_site_option()` for the current network.
The `_network_option()` parameter order will be changing to accept `$network_id` first. The `_site_option()` functions will remain in use throughout core as our way of retrieving a network option for the current network.

See #28290.


git-svn-id: https://develop.svn.wordpress.org/trunk@34912 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-07 17:11:01 +00:00
Drew Jaynes 9a704fa0b8 Docs: Improve documentation for `post_submit_meta_box()`, which serves as the display callback for the 'Publish' meta box.
* `$post` is now correctly defined as being of the `WP_Post` type
* Adds a hash notation for the `$args` array
* Other minor fixes.

Props drebbitsweb.
Fixes #34171.


git-svn-id: https://develop.svn.wordpress.org/trunk@34911 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-07 16:33:52 +00:00
John Blackbourn 61280672d2 Prevent a PHP notice when POSTing to `wp-login.php?action=register` without a `user_login` or `user_email` field in the POST request.
Fixes #34192


git-svn-id: https://develop.svn.wordpress.org/trunk@34910 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-07 14:42:39 +00:00
John Blackbourn c4dd769f22 Prevent a PHP notice from appearing on `wp-login.php?action=postpass` when there's no `$_POST['post_password']` parameter. Redirects to the referer if there is one (if there isn't one it'll just exit with a blank screen; no need for a user-friendly error message here).
Fixes #34160
Props iamfriendly


git-svn-id: https://develop.svn.wordpress.org/trunk@34909 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-07 14:29:29 +00:00
Dominik Schilling (ocean90) 7f292f7ba4 Embeds: Autoprefixer for [34903].
See #32522.

git-svn-id: https://develop.svn.wordpress.org/trunk@34908 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-07 14:06:36 +00:00
John Blackbourn 13e8899262 Update the explanatory text which accompanies the list of whitelisted oEmbed providers, following the change to the default value of the `discover` argument in `WP_oEmbed::get_provider()`.
See #32522


git-svn-id: https://develop.svn.wordpress.org/trunk@34907 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-07 13:04:32 +00:00
Gary Pendergast 46fbcc96fd Build: Fix a filename typo in [34903].
Props peterwilsoncc.

See #32522.



git-svn-id: https://develop.svn.wordpress.org/trunk@34906 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-07 12:04:39 +00:00
Gary Pendergast 7c508ff9fa Tests: Exclude the `oembed/headers.php` test file, which was marked as PHP >= 5.3.0 in [34904].
See #32522.



git-svn-id: https://develop.svn.wordpress.org/trunk@34905 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-07 12:00:34 +00:00
Gary Pendergast a170c1f67e Embeds: After [34903], remove an accidentally included text domain, and exclude a test failing in PHP 5.2.
git-svn-id: https://develop.svn.wordpress.org/trunk@34904 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-07 11:00:59 +00:00
Gary Pendergast 43bd3d46c9 Embeds: Add oEmbed provider support.
For the past 6 years, WordPress has operated as an oEmbed consumer, allowing users to easily embed content from other sites. By adding oEmbed provider support, this allows any oEmbed consumer to embed posts from WordPress sites.

In addition to creating an oEmbed provider, WordPress' oEmbed consumer code has been enhanced to work with any site that provides oEmbed data (as long as it matches some strict security rules), and provides a preview from within the post editor.

For security, embeds appear within a sandboxed iframe - the iframe content is a template that can be styled or replaced entirely by the theme on the provider site.

Props swissspidy, pento, melchoyce, netweb, pfefferle, johnbillion, extendwings, davidbinda, danielbachhuber, SergeyBiryukov, afercia

Fixes #32522.



git-svn-id: https://develop.svn.wordpress.org/trunk@34903 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-07 10:35:18 +00:00
Jeremy Felt cce73768b3 Tests: Remove static capture of space used and space allowed.
Originally introduced in [34601], this was necessary to avoid test pollution. Now that things have been separated and written to play nicely, we can remove this.

See #34037.


git-svn-id: https://develop.svn.wordpress.org/trunk@34902 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-07 07:24:47 +00:00
Jeremy Felt dadd89575f Tests: Improve tests for `upload_is_user_over_quota()`.
* Move all tests to a new 'multisite/uploadIsUserOverQuota.php'
* Use `get_space_allowed` and `pre_get_space_used` filters to help avoid test pollution.

See #34037.


git-svn-id: https://develop.svn.wordpress.org/trunk@34901 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-07 07:20:45 +00:00