Commit Graph

1612 Commits

Author SHA1 Message Date
Felix Arntz
e4550efbb7 Multisite: Return get_current_blog_id() value instead of hard-coded 1 in get_main_site_id() for non-multisite environments.
See #41936.

Built from https://develop.svn.wordpress.org/trunk@41862


git-svn-id: http://core.svn.wordpress.org/trunk@41696 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-14 22:46:48 +00:00
Felix Arntz
5ea3d62192 Multisite: Take WP_Network::$blog_id into account in get_main_site_id().
When the `WP_Network::$blog_id` property is set manually, for example in the multisite bootstrap process, `get_main_site_id()` should use that value instead of running its own logic. The main logic for the function was therefore moved into the internal `WP_Network::get_main_site_id()` method, which is now being accessed by the function through the magic property handling for `WP_Network::$blog_id` (and its equivalent `WP_Network::$site_id`).

Props spacedmonkey, jeremyfelt.
Fixes #41936.

Built from https://develop.svn.wordpress.org/trunk@41861


git-svn-id: http://core.svn.wordpress.org/trunk@41695 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-14 22:42:54 +00:00
John Blackbourn
50948669eb Users: Revert [41613], [41614], and [41623] as this feature needs some more work.
See #38741

Built from https://develop.svn.wordpress.org/trunk@41753


git-svn-id: http://core.svn.wordpress.org/trunk@41587 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-04 22:17:46 +00:00
John Blackbourn
f9a5f5485d I18N: Allow the login screen language to be specified via a wp_lang query variable, and use this for the interim login modal.
This allows users who are using the admin area in a language other than the site language to read the notice on the login screen
(which explains that they need to log in again) in their chosen language.

Props Nikschavan, swissspidy

Fixes #40205

Built from https://develop.svn.wordpress.org/trunk@41692


git-svn-id: http://core.svn.wordpress.org/trunk@41526 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-02 23:21:47 +00:00
Gary Pendergast
0028a9555e Database: Don't quote placeholders in queries going through $wpdb->prepare()
To bring Core into line with the changes to `$wpdb->prepare()` in WordPress 4.8.2, query placeholders shouldn't be quoted.

Props jrf, johnjamesjacoby.
Fixes #41983.


Built from https://develop.svn.wordpress.org/trunk@41628


git-svn-id: http://core.svn.wordpress.org/trunk@41463 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-28 04:32:46 +00:00
John Blackbourn
255658fa31 Users: There is not, in fact, 12345 users on every WordPress installation.
Props spacedmonkey

See #38741

Built from https://develop.svn.wordpress.org/trunk@41614


git-svn-id: http://core.svn.wordpress.org/trunk@41449 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-27 13:07:46 +00:00
John Blackbourn
807bc5a6c9 Users: Introduce the concept of a large site in order to speed up the Users screen when there are many users.
Calling the `count_users()` function is expensive, regardless of the counting strategy that's used, and it gets
slower the more users there are on a site. In order to speed up the Users screen in the admin area, calling
`count_users()` can be avoided entirely while still displaying the total count for users.

This introduces some new functions:

* `wp_is_large_user_count()`
* `wp_get_active_user_count()`
* `wp_update_active_user_count()`

A corresponding `wp_is_large_user_count` filter is also introduced.

Props tharsheblows, johnbillion

Fixes #38741

Built from https://develop.svn.wordpress.org/trunk@41613


git-svn-id: http://core.svn.wordpress.org/trunk@41448 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-27 13:04:47 +00:00
Weston Ruter
3abea17301 Customize: Add wp_is_uuid() validation function with optional second $version=4 parameter to enforce v4 random UUIDs.
Props jonathanbardo.
Fixes #39778.

Built from https://develop.svn.wordpress.org/trunk@41388


git-svn-id: http://core.svn.wordpress.org/trunk@41221 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-18 23:04:44 +00:00
Felix Arntz
f2d9abd022 Multisite: Introduce get_main_site_id().
This function can be used to easily get the main site ID of a given network via the optional `$network_id` parameter, which defaults to the current network. The existing `is_main_site()` now uses the new function internally and now accepts an optional `$network_id` parameter as well.

The main purpose of the new function at this point is to ensure that the `WP_Network::$blog_id` property is always set. Magic getters in the class have been adjusted to auto-fill the property when it is accessed and empty. Furthermore the function encapsulates logic that was previously part of `ms_load_current_site_and_network()` and has been replaced with a call to the function now.

Props spacedmonkey, jeremyfelt, johnjamesjacoby, flixos90.
Fixes #29684.

Built from https://develop.svn.wordpress.org/trunk@41380


git-svn-id: http://core.svn.wordpress.org/trunk@41213 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-15 11:15:52 +00:00
Peter Wilson
06bd0b40f9 General: Remove error screen padding for Internet Explorer.
The inline styles added to the `wp_die()` handler since [18534] increase file size of the error screen enough to prevent Internet Explorer from displaying a generic error page.

Props rfair404.
Fixes #37551.


Built from https://develop.svn.wordpress.org/trunk@41369


git-svn-id: http://core.svn.wordpress.org/trunk@41202 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-11 05:31:42 +00:00
John Blackbourn
28eda6f4bc General: Improve terminology used when referring to installations of WordPress and its extensions.
"Install" is not a noun, and while it might be acceptable to use the verb as a noun, it is not correct. Using the correct
noun, "installation", increases clarity, especially for non-native English speakers.

This change fixes the usage in user-facing text and in developer documentation.

Fixes #41620

Built from https://develop.svn.wordpress.org/trunk@41289


git-svn-id: http://core.svn.wordpress.org/trunk@41129 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-22 11:52:48 +00:00
Weston Ruter
300894da61 Customize: Prevent _delete_option_fresh_site() from hitting DB if fresh_site flag already cleared.
Amends [38991].
Props dlh, westonruter.
Fixes #41039.

Built from https://develop.svn.wordpress.org/trunk@41244


git-svn-id: http://core.svn.wordpress.org/trunk@41084 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-13 00:57:43 +00:00
John Blackbourn
ed60c36fb8 Formatting: Add the $number and $decimals arguments to the number_format_i18n filter.
Props alpipego

Fixes #41505

Built from https://develop.svn.wordpress.org/trunk@41199


git-svn-id: http://core.svn.wordpress.org/trunk@41039 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-01 14:38:48 +00:00
John Blackbourn
6a16d726ef Options, Meta APIs: Fix a typo introduced in [41164].
See #39117

Built from https://develop.svn.wordpress.org/trunk@41167


git-svn-id: http://core.svn.wordpress.org/trunk@41007 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-27 03:12:44 +00:00
John Blackbourn
b9b4776800 Options, Meta APIs: Send a notification to the old admin email address when the site admin email or network admin email address is changed.
This reduces the chances of a site compromise going unnoticed, in the same way that the same notifications for user account email address changes reduces the chances of a user account compromise going unnoticed.

Props MatheusGimenez, johnbillion

Fixes #39117

Built from https://develop.svn.wordpress.org/trunk@41164


git-svn-id: http://core.svn.wordpress.org/trunk@41004 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-27 02:24:42 +00:00
Sergey Biryukov
118dba300e Docs: Add @staticvar entries for $cache and $tested_paths in wp_upload_dir().
Props ajayghaghretiya1.
Fixes #41395.
Built from https://develop.svn.wordpress.org/trunk@41113


git-svn-id: http://core.svn.wordpress.org/trunk@40953 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-21 10:15:44 +00:00
Sergey Biryukov
058c2c5ca4 Docs: Fix typo in wp_suspend_cache_invalidation() description.
Props euthelup, milana_cap.
Fixes #41301.
Built from https://develop.svn.wordpress.org/trunk@41031


git-svn-id: http://core.svn.wordpress.org/trunk@40881 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-12 21:26:44 +00:00
Sergey Biryukov
11bae4ded3 Docs: Add a @global entry for $post variable in wp_post_preview_js().
Props avinapatel.
Fixes #41194.
Built from https://develop.svn.wordpress.org/trunk@40959


git-svn-id: http://core.svn.wordpress.org/trunk@40809 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-28 12:55:43 +00:00
Sergey Biryukov
e441ee48d2 I18N: Add @global entry for $wp_locale in wp_maybe_decline_date().
Props Dency.
Fixes #41046.
Built from https://develop.svn.wordpress.org/trunk@40911


git-svn-id: http://core.svn.wordpress.org/trunk@40761 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-15 12:24:41 +00:00
Joe McGill
efab6e06ca Media: Improve handling of non-image files in wp_get_image_mime.
This prevents non-image fileypes from returning a mime type of
"application/octet-stream" when `exif_imagetype()` returns `false`.

Props blobfolio.
Fixes #40017.

Built from https://develop.svn.wordpress.org/trunk@40397


git-svn-id: http://core.svn.wordpress.org/trunk@40304 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-09 22:44:43 +00:00
Joe McGill
87ad9e31ab Media: Reduce failing uploads following 4.7.1.
[39831] introduced more strict MIME type checking for uploads, which
resulted in unintetionally blocking several filetypes that were
previously valid. This change uses  a more targeted approach to MIME
validation to restore previous behavior for most types.

Props blobfolio, iandunn, ipstenu, markoheijnen, xknown, joemcgill.
Fixes #39550, #39552.
Built from https://develop.svn.wordpress.org/trunk@40124


git-svn-id: http://core.svn.wordpress.org/trunk@40061 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-25 16:08:44 +00:00
Sergey Biryukov
8f855f46b0 Media: In wp_unique_filename(), use explicit type casting when incrementing $number.
This prevents the "non-numeric value encountered" warning in PHP 7.1, caused by trying to increment an empty string on the first loop iteration.

Props drrobotnik for initial patch.
Fixes #39774.


Built from https://develop.svn.wordpress.org/trunk@40039


git-svn-id: http://core.svn.wordpress.org/trunk@39976 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-03 20:58:42 +00:00
Peter Wilson
c957e3acb0 Feeds: Prevent empty feeds from returning 404 errors.
Partial revert of [38929].

This reverts the source code from the commit for #30210 to prevent valid but empty feeds from returning 404 file not found errors for the home and custom feeds.

The tests in the commit that remain applicable are retained.

Props pavelevap for reporting, stevenkword for initial patch.
See #30210.
Fixes #39157.

Built from https://develop.svn.wordpress.org/trunk@40030


git-svn-id: http://core.svn.wordpress.org/trunk@39967 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-29 23:09:41 +00:00
Sergey Biryukov
b75023ee1a Docs: Add missing @param type for wp_cache_get_last_changed().
Props afzalmultani, Soean.
Fixes #39571.
Built from https://develop.svn.wordpress.org/trunk@39900


git-svn-id: http://core.svn.wordpress.org/trunk@39837 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-13 14:16:44 +00:00
Sergey Biryukov
11d81ecc7c Media: Use a consistent error message for file type errors on uploading.
Props pavelevap, jackreichert.
Fixes #33242.
Built from https://develop.svn.wordpress.org/trunk@39891


git-svn-id: http://core.svn.wordpress.org/trunk@39828 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-12 06:29:43 +00:00
Joe McGill
52897df8cd Media: Fix exif_imagetype check in wp_get_image_mime
This is a follow up to [39831].

Props gitlost.
See #11946.
Built from https://develop.svn.wordpress.org/trunk@39850


git-svn-id: http://core.svn.wordpress.org/trunk@39787 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-11 16:36:39 +00:00
Joe McGill
8eff927823 Media: Improve image filetype checking.
This adds a new function `wp_get_image_mime()` which is used by
`wp_check_filetype_and_ext()` to validate image files using
`exif_imagetype()` if available instead of `getimagesize()`.

`getimagesize()` is less performant than `exif_imagetype()` and is
dependent on GD. If `exif_imagetype()` is not available, it falls back to
`getimagesize()` as before.

If `wp_check_filetype_and_ext()` can't validate the filetype, we now return
`false` for ext/MIME values.

See #11946.
Built from https://develop.svn.wordpress.org/trunk@39831


git-svn-id: http://core.svn.wordpress.org/trunk@39769 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-11 13:08:44 +00:00
John Blackbourn
80a839de13 Docs: Misc corrections and additions to inline documentation.
See #39130
Props keesiemeijer

Built from https://develop.svn.wordpress.org/trunk@39639


git-svn-id: http://core.svn.wordpress.org/trunk@39579 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-27 09:28:40 +00:00
John Blackbourn
d327c92e4b Docs: Add and correct @since docs for a variety of functions and methods.
Props keesiemeijer, chris_dev
Fixes #39343, #39357, #39344
See #39130

Built from https://develop.svn.wordpress.org/trunk@39638


git-svn-id: http://core.svn.wordpress.org/trunk@39578 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-27 09:21:44 +00:00
John Blackbourn
4cf5550d8d I18n: Begin introducing translator comments for strings which include placeholders but no accompanying translator comment.
Adds context to one string used in two different contexts for the new user and new site signup email notification.

More to come.

See #38882

Built from https://develop.svn.wordpress.org/trunk@39323


git-svn-id: http://core.svn.wordpress.org/trunk@39263 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-21 01:22:32 +00:00
Sergey Biryukov
1c110b8474 I18N: Use 'WordPress hook name' instead of 'PHP hook name' in translator comments added in [39315].
See #38862.
Built from https://develop.svn.wordpress.org/trunk@39316


git-svn-id: http://core.svn.wordpress.org/trunk@39256 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-19 02:44:30 +00:00
Sergey Biryukov
725a04d815 I18N: Add translator comments for strings in _deprecated_*() functions.
See #38862.
Built from https://develop.svn.wordpress.org/trunk@39315


git-svn-id: http://core.svn.wordpress.org/trunk@39255 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-19 02:39:33 +00:00
Pascal Birchler
8df80ae3ee I18N: Show available timezones in the user's locale on the settings screen.
Adds a `$locale` parameter to `wp_timezone_choice()` to only reload translations when necessary.

Props yale01.
See #38485.
Built from https://develop.svn.wordpress.org/trunk@39068


git-svn-id: http://core.svn.wordpress.org/trunk@39010 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-01 09:16:31 +00:00
Weston Ruter
75535c596b Customize: Introduce starter content and site freshness state.
A theme can opt-in for tailored starter content to apply to the customizer when previewing the theme on a fresh install, when `fresh_site` is at its initial `1` value. Starter content is staged in the customizer and does not go live unless the changes are published. Initial starter content is added to Twenty Seventeen.

* The `fresh_site` flag is cleared when a published post or page is saved, when widgets are modified, or when the customizer state is saved.
* Starter content is registered via `starter-content` theme support, where the argument is an array containing `widgets`, `posts`, `nav_menus`, `options`, and `theme_mods`. Posts/pages in starter content are created with the `auto-draft` status, re-using the page/post stubs feature added to nav menus and the static front page controls.
* A `get_theme_starter_content` filter allows for plugins to extend a theme's starter content.
* Starter content in themes can/should re-use existing starter content items in core by using named placeholders.
* Import theme starter content into customized state when fresh site.
* Prevent original_title differences from causing refreshes if title is present.
* Ensure nav menu item url is set according to object when previewing.
* Make sure initial saved state is false if there are dirty settings without an existing changeset.
* Ensure dirty settings are cleaned upon changeset publishing.

Props helen, westonruter, ocean90.
Fixes #38114, #38533.

Built from https://develop.svn.wordpress.org/trunk@38991


git-svn-id: http://core.svn.wordpress.org/trunk@38934 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-28 02:57:35 +00:00
John Blackbourn
6161ad9020 Formatting: Don't overwrite the status header for Ajax responses that use output buffering or otherwise set their headers early.
Fixes #35666

Built from https://develop.svn.wordpress.org/trunk@38956


git-svn-id: http://core.svn.wordpress.org/trunk@38899 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-26 14:32:28 +00:00
John Blackbourn
1e6a12db38 Feeds: Don't attempt to generate RSS feeds for invalid feed URLs such as wp-content/feed.
Props stevenkword, JRGould, lyubomir_popov, johnbillion
Fixes #30210

Built from https://develop.svn.wordpress.org/trunk@38929


git-svn-id: http://core.svn.wordpress.org/trunk@38872 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 21:54:31 +00:00
Dominik Schilling
7cce73a634 General: Introduce a wp_list_sort() helper function, v2.
In addition to `wp_list_filter()` for filtering a list of objects, and `wp_list_pluck()` for plucking a certain field out of each object in a list, this new function can be used for sorting a list of objects by specific fields. These functions are now all contained within the new `WP_List_Util()` class and `wp_list_sort()` is used in various parts of core for sorting lists.

This was previously committed in [38859] but got reverted in [38862] and [38863]. To fix the previous issues, `wp_list_sort()` supports now an additional argument to preserve array keys via `uasort()`.

Props flixos90, DrewAPicture, jorbin.
Fixes #37128.
Built from https://develop.svn.wordpress.org/trunk@38928


git-svn-id: http://core.svn.wordpress.org/trunk@38871 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 21:26:32 +00:00
John Blackbourn
2dfc3a7572 General: Correct the docs for the default HTTP status code used by wp_die().
See #37770

Built from https://develop.svn.wordpress.org/trunk@38884


git-svn-id: http://core.svn.wordpress.org/trunk@38827 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-24 13:13:58 +00:00
Dominik Schilling
6c8508023f Revert [38859] due to an incomplete implementation.
See https://core.trac.wordpress.org/ticket/37128#comment:27.
See #37128.
Built from https://develop.svn.wordpress.org/trunk@38863


git-svn-id: http://core.svn.wordpress.org/trunk@38806 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-21 17:01:32 +00:00
Pascal Birchler
f54558e75b General: Introduce a wp_list_sort() helper function.
In addition to `wp_list_filter()` for filtering a list of objects, and `wp_list_pluck()` for plucking a certain field out of each object in a list, this new function can be used for sorting a list of objects by specific fields. These functions are now all contained within the new `WP_List_Util()` class and `wp_list_sort()` is used in various parts of core for sorting lists.

Props flixos90, DrewAPicture, jorbin.
Fixes #37128.
Built from https://develop.svn.wordpress.org/trunk@38859


git-svn-id: http://core.svn.wordpress.org/trunk@38802 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-21 11:12:51 +00:00
Aaron Jorbin
82911b1756 Cache API: introduce wp_cache_get_last_changed to improve DRY
One thing fairly common to the cache groups is a block of code to look to see when the cache was last changed, and if there isn't one, to set it for the current microtime(). It appears in 8 different places in core. This adds a new helper `wp_cache_get_last_changed` to DRY things up a bit.

Since `wp-includes/cache.php` isn't guaranteed to be loaded, this new function is in `wp-includes/functions.php`

Props spacedmonkey, desrosj.
Fixes #37464.


Built from https://develop.svn.wordpress.org/trunk@38849


git-svn-id: http://core.svn.wordpress.org/trunk@38792 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-21 02:54:34 +00:00
Rachel Baker
e4a7c0a397 REST API: Introduce the Content API endpoints.
REST API endpoints for your WordPress content. These endpoints provide machine-readable external access to your WordPress site with a clear, standards-driven interface, allowing new and innovative apps for interacting with your site. These endpoints support all of the following:
- Posts: Read and write access to all post data, for all types of post-based data, including pages and media.
- Comments: Read and write access to all comment data. This includes pingbacks and trackbacks.
- Terms: Read and write access to all term data.
- Users: Read and write access to all user data. This includes public access to some data for post authors.
- Meta: Read and write access to metadata for posts, comments, terms, and users, on an opt-in basis from plugins.
- Settings: Read and write access to settings, on an opt-in basis from plugins and core. This enables API management of key site content values that are technically stored in options, such as site title and byline.

Love your REST API, WordPress!  The infrastructure says, "Let's do lunch!" but the content API endpoints say, "You're paying!"

Props rmccue, rachelbaker, danielbachhuber, joehoyle, adamsilverstein, afurculita, ahmadawais, airesvsg, alisspers, antisilent, apokalyptik, artoliukkonen, attitude, boonebgorges, bradyvercher, brianhogg, caseypatrickdriscoll, chopinbach, chredd, christianesperar, chrisvanpatten, claudiolabarbera, claudiosmweb, cmmarslender, codebykat, coderkevin, codfish, codonnell822, daggerhart, danielpunkass, davidbhayes, delphinus, desrosj, dimadin, dotancohen, DrewAPicture, Dudo1985, duncanjbrown, eherman24, eivhyl, eliorivero, elyobo, en-alis, ericandrewlewis, ericpedia, evansobkowicz, fjarrett, frozzare, georgestephanis, greatislander, guavaworks, hideokamoto, hkdobrev, hubdotcom, hurtige, iandunn, ircrash, ironpaperweight, iseulde, Japh, jaredcobb, JDGrimes, jdolan, jdoubleu, jeremyfelt, jimt, jjeaton, jmusal, jnylen0, johanmynhardt, johnbillion, jonathanbardo, jorbin, joshkadis, JPry, jshreve, jtsternberg, JustinSainton, kacperszurek, kadamwhite, kalenjohnson, kellbot, kjbenk, kokarn, krogsgard, kuchenundkakao, kuldipem, kwight, lgedeon, lukepettway, mantismamita, markoheijnen, matrixik, mattheu, mauteri, maxcutler, mayukojpn, michael-arestad, miyauchi, mjbanks, modemlooper, mrbobbybryant, NateWr, nathanrice, netweb, NikV, nullvariable, oskosk, oso96_2000, oxymoron, pcfreak30, pento, peterwilsoncc, Pezzab, phh, pippinsplugins, pjgalbraith, pkevan, pollyplummer, pushred, quasel, QWp6t, schlessera, schrapel, Shelob9, shprink, simonlampen, Soean, solal, tapsboy, tfrommen, tharsheblows, thenbrent, tierra, tlovett1, tnegri, tobych, Toddses, toro_unit, traversal, vanillalounge, vishalkakadiya, wanecek, web2style, webbgaraget, websupporter, westonruter, whyisjake, wonderboymusic, wpsmith, xknown, zyphonic.
Fixes #38373.
Built from https://develop.svn.wordpress.org/trunk@38832


git-svn-id: http://core.svn.wordpress.org/trunk@38775 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-20 02:55:32 +00:00
Jeremy Felt
1560fbcbc5 Multisite: Use get_network() and get_current_network_id() for current network data.
`get_network()` falls back to the current network when called without any arguments. Between this and `get_current_network_id()`, we can replace almost all instances of the global `$current_site` and all instances of `get_current_site()`.

This effectively deprecates `get_current_site()`, something that we'll do in a future ticket.

Props flixos90.
Fixes #37414.

Built from https://develop.svn.wordpress.org/trunk@38814


git-svn-id: http://core.svn.wordpress.org/trunk@38757 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-19 04:47:30 +00:00
Weston Ruter
f1ba1918c9 Customize: Implement customized state persistence with changesets.
Includes infrastructure developed in the Customize Snapshots feature plugin.

See https://make.wordpress.org/core/2016/10/12/customize-changesets-technical-design-decisions/

Props westonruter, valendesigns, utkarshpatel, stubgo, lgedeon, ocean90, ryankienstra, mihai2u, dlh, aaroncampbell, jonathanbardo, jorbin.
See #28721.
See #31089.
Fixes #30937.
Fixes #31517.
Fixes #30028.
Fixes #23225.
Fixes #34142.
Fixes #36485.

Built from https://develop.svn.wordpress.org/trunk@38810


git-svn-id: http://core.svn.wordpress.org/trunk@38753 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-18 20:05:31 +00:00
Gary Pendergast
f6d85de626 Charset: Allow _canonical_charset() to handle mixed-case strings.
Add improved unit tests, and collect existing unit tests together.

Props pbearne.
Fixes #38337.


Built from https://develop.svn.wordpress.org/trunk@38809


git-svn-id: http://core.svn.wordpress.org/trunk@38752 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-17 23:54:30 +00:00
Pascal Birchler
ffdef38f5b Date/Time: Remove some legacy logic in date_i18n().
Since there's no difference between using `date()` and `gmdate()` in WordPress, we can simply use the former in `date_i18n()` to reduce its complexity.

Adds tests.

Props jdgrimes for initial patch.
Fixes #37910.
Built from https://develop.svn.wordpress.org/trunk@38804


git-svn-id: http://core.svn.wordpress.org/trunk@38747 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-17 08:10:30 +00:00
Dominik Schilling
30573dc7b2 Add 'urn' to the list of URI protocols whitelisted by default.
Props geekysoft, jorbin.
Fixes #37300.
Built from https://develop.svn.wordpress.org/trunk@38686


git-svn-id: http://core.svn.wordpress.org/trunk@38629 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-30 13:15:28 +00:00
Pascal Birchler
cfa32db674 Docs: Improve parameter description for wp_parse_args().
Props dimadin for initial patch.
Fixes #38167.
Built from https://develop.svn.wordpress.org/trunk@38670


git-svn-id: http://core.svn.wordpress.org/trunk@38613 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-28 08:41:29 +00:00
Jeremy Felt
58f107fa95 Multisite: Revert [38388].
Restore `get_current_site()` to a multisite only function. Providing this in single site may be a possibility in the future, but should have a dedicated ticket and discussion.

See #37699.

Built from https://develop.svn.wordpress.org/trunk@38636


git-svn-id: http://core.svn.wordpress.org/trunk@38579 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-20 21:39:29 +00:00
Jeremy Felt
63664c1282 Multisite: Use get_networks() in get_main_network_id().
The manual query for the main network ID can now be replaced with a cached `get_networks()` query. This allows us to eliminate the `primary_network_id` cache key entirely.

Props spacedmonkey.
Fixes #37218.

Built from https://develop.svn.wordpress.org/trunk@38632


git-svn-id: http://core.svn.wordpress.org/trunk@38575 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-20 18:47:27 +00:00
Sergey Biryukov
9c6da56cc7 Docs: Use a third-person singular verb for smilies filter added in [38504].
See #35905.
Built from https://develop.svn.wordpress.org/trunk@38608


git-svn-id: http://core.svn.wordpress.org/trunk@38551 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-14 21:53:29 +00:00
John Blackbourn
3afaf2147c Formatting: Don't send an HTTP status code in wp_send_json() by default. This avoids clobbering an HTTP status code that may have been set prior to calling this function.
Props westonruter
See #35666

Built from https://develop.svn.wordpress.org/trunk@38576


git-svn-id: http://core.svn.wordpress.org/trunk@38519 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-08 13:45:34 +00:00
Drew Jaynes
f0bb2bc3c0 Docs: Update the $message parameter for _default_wp_die_handler() to notate that it can also accept a WP_Error object.
Additionally, update the `$message` parameter description in the DocBlock for `wp_die()` to make it explicitly clear messages derived from a passed `WP_Error` object will only be evaluated if not performing an Ajax or XML-RPC request (as both default handlers completely ignore `WP_Error` object messages).

See #37770.

Built from https://develop.svn.wordpress.org/trunk@38518


git-svn-id: http://core.svn.wordpress.org/trunk@38459 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-04 03:41:31 +00:00
Sergey Biryukov
8682603166 Docs: Correct @since entry for the smilies filter added in [38504].
See #35905.
Built from https://develop.svn.wordpress.org/trunk@38505


git-svn-id: http://core.svn.wordpress.org/trunk@38446 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-02 00:08:30 +00:00
Gary Pendergast
cce2ffaed5 Smilies: Add the smilies filter.
This new filter allows the smilies array to be modified with a filter, instead of having to directly access the global.

Props mte90, jorbin.
Fixes #35905.


Built from https://develop.svn.wordpress.org/trunk@38504


git-svn-id: http://core.svn.wordpress.org/trunk@38445 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-02 00:00:30 +00:00
Scott Taylor
a3ffebce30 Bootstrap: do not go gentle into that good night r38411, r38412, and parts of r38389.
See #36335.

Built from https://develop.svn.wordpress.org/trunk@38470


git-svn-id: http://core.svn.wordpress.org/trunk@38411 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-31 16:31:29 +00:00
Scott Taylor
7e8d7f8a81 General: revert [38386], functions.php was probably too tempting for some people to not load by itself.
See #36335.

Built from https://develop.svn.wordpress.org/trunk@38469


git-svn-id: http://core.svn.wordpress.org/trunk@38410 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-31 15:24:29 +00:00
John Blackbourn
348c50b2a8 Formatting: Add a parameter to wp_send_json_error(), wp_send_json_success(), and wp_send_json() for specifying the HTTP response code.
Defaults to `200` in all cases, but can be used, for example, to return a `403` when using `wp_send_json_error()`.

Fixes #35666
Props stephenharris

Built from https://develop.svn.wordpress.org/trunk@38422


git-svn-id: http://core.svn.wordpress.org/trunk@38363 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-28 17:42:28 +00:00
John Blackbourn
a1d61a95e1 Security: Return a 403 instead of a 200 HTTP status when check_ajax_referer() fails.
This is, unfortunately, untestable in the current test suite, even in the AJAX tests.

Fixes #36362

Built from https://develop.svn.wordpress.org/trunk@38421


git-svn-id: http://core.svn.wordpress.org/trunk@38362 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-28 17:31:30 +00:00
Scott Taylor
390ceba6c7 Bootstrap: after r38409 and r38410, revert r38402 which reverted r38399.
This fixes the paths in `wp-vendor/` that were including `src`. I want to drop this in so we can find out what else will break.

See #36335.

Built from https://develop.svn.wordpress.org/trunk@38411


git-svn-id: http://core.svn.wordpress.org/trunk@38352 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-27 22:32:37 +00:00
Dion Hulse
0e31a46161 Bootstrap: Revert [38399] as it's broken /build/ and subsequently core.svn.wordpress.org.
The generated classmaps reference `/src/` files and operates in the assumption that the base directory is one level above `wp-settings.php`, which it isn't after our build processes are run.

See #36335

Built from https://develop.svn.wordpress.org/trunk@38402


git-svn-id: http://core.svn.wordpress.org/trunk@38343 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-27 14:37:32 +00:00
Scott Taylor
6a529648cf Bootstrap: Autoload classes using a Composer-generated PHP 5.2-compatible Autoloader.
* `wp-admin` and `wp-includes` are scanned for classes to autoload
* Several 3rd-party and Ryan McCue-shaped libraries are excluded when the classmap is generated, see `composer.json`: `autoload.exclude-from-classmap`
* `wp-vendor/autoload_52.php` is included at the top of `wp-settings.php` - no changes need to be made to unit tests to include the autoloader
* An avalanche of `require()` and `require_once()` calls that loaded class files have been removed from the codebase.

The following files have been added to `svn:ignore` - they are not 5.2-compatible and fail during pre-commit:
* src/wp-vendor/autoload.php
* src/wp-vendor/composer/autoload_real.php
* src/wp-vendor/composer/autoload_static.php
* src/wp-vendor/composer/ClassLoader.php

We favor these files instead:
* src/wp-vendor/autoload_52.php
* src/wp-vendor/composer/autoload_real_52.php
* src/wp-vendor/composer/ClassLoader52.php

When new PHP classes are added to the codebase, simply run `composer install` or `composer update` from the project root to update the autoloader.

The future is now.

See #36335.

Built from https://develop.svn.wordpress.org/trunk@38399


git-svn-id: http://core.svn.wordpress.org/trunk@38340 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-27 09:15:29 +00:00
Scott Taylor
08233c6aff Multisite: move get_current_site() to load.php so that it can be used in more places, instead of importing global $current_site.
See #37699.

Built from https://develop.svn.wordpress.org/trunk@38388


git-svn-id: http://core.svn.wordpress.org/trunk@38329 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-26 21:35:30 +00:00
Scott Taylor
b9f516e55e Bootstrap: load option.php in wp-settings.php, not in functions.php.
See #36335.

Built from https://develop.svn.wordpress.org/trunk@38386


git-svn-id: http://core.svn.wordpress.org/trunk@38327 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-26 21:11:29 +00:00
Andrew Ozz
15edc78f6f TinyMCE: fix toolbars alignment in RTL.
Fixes #37760 for trunk.
Built from https://develop.svn.wordpress.org/trunk@38349


git-svn-id: http://core.svn.wordpress.org/trunk@38290 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-25 01:20:30 +00:00
Sergey Biryukov
d64e4beb67 I18N: Add translator comments for strings in wp-includes/functions.php.
Props ramiy.
Fixes #37802.
Built from https://develop.svn.wordpress.org/trunk@38344


git-svn-id: http://core.svn.wordpress.org/trunk@38285 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-23 23:48:28 +00:00
Scott Taylor
b7812bd416 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.

Built from https://develop.svn.wordpress.org/trunk@38334


git-svn-id: http://core.svn.wordpress.org/trunk@38275 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-23 14:33:30 +00:00
Scott Taylor
7b30193bb7 General: remove variable set needlessly in wp_check_jsonp_callback().
See #37771.

Built from https://develop.svn.wordpress.org/trunk@38308


git-svn-id: http://core.svn.wordpress.org/trunk@38249 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-22 20:51:30 +00:00
Scott Taylor
7ac88c02fa Media: when calling pathinfo(), also pass a PATHINFO_* constant to avoid array notices for unset keys.
Props JaworskiMatt.
Fixes #37608.

Built from https://develop.svn.wordpress.org/trunk@38294


git-svn-id: http://core.svn.wordpress.org/trunk@38235 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-20 23:36:28 +00:00
Helen Hou-Sandí
6d28c85bc7 System fonts: Don't quote single-word font names, per our coding standards.
props ocean90, netweb.
see #36753.

Built from https://develop.svn.wordpress.org/trunk@38152


git-svn-id: http://core.svn.wordpress.org/trunk@38093 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-07-26 16:39:30 +00:00
Drew Jaynes
6cc13f0c54 Docs: Fix formatting, tense, verb conjugation, and other syntax for wp-includes/* elements introduced or changed in 4.6.
Part 1/2.

See #37318.

Built from https://develop.svn.wordpress.org/trunk@38121


git-svn-id: http://core.svn.wordpress.org/trunk@38062 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-07-20 16:57:32 +00:00
Jeremy Felt
30851d1186 Meta: Remove object subtype handling from register_meta().
Registration is now based solely on object type, which allows the code around this to be simplified significantly.

In the process of making this adjustment:

* `register_meta()`, `unregister_meta_key()`, `get_registered_metadata()`, and `registered_meta_key_exists()` no longer return `WP_Error` objects.
* The recently introduced `wp_object_type_exists()` function and the restriction on object type has been removed.

Note: No guarantee of uniqueness is made across object subtypes. Registered meta keys should be uniquely prefixed to avoid conflict.

Fixes #35658.

Built from https://develop.svn.wordpress.org/trunk@38095


git-svn-id: http://core.svn.wordpress.org/trunk@38036 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-07-18 21:16:29 +00:00
John Blackbourn
3a7137a7a5 Meta: Add a missing @since param for wp_object_type_exists().
See #35658

Built from https://develop.svn.wordpress.org/trunk@38038


git-svn-id: http://core.svn.wordpress.org/trunk@37979 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-07-12 13:21:29 +00:00
Drew Jaynes
6c7148943b Docs: Standardize capitalization of Ajax throughout core documentation per the core spelling guide.
Ajax, while considered an acronym for Asynchronous JavaScript and XML, is most commonly capitalized only in the first character.

Part props ocean90.
See #32246.

Built from https://develop.svn.wordpress.org/trunk@38028


git-svn-id: http://core.svn.wordpress.org/trunk@37969 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-07-10 00:51:30 +00:00
Dominik Schilling
aa561e67a1 Bootstrap: Enhance core's memory limit handling.
* Don't lower memory limit if the current limit is greater than `WP_MAX_MEMORY_LIMIT`.
* Set `WP_MEMORY_LIMIT` and `WP_MAX_MEMORY_LIMIT` to current limit if the `memory_limit` setting can't be changed at runtime.
* Use `wp_convert_hr_to_bytes()` when parsing the value of the `memory_limit` setting because it can be a shorthand or an integer value.
* Introduce `wp_raise_memory_limit( $context )` to raise the PHP memory limit for memory intensive processes. This DRYs up some logic and includes the existing `admin_memory_limit` and `image_memory_limit` filters. The function can also be used for custom contexts, the `{$context}_memory_limit` filter allows to customize the limit.
* Introduce `wp_is_ini_value_changeable( $setting )` to determine whether a PHP ini value is changeable at runtime.
* Remove a `function_exists( 'memory_get_usage' )` check. Since PHP 5.2.1 support for memory limit is always enabled.

Related commits: [38011-38013]

Props jrf, A5hleyRich, swissspidy, ocean90.
Fixes #32075.
Built from https://develop.svn.wordpress.org/trunk@38015


git-svn-id: http://core.svn.wordpress.org/trunk@37956 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-07-08 14:37:30 +00:00
Helen Hou-Sandí
5a2ffe61f6 Meta: Make registration error conditions return consistently.
In doing this, non-core object types are no longer forcibly blocked and are instead checked against `wp_object_type_exists()` which has a filterable return value. Still, filter that at your own risk.

props Faison for the initial patch.
see 35658.

Built from https://develop.svn.wordpress.org/trunk@37991


git-svn-id: http://core.svn.wordpress.org/trunk@37932 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-07-06 18:09:32 +00:00
Sergey Biryukov
139387b7e5 Docs: Use 3-digit, x.x.x-style semantic versioning for _doing_it_wrong(), _deprecated_function(), _deprecated_argument(), and _deprecated_file() throughout core.
Props metodiew.
Fixes #36495.
Built from https://develop.svn.wordpress.org/trunk@37985


git-svn-id: http://core.svn.wordpress.org/trunk@37926 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-07-06 12:40:29 +00:00
Sergey Biryukov
de1fab0b66 I18N: Adjust the regex in wp_maybe_decline_date() to avoid \w and \b, as they don't work with Unicode characters correctly in PHP 5.3.3 and earlier versions.
See [37975] for unit tests.

See #36790.
Built from https://develop.svn.wordpress.org/trunk@37979


git-svn-id: http://core.svn.wordpress.org/trunk@37920 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-07-05 21:43:30 +00:00
Dominik Schilling
9b893cd558 General: Return "O B" when passing 0 to size_format().
Props swissspidy.
Fixes #36635.
Built from https://develop.svn.wordpress.org/trunk@37962


git-svn-id: http://core.svn.wordpress.org/trunk@37903 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-07-05 10:36:30 +00:00
Gary Pendergast
2d6b9ca91b General: Remove the Pragma header from responses.
`Pragma` is supposed to be a request header, but we've been including it in responses since the beginning of time.

This is a relic dating all the way back to b2, probably originally added because Internet Explorer version 5 and earlier didn't understand the `Cache-Control` header in responses, but they did (incorrectly) obey the `Pragma` header.

Internet Explorer 6 and 7 will obey the `Pragma` response header only if no other cache-related response headers are present (in our case, they are always present), and all other browsers ignore the `Pragma` response header.

Props geekysoft.
Fixes #37250.


Built from https://develop.svn.wordpress.org/trunk@37944


git-svn-id: http://core.svn.wordpress.org/trunk@37885 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-07-04 04:02:31 +00:00
Jeremy Felt
858fb83f57 Docs: Remove duplicate text for is_main_site() parameter.
Props Kenshino.
Fixes #37241.

Built from https://develop.svn.wordpress.org/trunk@37932


git-svn-id: http://core.svn.wordpress.org/trunk@37873 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-30 17:17:28 +00:00
Jeremy Felt
6f3f00ea97 Multisite: Change WP_Network id property to an integer.
For consistency and developer sanity.

Props flixos90.
Fixes #37050.

Built from https://develop.svn.wordpress.org/trunk@37870


git-svn-id: http://core.svn.wordpress.org/trunk@37811 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-26 14:26:29 +00:00
Sergey Biryukov
b0bb179da7 I18N: Adjust the regex in wp_maybe_decline_date() to handle word boundaries correctly.
Props semil.
Fixes #36790.
Built from https://develop.svn.wordpress.org/trunk@37717


git-svn-id: http://core.svn.wordpress.org/trunk@37683 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-15 17:45:30 +00:00
Sergey Biryukov
70984aeb6f In size_format() and wp_convert_bytes_to_hr(), replace kB with KB for consistency with other units.
Props Presskopp, dashaluna.
Fixes #37037.
Built from https://develop.svn.wordpress.org/trunk@37702


git-svn-id: http://core.svn.wordpress.org/trunk@37668 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-14 21:41:28 +00:00
Jeremy Felt
2cd62a2c97 Login: Fire wp_no_robots() in wp_die() only if function exists.
This covers cases where `wp_die()` is used before `general-template.php` is loaded.

Fixes #34401.

Built from https://develop.svn.wordpress.org/trunk@37689


git-svn-id: http://core.svn.wordpress.org/trunk@37655 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-12 00:34:29 +00:00
Drew Jaynes
2600c28169 Boostrap: Move is_ssl() to wp-includes/load.php.
Moving to load.php introduces parity with other commonly evaluated `is_*()` functions such as `is_admin()` or `is_multisite()`.  It also makes `is_ssl()` available much earlier in the loading process, such as for use in drop-ins like advanced-cache.php.

Props johnjamesjacoby.
Fixes #35844.

Built from https://develop.svn.wordpress.org/trunk@37677


git-svn-id: http://core.svn.wordpress.org/trunk@37643 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-10 18:56:31 +00:00
Peter Wilson
47d26cd9fb DOCS: Replace HTTP links with HTTPS.
Replaces unsecure links in documentation and translator comments with their secure versions.

Props johnpgreen, netweb

Fixes #36993

Built from https://develop.svn.wordpress.org/trunk@37674


git-svn-id: http://core.svn.wordpress.org/trunk@37640 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-10 04:50:33 +00:00
Jeremy Felt
c63c4d9345 Multisite: Introduce get_current_network_id()
Similar to `get_current_blog_id`, this can be used to get the ID of the `$current_site` global. If not available, it will fallback to the main network ID. In single site, this will return 1.

Props spacedmonkey, flixos90.
Fixes #33900.

Built from https://develop.svn.wordpress.org/trunk@37670


git-svn-id: http://core.svn.wordpress.org/trunk@37636 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-09 20:34:28 +00:00
Rachel Baker
445b9b6d94 Users: Stop WP_List_Table notices from persisting on pagination navigation.
Adds the keyboard navigation query vars to `wp_removable_query_args()` and passes the results of said function to remove_query_var() inside the WP_List_Table pagination method.

Props EFAREM for the initial patch.
Fixes #35620.
Built from https://develop.svn.wordpress.org/trunk@37663


git-svn-id: http://core.svn.wordpress.org/trunk@37629 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-09 01:56:27 +00:00
Rachel Baker
99cca27041 REST API: Create the general wp_check_jsonp_callback() function for validating JSONP callback functions.
Move the REST API JSONP callback validation check into a separate function named `wp_check_jsonp_callback()`. This allows plugins to use the built-in validation when handling JSONP callbacks.
Extremely Important Note: If you send JSONP in your custom response, make sure you prefix the response with `/**/`. This will mitigate the Rosetta Flash exploit. You should also send the `X-Content-Type-Options:nosniff` header, or even better, use the REST API infrastructure.

Props rmccue.
Fixes #28523.
Built from https://develop.svn.wordpress.org/trunk@37646


git-svn-id: http://core.svn.wordpress.org/trunk@37612 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-06 21:34:28 +00:00
Drew Jaynes
d28f1a08ef Docs: Apply inline @see tags to hooks referenced in DocBlocks in a variety of wp-includes/* files.
Applying these specially-crafted `@see` tags allows the Code Reference parser to recognize and link these elements as actions and filters.

See #36921.

Built from https://develop.svn.wordpress.org/trunk@37543


git-svn-id: http://core.svn.wordpress.org/trunk@37511 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-05-23 19:01:27 +00:00
Drew Jaynes
bc20a9288f Docs: Standardize filter docs in wp-includes/functions.php to use third-person singular verbs per the inline documentation standards for PHP.
See #36913.

Built from https://develop.svn.wordpress.org/trunk@37510


git-svn-id: http://core.svn.wordpress.org/trunk@37478 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-05-22 18:36:27 +00:00
Ryan McCue
691d445d68 REST API: Use prepared JSON data correctly.
This was modifying a variable that was never used. Oops.

Fixes #36358.
Props jrf.

Built from https://develop.svn.wordpress.org/trunk@37444


git-svn-id: http://core.svn.wordpress.org/trunk@37412 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-05-17 03:55:29 +00:00
Drew Jaynes
b1804afeaf Docs: Standardize on 'backward compatibility/compatible' nomenclature in core inline docs.
Also use 'back-compat' in some inline comments where backward compatibility is the subject and shorthand feels more natural.

Note: 'backwards compatibility/compatibile' can also be considered correct, though it's primary seen in regular use in British English.

Props ocean90.
Fixes #36835.

Built from https://develop.svn.wordpress.org/trunk@37431


git-svn-id: http://core.svn.wordpress.org/trunk@37397 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-05-13 18:41:31 +00:00
Helen Hou-Sandí
a800cf654b Drop Open Sans in the admin in favor of system fonts.
Rejoice, for your admins will feel more native to your surrounding computing environment and likely load faster, especially when offline, as they no longer have to talk to The Google Overlord.

At the time of introduction in 3.8, there were not good system fonts common to all platforms at the time. In the years since, Windows, Android, OS X, iOS, Firefox OS, and various flavors of Linux have all gotten their own (good) system UI fonts.

There will definitely be visual bugs, mainly around alignment and spacing; these should be documented and reported on the ticket and fixed more atomically so that our current and future selves have a better understanding of what happened and why.

The style remains registered, as it is almost certainly in use by themes and plugins.

props mattmiklic.
see #36753.

Built from https://develop.svn.wordpress.org/trunk@37361


git-svn-id: http://core.svn.wordpress.org/trunk@37327 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-05-04 22:07:37 +00:00
Drew Jaynes
fe3b007fdd Docs: Remove inline @see tags from function, class, and method references in inline docs.
Known functions, classes, and methods are now auto-linked in Code Reference pages following #meta1483.

Note: Hook references are still linked via inline `@see` tags due to the unlikelihood of reliably matching for known hooks based on a RegEx pattern.

See #32246.

Built from https://develop.svn.wordpress.org/trunk@37342


git-svn-id: http://core.svn.wordpress.org/trunk@37308 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-05-02 04:00:28 +00:00
Gary Pendergast
33cb1be012 Emoji: The :roll: smiley is now an emoji.
Unicode 8 added `U+1F644`, "Face with Rolling Eyes", which matches our `:roll:` smiley. Continuing our ever present quest to rid the world of legacy smilies, we now translate that smiley into its emoji form.

Sadly, `:mrgreen:` remains sorely under-represented in the Unicode standard, I'm inclined to think that we should buy a voting membership of the Unicode Consortium, in order to rectify that situation. (Personally, I'm hoping for a green skin tone modifier.)

Fixes #36365.
 


Built from https://develop.svn.wordpress.org/trunk@37296


git-svn-id: http://core.svn.wordpress.org/trunk@37262 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-04-22 06:29:27 +00:00
Dominik Schilling
3df07b17dd Media: Don't cache the results of wp_mkdir_p() in a persistent cache.
To improve the performance of `wp_upload_dir()` the result of `wp_mkdir_p()` was stored in a persistent cache, introduced in [36565]. But this becomes an issue when WordPress is scaled horizontally. You may end up caching a value for a server where the directory doesn't exist which will prevent further uploads on other servers because of the persistent cache.
The fix is to use a non-persistent cache.

Props azaozz, ocean90.
See #34359.
Fixes #36621.
Built from https://develop.svn.wordpress.org/trunk@37285


git-svn-id: http://core.svn.wordpress.org/trunk@37251 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-04-21 19:58:27 +00:00
John Blackbourn
17be663ad0 Add noindexing to the default wp_die() handler to avoid unnecessary crawl errors in web search engines.
Fixes #34401
Props rodrigosprimo

Built from https://develop.svn.wordpress.org/trunk@37210


git-svn-id: http://core.svn.wordpress.org/trunk@37176 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-04-15 02:05:27 +00:00
Boone Gorges
0b772e928c Improve testability and coverage of wp_ext2type().
* Following pattern of `wp_get_mime_types()`, introduce `wp_get_ext_types()` function. New function returns a filtered list of file types with their extensions.
* Use this function in new tests for `wp_ext2type()`.

Props borgesbruno.
Fixes #35987.
Built from https://develop.svn.wordpress.org/trunk@37189


git-svn-id: http://core.svn.wordpress.org/trunk@37155 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-04-13 03:12:27 +00:00
Aaron Jorbin
1972aa2a2a Add grunt prerelease task
An unintended consequence of improving the precommit task is that when it's time to run a release, more tasks need to get run to verify things. This adds a prerelease task to help fix that situation. grunt prerelease should include tasks that verify the code base is ready to be released to the wild and find all the tears on the mausoleum floor and help Blood stain the Colosseum doors.

See #35557

Built from https://develop.svn.wordpress.org/trunk@36930


git-svn-id: http://core.svn.wordpress.org/trunk@36898 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-03-10 05:37:27 +00:00
Dion Hulse
6a23a0ddd5 Filesystem: Support Windows shares/DFS roots in wp_normalize_path().
Props rilwis for initial patch.
Fixes #35996.

Built from https://develop.svn.wordpress.org/trunk@36881


git-svn-id: http://core.svn.wordpress.org/trunk@36848 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-03-08 06:00:26 +00:00
Sergey Biryukov
613cd1b020 Docs: Correct $number type in number_format_i18n().
Props salcode.
Fixes #35893.
Built from https://develop.svn.wordpress.org/trunk@36644


git-svn-id: http://core.svn.wordpress.org/trunk@36611 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-02-23 18:44:26 +00:00
Andrew Ozz
d7b56a13d9 In wp_upload_dir() do not cache error from wp_mkdir_p() when a directory cannot be created. Keep trying to create the dirs. This happens mostly in file upload context.
See #34359.
Built from https://develop.svn.wordpress.org/trunk@36628


git-svn-id: http://core.svn.wordpress.org/trunk@36595 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-02-23 15:58:28 +00:00
Andrew Ozz
2d94e025a2 Replace wp_upload_dir() with the new wp_get_upload_dir() in all cases where a file is not being uploaded. Deprecate _wp_upload_dir_baseurl(), and replace it with wp_get_upload_dir().
See #34359.
Built from https://develop.svn.wordpress.org/trunk@36569


git-svn-id: http://core.svn.wordpress.org/trunk@36536 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-02-18 00:24:27 +00:00
Andrew Ozz
da5b3a55c4 Improve the performance of wp_upload_dir():
- Cache the output in non-persistent cache.
- Cache the result from `wp_mkdir_p()` in persistent cache (when present).
- Introduce `wp_get_upload_dir()` for use when not uploading files. It is equivalent to `wp_upload_dir()` but does not check for the existence or create the upload directory.
- Change tests to use the non-cached `_wp_upload_dir()`. They change options on the fly (should never be used in production) to simulate different environments.
- Introduce `_upload_dir_no_subdir()` and `_upload_dir_https()` to facilitate testing. These use the proper `upload_dir` filter to simulate different environments.

Props kovshenin, azaozz.
See #34359.
Built from https://develop.svn.wordpress.org/trunk@36565


git-svn-id: http://core.svn.wordpress.org/trunk@36532 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-02-17 22:51:26 +00:00
Dominik Schilling
9e73dea03a Introduce a $parent_class parameter for _deprecated_constructor().
Use the parameter for the deprecated constructor warning in `WP_Widget` to provide an indication to which widget is using the PHP4 style constructor.

Props sebastian.pisula.
Fixes #33440.
Built from https://develop.svn.wordpress.org/trunk@36541


git-svn-id: http://core.svn.wordpress.org/trunk@36508 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-02-16 23:20:26 +00:00
Drew Jaynes
48988c505f Docs: Make a couple of minor improvements to the DocBlock for wp_get_raw_referer(), introduced in [36266].
* Uses a third-person singular verb in the summary
* Makes the return types more specific with `string|false` vs `string|bool`.

See #27152. See #32246.

Built from https://develop.svn.wordpress.org/trunk@36500


git-svn-id: http://core.svn.wordpress.org/trunk@36467 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-02-07 08:09:25 +00:00
Eric Lewis
24adb71a56 Networks and sites: Replace "blog" usage with "site" in docs.
Multisite functions use the term "blog" to refer to what we now call a "site," e.g. `get_current_blog_id()`. These functions are here to stay because of our commitment to backwards compatibility. What we can do is set the documentation straight.

See #35417.

Built from https://develop.svn.wordpress.org/trunk@36417


git-svn-id: http://core.svn.wordpress.org/trunk@36384 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-01-28 03:51:26 +00:00
Ella Iseulde Van Dorpe
dea6197932 Emoji: adjust $wpsmiliestrans
Swap simple-smile.png with SLIGHTLY SMILING FACE
and frownie.png with SLIGHTLY FROWNING FACE

Fixes #31710.


Built from https://develop.svn.wordpress.org/trunk@36336


git-svn-id: http://core.svn.wordpress.org/trunk@36303 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-01-17 22:28:29 +00:00
Pascal Birchler
16142a461e Filesystem API: Add a filter to wp_unique_filename().
Props SergeyBiryukov, MikeHansenMe, johnbillion, swissspidy.
Fixes #19121.
Built from https://develop.svn.wordpress.org/trunk@36310


git-svn-id: http://core.svn.wordpress.org/trunk@36277 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-01-15 09:39:26 +00:00
Joe Hoyle
5036a79e73 Add missing HTTP status code descriptions (specifically 308 and 421.)
Props kraftbj.
Fixes 35336.

Built from https://develop.svn.wordpress.org/trunk@36274


git-svn-id: http://core.svn.wordpress.org/trunk@36241 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-01-13 02:55:26 +00:00
Joe Hoyle
dea447f04c Add support for 451 http status code (Unavailable For Legal Reasons.)
Though this is technically still in the proposal stage, there is support from the core team and precedent in #16914

Props andizer.
Fixes #35333.

Built from https://develop.svn.wordpress.org/trunk@36273


git-svn-id: http://core.svn.wordpress.org/trunk@36240 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-01-13 02:49:25 +00:00
Pascal Birchler
e7660a104d Introduce wp_get_raw_referer() to retrieve unvalidated referer.
For things like redirects `wp_get_referer()` should be used instead.

Props voldemortensen for initial patch.
Fixes #27152.
Built from https://develop.svn.wordpress.org/trunk@36266


git-svn-id: http://core.svn.wordpress.org/trunk@36233 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-01-12 08:32:28 +00:00
Pascal Birchler
d591f26ce7 Ensure wp_get_referer() returns false when the referrer URL is the current URL.
Adds unit tests.

Fixes #19856.
Built from https://develop.svn.wordpress.org/trunk@36242


git-svn-id: http://core.svn.wordpress.org/trunk@36209 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-01-09 14:36:26 +00:00
Sergey Biryukov
b742304f13 Docs: Clarify that wp_filter_object_list() accepts 'not' as its $operator parameter.
Props barryceelen.
See #35225.
Built from https://develop.svn.wordpress.org/trunk@36090


git-svn-id: http://core.svn.wordpress.org/trunk@36055 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-12-26 00:37:26 +00:00
John Blackbourn
0003a004db Docs: Miscellaneous docblock code quality tweaks.
See #32246

Built from https://develop.svn.wordpress.org/trunk@36074


git-svn-id: http://core.svn.wordpress.org/trunk@36039 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-12-23 07:53:26 +00:00
Andrea Fercia
f7f14d94f3 Accessibility: Improvements for the Authentication Check modal dialog "Close X".
Removes the title attribute and uses a `<button>` element instead of a `<div>`.
Also simplifies the CSS and takes care of the hover/focus style.

Fixes #35142.
Built from https://develop.svn.wordpress.org/trunk@36014


git-svn-id: http://core.svn.wordpress.org/trunk@35979 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-12-18 23:51:26 +00:00
Andrea Fercia
b5f5dff136 Authentication modal dialog: the spinner should disappear when loading is done.
Also, when using spinners as background images, the re-painted area should be the
smallest possible one. See similar performance issue in #33311.

Fixes #34951.
Built from https://develop.svn.wordpress.org/trunk@35925


git-svn-id: http://core.svn.wordpress.org/trunk@35889 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-12-14 16:40:27 +00:00
Sergey Biryukov
89e0d7dc9e I18N: In wp_maybe_decline_date(), bail early if translation functions are not available, e.g. in SHORTINIT mode.
Fixes #34967 for trunk.
Built from https://develop.svn.wordpress.org/trunk@35880


git-svn-id: http://core.svn.wordpress.org/trunk@35844 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-12-12 01:42:38 +00:00
Sergey Biryukov
d9faafbd44 I18N: Move translatable Codex URLs to separate strings in wp-includes/functions.php.
Props ramiy.
See #34687.
Built from https://develop.svn.wordpress.org/trunk@35667


git-svn-id: http://core.svn.wordpress.org/trunk@35631 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-11-18 17:41:27 +00:00
Sergey Biryukov
2583c1e4ec Replace 7 * DAY_IN_SECONDS with WEEK_IN_SECONDS in get_weekstartend().
Props MikeHansenMe.
Fixes #34603.
Built from https://develop.svn.wordpress.org/trunk@35556


git-svn-id: http://core.svn.wordpress.org/trunk@35520 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-11-06 16:37:27 +00:00
Sergey Biryukov
5d87e7d2b8 Introduce wp_maybe_decline_date() for languages where certain date formats need to be declined, and hook it to the date_i18n filter.
If the locale specifies that month names require a genitive case in certain formats like `'j F Y'` or `'j. F'`, the month name will be replaced with a correct form. 

Fixes #11226.
Built from https://develop.svn.wordpress.org/trunk@35517


git-svn-id: http://core.svn.wordpress.org/trunk@35481 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-11-04 21:28:26 +00:00
Andrea Fercia
04c2cd1913 Accessibility: Improve buttons focus and links style in the install screens.
Fixes #34530.
Built from https://develop.svn.wordpress.org/trunk@35494


git-svn-id: http://core.svn.wordpress.org/trunk@35458 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-11-03 17:59:24 +00:00
John Blackbourn
263b2890d4 Add wp-post-new-reload to the list of removable query vars so it doesn't persist in the URL.
Fixes #34510

Built from https://develop.svn.wordpress.org/trunk@35460


git-svn-id: http://core.svn.wordpress.org/trunk@35424 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-30 18:06:34 +00:00
Helen Hou-Sandí
8803c05db5 wp_die(): Update colors and button styling.
see #34388, #31459.

Built from https://develop.svn.wordpress.org/trunk@35327


git-svn-id: http://core.svn.wordpress.org/trunk@35293 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-21 15:23:26 +00:00
Drew Jaynes
81524f3bfc Filesystem: Following the introduction of the KB|MB|GB|TB_IN_BYTES constants in [35286], use them in various places in core.
Props sudar.
Fixes #22405.

Built from https://develop.svn.wordpress.org/trunk@35325


git-svn-id: http://core.svn.wordpress.org/trunk@35291 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-21 14:03:25 +00:00
Drew Jaynes
875c82f17f Media: Introduce the enclosure_links filter, which makes it possible to adjust the list of audio and video enclosure links derived from post content before querying the database.
Props niallkennedy, stevenkword.
Fixes #19890.

Built from https://develop.svn.wordpress.org/trunk@35288


git-svn-id: http://core.svn.wordpress.org/trunk@35254 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-20 07:09:25 +00:00
Scott Taylor
89d1eb1e00 Formatting: when making unique filenames in wp_unique_filename() by adding an incrementing number, prefix it with a dash to disambiguate from files that end in numbers.
Updates unit tests.

Props mikejolley, tyxla.
Fixes #21453.

Built from https://develop.svn.wordpress.org/trunk@35276


git-svn-id: http://core.svn.wordpress.org/trunk@35242 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-20 04:05:25 +00:00
Drew Jaynes
217b661703 Docs: Add missing descriptions for the $wpdb global in DocBlocks all the places.
See #32246.

Built from https://develop.svn.wordpress.org/trunk@35170


git-svn-id: http://core.svn.wordpress.org/trunk@35136 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-14 23:44:25 +00:00
Sergey Biryukov
c332da3e12 Feeds: Pass the feed name to do_feed_{$feed} action.
Props johnbillion.
See #34259.
Built from https://develop.svn.wordpress.org/trunk@35115


git-svn-id: http://core.svn.wordpress.org/trunk@35080 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-13 02:44:23 +00:00
Drew Jaynes
48811702cd Feeds: Simplify logic for checking if the do_feed_{$feed} action is hooked to any callbacks.
See [35097] for where the aforementioned hook was renamed to actually be dynamic, thus rendering creation of the extra `$hook` variable moot.

See #34264.

Built from https://develop.svn.wordpress.org/trunk@35098


git-svn-id: http://core.svn.wordpress.org/trunk@35063 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-13 01:07:25 +00:00
Drew Jaynes
b234b5d896 Feeds: Adjust the do_feed_{$feed} hook name to actually be dynamic, rather than pre-storing the tag name in a variable and referencing that.
Props johnbillion.
Fixes #34264.

Built from https://develop.svn.wordpress.org/trunk@35097


git-svn-id: http://core.svn.wordpress.org/trunk@35062 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-13 01:03:25 +00:00
Sergey Biryukov
7ef095171a In number_format_i18n(), check if $wp_locale is set before using it.
Props pauldewouters.
Fixes #31553.
Built from https://develop.svn.wordpress.org/trunk@35092


git-svn-id: http://core.svn.wordpress.org/trunk@35057 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-13 00:30:24 +00:00
Sergey Biryukov
0d7c5569f5 In do_robots(), allow crawling for admin-ajax.php, since it's often used on front-end.
Props dmchale, joostdevalk.
Fixes #33156.
Built from https://develop.svn.wordpress.org/trunk@34985


git-svn-id: http://core.svn.wordpress.org/trunk@34950 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-09 05:16:23 +00:00
Ryan McCue
b3051048be 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.

Built from https://develop.svn.wordpress.org/trunk@34927


git-svn-id: http://core.svn.wordpress.org/trunk@34892 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-08 02:14:25 +00:00
Ryan McCue
4bac3c3f14 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. 

Built from https://develop.svn.wordpress.org/trunk@34926


git-svn-id: http://core.svn.wordpress.org/trunk@34891 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-08 01:30:25 +00:00
John Blackbourn
c83a66cbf3 Add an optional $description parameter to status_header() so custom HTTP status descriptions can be provided.
Fixes #21472
Props nbachiyski, iamfriendly

Built from https://develop.svn.wordpress.org/trunk@34914


git-svn-id: http://core.svn.wordpress.org/trunk@34879 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-07 21:26:25 +00:00
Jeremy Felt
9926983b66 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.

Built from https://develop.svn.wordpress.org/trunk@34912


git-svn-id: http://core.svn.wordpress.org/trunk@34877 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-07 17:11:25 +00:00
Boone Gorges
226bb29ff0 Move wp_installing() to load.php.
Various functions in load.php need to check whether WP is in installation mode.
Let's let them.

Props adamsilverstein.
See #31130.
Built from https://develop.svn.wordpress.org/trunk@34896


git-svn-id: http://core.svn.wordpress.org/trunk@34861 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-07 03:02:23 +00:00
Scott Taylor
4d3223b28e Introduce wp_get_server_protocol() to DRY protocol parsing logic and make adding more protocols, like HTTP/2, easier.
Props johnbillion, wonderboymusic.
Fixes #34131.

Built from https://develop.svn.wordpress.org/trunk@34894


git-svn-id: http://core.svn.wordpress.org/trunk@34859 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-07 02:35:26 +00:00
Scott Taylor
0c6ee34d00 REST API: add a utility function, mysql_to_rfc3339() to functions.php
Background:
6d0ad766ca

Props rmmcue.
See #33982.

Built from https://develop.svn.wordpress.org/trunk@34846


git-svn-id: http://core.svn.wordpress.org/trunk@34811 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-06 03:19:25 +00:00
Boone Gorges
0e7c1d3b14 Use wp_installing() instead of WP_INSTALLING constant.
The `WP_INSTALLING` constant is a flag that WordPress sets in a number of
places, telling the system that options should be fetched directly from the
database instead of from the cache, that WP should not ping wordpress.org for
updates, that the normal "not installed" checks should be bypassed, and so on.

A constant is generally necessary for this purpose, because the flag is
typically set before the WP bootstrap, meaning that WP functions are not yet
available.  However, it is possible - notably, during `wpmu_create_blog()` -
for the "installing" flag to be set after WP has already loaded. In these
cases, `WP_INSTALLING` would be set for the remainder of the process, since
there's no way to change a constant once it's defined. This, in turn, polluted
later function calls that ought to have been outside the scope of site
creation, particularly the non-caching of option data. The problem was
particularly evident in the case of the automated tests, where `WP_INSTALLING`
was set the first time a site was created, and remained set for the rest of the
suite.

The new `wp_installing()` function allows developers to fetch the current
installation status (when called without any arguments) or to set the
installation status (when called with a boolean `true` or `false`). Use of
the `WP_INSTALLING` constant is still supported; `wp_installing()` will default
to `true` if the constant is defined during the bootstrap.

Props boonebgorges, jeremyfelt.
See #31130.
Built from https://develop.svn.wordpress.org/trunk@34828


git-svn-id: http://core.svn.wordpress.org/trunk@34793 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-05 15:06:28 +00:00
John Blackbourn
5e98b20e84 Adjust _default_wp_die_handler() formatting so it doesn't confuse Sublime Text's parsing and syntax highlighting.
Fixes #34135

Built from https://develop.svn.wordpress.org/trunk@34793


git-svn-id: http://core.svn.wordpress.org/trunk@34758 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-03 01:32:24 +00:00
Jeremy Felt
54512d64cb MS: Use *_network_option() functions throughout core.
Replaces all uses of `*_site_option()` with the corresponding "network" function.

This excludes one usage in `wp-admin/admin-footer.php` that needs more investigation.

Props spacedmonkey.
See #28290.

Built from https://develop.svn.wordpress.org/trunk@34778


git-svn-id: http://core.svn.wordpress.org/trunk@34743 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-02 19:08:26 +00:00
John Blackbourn
a8728b987f Deprecate force_ssl_login(), which is simply a wrapper for force_ssl_admin() and is not used in core.
Fixes #34011

Built from https://develop.svn.wordpress.org/trunk@34700


git-svn-id: http://core.svn.wordpress.org/trunk@34664 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-29 21:28:50 +00:00
John Blackbourn
aa35e473f7 callback is not a valid type in PHP, PSR-5, or phpDocumentor. callable should be used instead.
Fixes #34032

Built from https://develop.svn.wordpress.org/trunk@34566


git-svn-id: http://core.svn.wordpress.org/trunk@34530 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-25 23:58:25 +00:00
Drew Jaynes
f84c653fad Docs: Clarify the summary and optional $query parameter description for remove_query_arg().
Props johnbillion.
Fixes #33912.

Built from https://develop.svn.wordpress.org/trunk@34512


git-svn-id: http://core.svn.wordpress.org/trunk@34476 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-24 19:34:24 +00:00
Drew Jaynes
92574015aa Docs: Overhaul the DocBlock for add_query_arg() to attempt to better explain the various call signatures it accepts.
Also adds a couple of in-DocBlock examples illustrating single key and value, and associative array usage. Retains the note about the unescaped return value.

Props johnbillion.
See #33912.

Built from https://develop.svn.wordpress.org/trunk@34511


git-svn-id: http://core.svn.wordpress.org/trunk@34475 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-24 19:32:24 +00:00
Scott Taylor
84da11d918 Pass false as the 2nd argument to class_exists() to disable autoloading and to not cause problems for those who define __autoload().
Fixes #20523.

Built from https://develop.svn.wordpress.org/trunk@34348


git-svn-id: http://core.svn.wordpress.org/trunk@34312 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-20 03:52:25 +00:00