Commit Graph

1614 Commits

Author SHA1 Message Date
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
Helen Hou-Sandí
48befcf361 Superglobals: Revert [34059] until further notice.
see #33837.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34229 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-17 12:33:26 +00:00
Drew Jaynes
e13d18969f Docs: Add a reminder to the DocBlock description for add_query_arg() mentioning that the output is not escaped by default.
Props brentvr for the initial patch. (first props!)
See #33912. See #32246.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34228 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-17 09:39:24 +00:00
Scott Taylor
c871986819 Uploader: Fire 'wp_handle_upload' in wp_upload_bits(). Thusly, the filter in wp_xmlrpc_server::mw_newMediaObject() is redundant.
Props dllh.
Fixes #33539.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34221 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-17 04:46:25 +00:00
Scott Taylor
b1bc8a6522 More comment functions can accept a full object instead of comment_ID to reduce cache/db lookups.
See ##33638.


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


git-svn-id: http://core.svn.wordpress.org/trunk@34097 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-14 21:40:24 +00:00
Dion Hulse
476b5c2046 When running on windows systems, normalise the capitalisation of the drive letter for more reliable string comparisons.
Props tyxla
Fixes #33265

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


git-svn-id: http://core.svn.wordpress.org/trunk@34072 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-14 01:59:25 +00:00
Scott Taylor
cd7c0f0b0d Introduce wp_validate_action( $action = '' ), a helper function that checks $_REQUEST for action and returns it, or empty string if not present. If $action is passed, it checks to make sure they match before returning it, or an empty string. Strings are always returned to avoid returning multiple types.
Implementing this removes 27 uses of direct superglobal access in the admin.

For more reading:
https://codeclimate.com/github/WordPress/WordPress/wp-admin/edit-comments.php

See #33837.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34027 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-11 21:08:26 +00:00
Scott Taylor
62ec4a3bfd Deprecate wp_get_http() - function isn't used anywhere (apart from itself).
Props swissspidy.
Fixes #33709.

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


git-svn-id: http://core.svn.wordpress.org/trunk@33938 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-09 04:26:25 +00:00
John Blackbourn
606b6d15f1 Introduce wp_removable_query_args(), which returns an array of single-use query variables which can be removed from a URL.
Also applies the function to the return URL when the Customizer is closed.

Fixes #32692
Props swissspidy, Mte90

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


git-svn-id: http://core.svn.wordpress.org/trunk@33817 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-02 11:29:23 +00:00
Gary Pendergast
48e83418ed When wp_json_encode() calls json_encode(), the latter will generate warnings if the string contains non-UTF-8 characters. No-one likes warnings, so we need to do something about that.
The good news is, the point of `wp_json_encode()` is to handle those non-UTF-8 characters. It'll totally just fix them up, no problem.

Anyway, we can just ignore those warnings.

Fixes #33524.


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


git-svn-id: http://core.svn.wordpress.org/trunk@33715 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-08-26 03:26:21 +00:00
Scott Taylor
ef87172270 foreach is a statement, not a function.
See #33491.

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


git-svn-id: http://core.svn.wordpress.org/trunk@33702 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-08-25 20:28:22 +00:00
Drew Jaynes
ceec5ac00b Fix inline documentation syntax for a few general-purpose functions and hooks added in 4.3.
* `_deprecated_constructor()` See [32989]
* `deprecated_constructor_trigger_error` See [32989]
* `get_main_network_id()` See [32775]
* `wp_post_preview_js()` See [32809]

See #32891.

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


git-svn-id: http://core.svn.wordpress.org/trunk@33198 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-07-13 21:35:24 +00:00
Aaron Jorbin
a6ebaefb92 Add Deprecated Constructor Function
This function is one that can be called in core to indicate that a PHP4 style constructor is used. PHP4 style constructors are deprecated in PHP7.

Props jorbin, DrewAPicture for docs
See #31982


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


git-svn-id: http://core.svn.wordpress.org/trunk@32960 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-06-28 14:56:24 +00:00
Scott Taylor
642af1f3f4 Some doc blocks should use bool instead of true|false
See #32444.

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


git-svn-id: http://core.svn.wordpress.org/trunk@32934 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-06-27 00:45:24 +00:00
Drew Jaynes
25829e05fa Add line-wrapping to a long return description because readability in documentation is important.
See [32797]. See #32421.

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


git-svn-id: http://core.svn.wordpress.org/trunk@32781 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-06-16 23:18:25 +00:00
Andrew Ozz
82fcdec660 Editor: do not reuse the preview tab when the user has navigated away.
See #32588.
Built from https://develop.svn.wordpress.org/trunk@32809


git-svn-id: http://core.svn.wordpress.org/trunk@32780 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-06-16 23:13:26 +00:00
Scott Taylor
5c6b63d3a6 if is a statment, not a function.
See #32444.

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


git-svn-id: http://core.svn.wordpress.org/trunk@32771 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-06-16 20:01:25 +00:00
Scott Taylor
efbb8fa4e5 Document the default list of allowed protocols in the doc block for wp_allowed_protocols() and cross-reference in esc_url() and the kses_allowed_protocols filter.
Props GunGeekATX.
Fixes #32421.

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


git-svn-id: http://core.svn.wordpress.org/trunk@32768 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-06-16 19:45:26 +00:00
Jeremy Felt
947eef9468 Introduce get_main_network_id()
Expand on the logic previously available as part of `is_main_network()` and provide a way to obtain the ID of the main network. Most useful in multi-network configurations.

Props @johnjamesjacoby for the initial patch.
Fixes #30294.

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


git-svn-id: http://core.svn.wordpress.org/trunk@32746 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-06-14 21:45:25 +00:00
Scott Taylor
19a3aacc94 Add @static* annotations where they are missing.
Initialize all static vars that are not, most to `null`.

See #32444.

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


git-svn-id: http://core.svn.wordpress.org/trunk@32620 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-05-29 15:43:29 +00:00
Scott Taylor
89a6ace623 Add missing doc blocks to wp-includes/functions.php.
See #32444.

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


git-svn-id: http://core.svn.wordpress.org/trunk@32565 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-05-25 16:11:25 +00:00
Jeremy Felt
3471545942 s/anbled/enabled/ in global_terms_enabled filter documentation.
Fixes #32436.

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


git-svn-id: http://core.svn.wordpress.org/trunk@32483 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-05-19 06:35:25 +00:00
John Blackbourn
1c40b495a1 Add a viewport meta tag to wp_die().
Props leogopal

Fixes #29336

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


git-svn-id: http://core.svn.wordpress.org/trunk@32471 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-05-13 04:08:25 +00:00
Andrew Nacin
62d845f32b Add a comment to maybe_serialize().
Built from https://develop.svn.wordpress.org/trunk@32458


git-svn-id: http://core.svn.wordpress.org/trunk@32428 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-05-08 16:27:27 +00:00
Boone Gorges
d9e8492ea8 Add 'webcal' to the list of URI protocols whitelisted by default.
Fixes #31666.
Built from https://develop.svn.wordpress.org/trunk@32346


git-svn-id: http://core.svn.wordpress.org/trunk@32317 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-05-05 00:38:27 +00:00
Sergey Biryukov
cb1ad98015 Fix typo in a comment in wp_guess_url().
props ixkaito.
fixes #32179.
Built from https://develop.svn.wordpress.org/trunk@32325


git-svn-id: http://core.svn.wordpress.org/trunk@32296 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-04-29 07:19:29 +00:00
Gary Pendergast
024e7bbd46 Revert [30640], as it was incorrectly checking some filenames.
Built from https://develop.svn.wordpress.org/trunk@32171


git-svn-id: http://core.svn.wordpress.org/trunk@32146 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-04-20 06:39:25 +00:00
Dominik Schilling
64fc7294b6 Use HTTPS URLs for codex.wordpress.org.
see #27115.
Built from https://develop.svn.wordpress.org/trunk@32116


git-svn-id: http://core.svn.wordpress.org/trunk@32095 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-04-12 21:29:32 +00:00
Gary Pendergast
acef02f060 Smilies: One more tweak to matching smilies with emoji.
Props iseulde.

See #31709.


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


git-svn-id: http://core.svn.wordpress.org/trunk@32086 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-04-11 02:17:29 +00:00
Gary Pendergast
56f59c2ad7 Smilies: Tweak which smiley matches which emoji.
Props iseulde.

See #31709.


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


git-svn-id: http://core.svn.wordpress.org/trunk@32084 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-04-10 06:30:26 +00:00
Gary Pendergast
b7c7882d1c Smilies: Update our few remaining smilies to better align with Twemoji, and add frownie.png until Twemoji provide a build containing it.
Props joen.

See #31709.


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


git-svn-id: http://core.svn.wordpress.org/trunk@32083 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-04-10 06:20:26 +00:00
Boone Gorges
481352bd2e Avoid the use of array_replace() in add_query_arg().
`array_replace()` was introduced PHP 5.3+. Instead, we walk the array manually.

See [31966].

Fixes #31306.
Built from https://develop.svn.wordpress.org/trunk@31967


git-svn-id: http://core.svn.wordpress.org/trunk@31946 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-04-01 19:40:26 +00:00
Scott Taylor
c113cb5130 Respect numerical keys in add_query_arg(), use array_replace() instead of array_merge().
Adds unit test.

Props tyxla.
Fixes #31306.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31945 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-04-01 19:15:31 +00:00
Drew Jaynes
79f58d9d40 Clarify the DocBlock summary for wp_scheduled_delete() to mention that it includes posts of any type where the 'trash' status is used.
Props dkotter for the initial patch.
Fixes #31757.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31870 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-03-25 22:45:27 +00:00
Andrew Ozz
64f1a8a992 TinyMCE: fix error and PHP warning when adding more than one instance in RTL mode.
Part props maimairel. Fixes #31578.
Built from https://develop.svn.wordpress.org/trunk@31874


git-svn-id: http://core.svn.wordpress.org/trunk@31853 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-03-24 20:33:27 +00:00
Gary Pendergast
46e2a65cf1 Add emoji support, with Twemoji fallback.
Replace exisiting smilies with equivalent emoji, or with shiny new smiley images where no emoji existed.

Props batmoo, joen and mkaz for the original plugin upon which this is based.

Props pento, iseulde, kraftbj and peterwilsoncc for making the internet's dreams come true.

See #31242


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


git-svn-id: http://core.svn.wordpress.org/trunk@31714 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-03-11 22:49:28 +00:00
Drew Jaynes
a49cd7851b Add an entry to the changelog for wp_get_mime_types() mentioning that GIMP (xcf) file support was added in 4.2.
See [31578].
Fixes #31146.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31571 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-03-01 07:10:26 +00:00
Scott Taylor
7994009296 Support GIMP files in the Media Library. We already support Photoshop files.
Props MikeHansenMe.
Fixes #31146.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31559 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-02-27 19:47:25 +00:00
Scott Taylor
f6b1b01ecd Make a new function, wp_delete_file(). Use it.
Props scribu, wonderboymusic.
Fixes #17864.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31556 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-02-27 16:51:25 +00:00
Scott Taylor
7cb45f2402 Don't call the size function count() as part of a test condition in loops. Compute the size beforehand, and not on each iteration.
Scrutinizer added a Performance label: these are the only violations.

See #30799.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31535 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-02-26 05:48:24 +00:00
Boone Gorges
6505278ea7 Improve documentation for return value of wp_list_pluck().
`wp_list_pluck()` will preserve the original array keys if no `$index_key`
parameter is provided. This changeset updates the documentation accordingly.

Props adamsilverstein.
Fixes #31316.
Built from https://develop.svn.wordpress.org/trunk@31451


git-svn-id: http://core.svn.wordpress.org/trunk@31432 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-02-13 16:52:27 +00:00
Scott Taylor
bc55996a0b @param cleanup:
* `get_metadata()` will return literally anything, needs to be `mixed`
* `wp()` and `WP_Query::__construct()` no longer just take a query string
* Clarify a few others

See #30799.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31193 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-16 19:03:23 +00:00
Drew Jaynes
f2bc30c03f Ensure we're using the correct @ignore phpDocumentor tag to mark elements that should be skipped when parsing.
Up to this point, various core elements' DocBlocks incorrectly included an `@internal` tag as a means for skipping the parsing process. When paired with a description (inline or otherwise), `@internal` is a valid tag meant to provide internal-only context, but not necessarily to skip parsing the entire element.

See #30987.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31151 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-13 00:51:21 +00:00
Scott Taylor
ac654632fe Use PHP_SAPI constant instead of php_sapi_name() in iis7_supports_permalinks(), wp_fix_server_vars(), and wp_redirect().
See #30799.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31101 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-10 04:59:22 +00:00
Scott Taylor
60b0cd7943 The keyword elseif should be used instead of else if so that all control keywords look like single words.
This was a mess, is now standardized across the codebase, except for a few 3rd-party libs. 

See #30799.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31071 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-08 07:05:25 +00:00
Scott Taylor
29cd3fa5bf PHP keywords and constants "true", "false", "null" should be in lower case - there was one lingering capitalized false in _http_build_query().
See #30799.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31067 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-08 06:14:23 +00:00
Gary Pendergast
e6a74136f9 size_format() incorrectly included a trailing space for B values: less than 1024 bytes.
Also add a unit test to check for this, so we don't do it again.

Fixes #30908.

Props tillkruess.
 

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


git-svn-id: http://core.svn.wordpress.org/trunk@31033 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-05 13:13:23 +00:00
Scott Taylor
be59efcfbf ImageMagick expects TIFF files to have .tiff as an extension, so the key in wp_get_mime_types() should be 'tiff|tif' not 'tif|tiff' so the proper extension is returned in WP_Image_Editor->get_extension() subclass invocations.
Fixes #30211.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31025 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-04 03:09:22 +00:00
Scott Taylor
a0df295f5c Improve various @param docs.
See #30224.

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


git-svn-id: http://core.svn.wordpress.org/trunk@30664 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-30 23:24:25 +00:00
Drew Jaynes
bffe95d34c Docs Formatting: Backtick-escape inline code for all remaining dynamic hook docs in wp-includes/*.
Affects DocBlocks for the following hooks:
* `auth_post_meta_{$meta_key}`
* `term_links-$taxonomy`
* `customize_render_control_ . $this->id`
* `customize_render_panel_{$this->id}`
* `customize_render_section_{$this->id}`
* `customize_preview_{$this->id}`
* `customize_save_ . $this->id_data[ 'base' ]`
* `customize_update_ . $this->type`
* `customize_value_ . $this->id_data[ 'base' ]`
* `customize_sanitize_js_{$this->id}`
* `comment_form_field_{$name}`
* `comment_{$old_status}_to_{$new_status}`
* `comment_{$new_status}_{$comment->comment_type}`
* `extra_{$context}_headers`
* `get_template_part_{$slug}`
* `get_the_generator_{$type}`
* `get_{$adjacent}_post_join`
* `get_{$adjacent}_post_where`
* `get_{$adjacent}_post_sort`
* `{$adjacent}_post_rel_link`
* `{$adjacent}_post_link`
* `{$adjacent}_image_link`
* `blog_option_{$option}`
* `$permastructname . _rewrite_rules`
* `{$type}_template`
* `theme_mod_{$name}`
* `pre_set_theme_mod_$name`
* `current_theme_supports-{$feature}`
* `get_user_option_{$option}`
* `edit_user_{$field}`
* `pre_user_{$field}`
* `user_{$field}`

See #30552.

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


git-svn-id: http://core.svn.wordpress.org/trunk@30646 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-30 12:10:23 +00:00
Scott Taylor
4718bf4f76 Adjust the RegEx in wp_check_filetype() to be aware that query strings are thing that exist sometimes in URLs.
Adds unit tests.

Props voldemortensen.
Fixes #30377.

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


git-svn-id: http://core.svn.wordpress.org/trunk@30630 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-30 06:33:23 +00:00
Drew Jaynes
a1f244d454 Improve line-wrapping and formatting in the DocBlock for wp_send_json_error().
See #30469.

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


git-svn-id: http://core.svn.wordpress.org/trunk@30604 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-28 11:39:22 +00:00
Drew Jaynes
68432b0cd1 4.1 Docs Audit: Ensure optional arguments in wp_json_encode() are properly documented as such.
See #30469.

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


git-svn-id: http://core.svn.wordpress.org/trunk@30603 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-28 11:36:23 +00:00
Gary Pendergast
a62fc4e4e5 When json_encode() returns a JSON string containing 'null' in PHP 5.4 or earlier, wp_json_encode() will now sanity check the data, as older versions of PHP failed to encode non UTF-8 characters correctly, instead returning 'null'.
Fixes #30471.

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


git-svn-id: http://core.svn.wordpress.org/trunk@30550 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-25 05:01:23 +00:00
Drew Jaynes
07c58f5cca Ensure inline code is markdown-escaped as such, HTML tags are removed from summaries, and that code snippets in descriptions are properly indented.
Affects DocBlocks for the following core elements:
* Markdown-indent a code snippet in the description for `_deprecated_argument()`
* Markdown-indent a code snippet in the description for `wp_localize_script()`
* Backtick-escape HTML tags in two parameter descriptions for `wp_register()`
* Various DocBlock formatting in the description for `get_bloginfo()`
* Remove HTML tag from the summary for `_wp_render_title_tag()`
* Backtick-escape a HTML tag in the description for `get_archives_link()`
* Markdown-indent a code snippet in the description for `wp_admin_css_color()`
* Markdown-indent a code snippet in the description for the `welcome_panel` hook

Props rarst.
See #30473.

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


git-svn-id: http://core.svn.wordpress.org/trunk@30530 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-24 05:39:22 +00:00
Drew Jaynes
0fb8811fb6 Improve return description for get_file_data() documentation.
Also convert an incorrect use of `@see` to `@link`.

Props 5um17 for the initial patch.
Fixes #30466.

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


git-svn-id: http://core.svn.wordpress.org/trunk@30521 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-23 17:57:22 +00:00
John Blackbourn
b66c58f76a Update the inline docs for wp_die() to reflect parameter changes made in r30355
See #10551

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


git-svn-id: http://core.svn.wordpress.org/trunk@30496 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-21 17:08:23 +00:00
John Blackbourn
53a9e3b420 Add support for WP_Error objects passed to wp_send_json_error(). The error object gets output as an array of error codes and messages, rather than as an empty object.
Fixes #28978
Props paulschreiber

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


git-svn-id: http://core.svn.wordpress.org/trunk@30495 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-21 16:56:23 +00:00
Drew Jaynes
5943966b69 Ensure the mixed type of string|int is reflected on the $title parameter in wp_die().
The ability to pass an error code as short-hand to the `$title` and `$args` parameters was added in r30355. Changes also include cleaned-up formatting and line-wraps for other documentation in the DocBlock.

See [30355]. Fixes #10551.

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


git-svn-id: http://core.svn.wordpress.org/trunk@30376 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-18 16:47:23 +00:00
John Blackbourn
d88ed475b0 Switch to a 403 response code in places where it is more appropriate than a 500 due to permissions errors.
Fixes #10551
Props nacin

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


git-svn-id: http://core.svn.wordpress.org/trunk@30355 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-16 06:16:22 +00:00
John Blackbourn
5f30f13780 Allow the response code to be passed as a shorthand to the $title or $args parameter of wp_die(), for brevity.
See #10551 and #11286
Props nacin

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


git-svn-id: http://core.svn.wordpress.org/trunk@30354 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-16 06:11:22 +00:00
Boone Gorges
89526ca7f1 Ignore case when checking string 'false' in wp_validate_boolean().
Props TobiasBg, kitchin.
Fixes #30238.
Built from https://develop.svn.wordpress.org/trunk@30207


git-svn-id: http://core.svn.wordpress.org/trunk@30207 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-03 15:55:23 +00:00
Scott Taylor
3e4ca28eb9 Correct the @param type for the $query arg for remove_query_arg().
See #30224.

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


git-svn-id: http://core.svn.wordpress.org/trunk@30191 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-03 05:29:22 +00:00
Scott Taylor
fbd6efdfb8 In _wp_json_convert_string(), when $use_mb is false, perhaps pass a variable that actually exists to wp_check_invalid_utf8().
Introduced in [30055].
See #30224.

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


git-svn-id: http://core.svn.wordpress.org/trunk@30162 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-01 22:00:24 +00:00
Drew Jaynes
66c47f29bb Correct references of @uses $wpdb in core documentation to use @global.
See #30191, [30105].
Fixes #30217.

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


git-svn-id: http://core.svn.wordpress.org/trunk@30122 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-31 17:56:22 +00:00
Drew Jaynes
f8657d5890 Remove redundant and erroneous @uses tag from most core inline documentation.
Per our inline documentation standards, no further use of the `@uses` tag is recommended as used and used-by relationships can be derived through other means. This removes most uses of the tag in core documentation, with remaining tags to be converted to `@global` or `@see` as they apply.

Fixes #30191.

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


git-svn-id: http://core.svn.wordpress.org/trunk@30105 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-30 01:05:24 +00:00
Mark Jaquith
a81a321f9a Docs and code standards cleanup for [30055] (wp_json_encode() & friends)
fixes #28786
props TobiasBg
Built from https://develop.svn.wordpress.org/trunk@30078


git-svn-id: http://core.svn.wordpress.org/trunk@30078 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-28 21:29:23 +00:00
Scott Taylor
315612a96b Adjust caching for get_term_by() calls:
* Remove md5 hashes for term name cache keys
* Remove the namespace for the keys for `names` and `slugs` and add them to the group names
* Remove `wp_get_last_changed()`, which @nacin hated
 
Props tollmanz.
Fixes #21760.

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


git-svn-id: http://core.svn.wordpress.org/trunk@30073 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-28 21:05:23 +00:00
Gary Pendergast
3495fa40df Fix a PHPDoc typo for wp_json_encode().
Props JustinSainton.

See #28786.

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


git-svn-id: http://core.svn.wordpress.org/trunk@30058 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-28 18:54:18 +00:00
Gary Pendergast
007ec52958 Add wp_json_encode(), a wrapper for json_encode() that ensures everything is converted to UTF-8.
Change all core calls from `json_encode()` to `wp_json_encode()`.

Fixes #28786.


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


git-svn-id: http://core.svn.wordpress.org/trunk@30055 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-28 18:35:19 +00:00
Scott Taylor
84a26a78a8 Cache get_term_by() calls:
* Add a helper function, `wp_get_last_changed()`, to retrieve a last-modified timestamp by cache group
* When caching a term, also make cache entries for slug and name via `slug:{$term_id}` and `name:{$term_id}` keys in the `$taxonomy:$last_changed` bucket that reference the term_id
* In `clean_term_cache()` and `update_term_cache()`, respect `$_wp_suspend_cache_invalidation`
* Original term cache entries maintain BC

Adds unit tests.

Props wonderboymusic, tollmanz, boonebgorges.
Fixes #21760.

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


git-svn-id: http://core.svn.wordpress.org/trunk@29668 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-16 04:45:17 +00:00
Scott Taylor
b98f03669c Allow PSDs (Photoshop documents) to be uploaded.
Props michalzuber, ccprice.
Fixes #28805.

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


git-svn-id: http://core.svn.wordpress.org/trunk@29597 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-03 19:52:17 +00:00
Mark Jaquith
0d3b83551f Use HTTPS URLs for core.trac.wordpress.org
see #27115
Built from https://develop.svn.wordpress.org/trunk@29788


git-svn-id: http://core.svn.wordpress.org/trunk@29560 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-09-29 13:28:16 +00:00
Scott Taylor
491c91196f wp_extract_urls() needs to also grab URLs with query strings and hashes.
Updates unit test.

Props hauvong, dlh.
Fixes #29314.

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


git-svn-id: http://core.svn.wordpress.org/trunk@29528 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-09-23 02:50:19 +00:00
Scott Taylor
69dbf4f5df Clarify that get_the_date(), get_the_time(), get_post_time() and get_post_modified_time() should return false when get_post() is null.
Adds unit tests.

Props GaryJ, SergeyBiryukov, tollmanz.
Fixes #28310.

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


git-svn-id: http://core.svn.wordpress.org/trunk@29122 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-01 18:40:16 +00:00
Sergey Biryukov
aca4a37c1d Make sure phpinfo() is not disabled before calling it in apache_mod_loaded().
props rohan013, harmr.
fixes #26772.
Built from https://develop.svn.wordpress.org/trunk@29330


git-svn-id: http://core.svn.wordpress.org/trunk@29110 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-07-30 17:28:17 +00:00
Dominik Schilling
241addd9ab Revert [28894] as it's currently unused in core.
see #28487.
Built from https://develop.svn.wordpress.org/trunk@29309


git-svn-id: http://core.svn.wordpress.org/trunk@29091 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-07-27 17:16:17 +00:00
Drew Jaynes
c5a59037f1 Inline documentation cleanup for 4.0 audit.
Various improvements:
* Adds `@see` reference for `wp_list_comments()` in 'wp_list_comments_args' filter docs, added in [28285]
* Various phpDoc tweaks for the 'run_wptexturize' filter docs, added in [28715]
* Sentence and wrapping changes for `is_https_url()`, added in [28894]
* Documents the `$args` parameter for `wp_dropdown_languages()`, added in [29007]
* Adds a period to the parameter description for `_update_posts_count_on_delete()`, added in [28835]
* Documents a global in `is_customize_preview()`, added in [28999]
* phpDoc tweaks, adds an access modifier for `wpdb::esc_like()`, added in [28711]

See #28885.

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


git-svn-id: http://core.svn.wordpress.org/trunk@28947 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-07-14 01:02:15 +00:00
Drew Jaynes
f5b5b89e66 Fix inconsistent language in two function descriptions in wp-includes/functions.php.
Also adds correct coding standards to a code sample in `_deprecated_argument()`.

Props TobiasBg.
Fixes #26185.

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


git-svn-id: http://core.svn.wordpress.org/trunk@28801 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-07-07 07:08:15 +00:00
Drew Jaynes
9f8ddaa627 General inline documentation improvements in wp-includes/functions.php.
Final run. Fixes #26185.

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


git-svn-id: http://core.svn.wordpress.org/trunk@28799 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-07-07 06:19:14 +00:00
Sergey Biryukov
440c78d405 Some fixes for get_weekstartend() docs.
see #26185.
Built from https://develop.svn.wordpress.org/trunk@28937


git-svn-id: http://core.svn.wordpress.org/trunk@28735 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-07-01 14:59:15 +00:00
Drew Jaynes
300c53e6fe General inline documentation improvements in wp-includes/functions.php.
Second run. See #26185.

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


git-svn-id: http://core.svn.wordpress.org/trunk@28734 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-07-01 01:44:15 +00:00
Sergey Biryukov
f7703c03d3 Remove free-spacing modifier and extra spaces from wp_extract_urls() pattern.
fixes #28222.
Built from https://develop.svn.wordpress.org/trunk@28933


git-svn-id: http://core.svn.wordpress.org/trunk@28731 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-06-30 23:09:16 +00:00
Drew Jaynes
c97a364b79 General inline documentation improvements in wp-includes/functions.php.
First run. See #26185.

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


git-svn-id: http://core.svn.wordpress.org/trunk@28717 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-06-30 03:56:15 +00:00
Drew Jaynes
36be4e5703 Improve inline documentation for date_i18n(), _http_build_query(), wp_checkdate(), and wp_auth_check().
Props morganestes.
See #26185.

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


git-svn-id: http://core.svn.wordpress.org/trunk@28716 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-06-30 03:47:16 +00:00
Andrew Nacin
708f73ccc9 Add index key support for wp_list_pluck(), à la array_column().
props trepmal.
fixes #28666.

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


git-svn-id: http://core.svn.wordpress.org/trunk@28699 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-06-29 21:26:17 +00:00
John Blackbourn
de664966b0 Introduce is_https_url() for testing whether the scheme for a given URL is https. See #28487.
Built from https://develop.svn.wordpress.org/trunk@28894


git-svn-id: http://core.svn.wordpress.org/trunk@28693 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-06-29 11:32:15 +00:00
Scott Taylor
0e3c4450cb wp_extract_urls() should not match dates.
Updates unit tests.

Props hinnerk, sergej.mueller.
Fixes #28222.

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


git-svn-id: http://core.svn.wordpress.org/trunk@28681 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-06-28 04:16:14 +00:00
Scott Taylor
a21d9cdacf Do not touch absint(). Reverts [28855].
Built from https://develop.svn.wordpress.org/trunk@28858


git-svn-id: http://core.svn.wordpress.org/trunk@28661 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-06-26 18:45:14 +00:00
Scott Taylor
ff8e9774ae Revert [28856] at nacin's behest. See #23383.
Built from https://develop.svn.wordpress.org/trunk@28857


git-svn-id: http://core.svn.wordpress.org/trunk@28660 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-06-26 18:34:15 +00:00
Scott Taylor
cd93bc05e5 absint() should always return PHP_INT_MAX if the resulting value exceeds it.
See [28855].
Fixes #23383.

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


git-svn-id: http://core.svn.wordpress.org/trunk@28659 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-06-26 18:24:15 +00:00
Scott Taylor
bae2b054ad Add a second optional parameter to absint() to limit the result to PHP_INT_MAX.
See #23383.

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


git-svn-id: http://core.svn.wordpress.org/trunk@28658 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-06-26 17:52:15 +00:00
Scott Taylor
4bcf6b2d6a Add mime support for 3gp, 3g2 and 3gpp video formats. These are not supported by MediaElement or the WP media shortcodes, just an FYI.
Props azaozz, m_uysl.
Fixes #23380.

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


git-svn-id: http://core.svn.wordpress.org/trunk@28645 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-06-26 01:43:15 +00:00
Sergey Biryukov
8b272f4379 Remove mbstring_binary_safe_strlen(). Use mbstring_binary_safe_encoding() and reset_mbstring_encoding() directly.
fixes #28162.
Built from https://develop.svn.wordpress.org/trunk@28808


git-svn-id: http://core.svn.wordpress.org/trunk@28617 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-06-23 22:21:15 +00:00
Sergey Biryukov
9ceb642b2a Introduce a binary-safe wrapper for strlen() and use it in seems_utf8(), utf8_uri_encode(), and wp_read_image_metadata().
Use binary-safe POMO_Reader::strlen() in MO::export_to_file_handle().

fixes #28162.
Built from https://develop.svn.wordpress.org/trunk@28806


git-svn-id: http://core.svn.wordpress.org/trunk@28615 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-06-23 14:48:14 +00:00
Andrew Nacin
bbff31baca Stop denying wp-includes/* in our default robots.txt.
props joostdevalk.
fixes #28604.

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


git-svn-id: http://core.svn.wordpress.org/trunk@28607 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-06-20 21:02:14 +00:00
Scott Taylor
6cb51c9ceb smilies_init(), treat &nbsp; like whitespace when converting smilies.
Adds unit tests.

Props miqrogroove.
Fixes #27587.

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


git-svn-id: http://core.svn.wordpress.org/trunk@28531 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-06-10 02:03:14 +00:00
Scott Taylor
05eeb16e30 Replace all uses of like_escape() with $wpdb->esc_like().
Props miqrogroove.
See #10041.

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


git-svn-id: http://core.svn.wordpress.org/trunk@28528 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-06-10 00:44:15 +00:00
John Blackbourn
d00b196084 Deprecate url_is_accessable_via_ssl(). Fixes #19555. Props jgadbois.
Built from https://develop.svn.wordpress.org/trunk@28709


git-svn-id: http://core.svn.wordpress.org/trunk@28525 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-06-09 22:03:18 +00:00