If a user is installing WordPress for the first time and has set `WP_DEBUG` to true, a PHP error during installation makes for a visually jarring experience.
Fixes#37358
git-svn-id: https://develop.svn.wordpress.org/trunk@38423 602fd350-edb4-49c9-b593-d223f7449a82
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
git-svn-id: https://develop.svn.wordpress.org/trunk@38422 602fd350-edb4-49c9-b593-d223f7449a82
When testing the transports, the transport name needs to be capitalized for the class name to be correct (`WP_Http_Curl` vs. `WP_Http_curl` ).
See #36335.
git-svn-id: https://develop.svn.wordpress.org/trunk@38416 602fd350-edb4-49c9-b593-d223f7449a82
`wp_version_check()`, `wp_update_plugins()` and `wp_update_themes()` are all originally hooked to the `upgrader_process_complete` action with zero arguments passed to them. Zero arguments should be passed when re-adding them after translation updates, otherwise the sky will fall.
Props ionutst, gitlost.
Fixes#37731.
git-svn-id: https://develop.svn.wordpress.org/trunk@38415 602fd350-edb4-49c9-b593-d223f7449a82
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.
git-svn-id: https://develop.svn.wordpress.org/trunk@38411 602fd350-edb4-49c9-b593-d223f7449a82
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
git-svn-id: https://develop.svn.wordpress.org/trunk@38402 602fd350-edb4-49c9-b593-d223f7449a82
The following files have been added to `svn:ignore` already as they are not compatible with PHP 5.2:
* 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
See #36335.
git-svn-id: https://develop.svn.wordpress.org/trunk@38401 602fd350-edb4-49c9-b593-d223f7449a82
WordPress always* passes $args to filters as an array of arugments. A exception is made in `wp_nav_menu()` and the associated walker where these are passed to filters as an object, this has been the case for seven years (since [13368]).
These new tests enforce the use of an object in these filters to ensure backward compatibility is maintained.
See #24587.
git-svn-id: https://develop.svn.wordpress.org/trunk@38400 602fd350-edb4-49c9-b593-d223f7449a82
* `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.
git-svn-id: https://develop.svn.wordpress.org/trunk@38399 602fd350-edb4-49c9-b593-d223f7449a82
* Automatically delete objects that we were created during `wpSetUpBeforeClass` - posts, comments, terms (except 1), and user (except 1)
* The amount of leftover data between tests was breathtaking - use the new function: `_delete_all_data()`
* Commit database transactions for all `TestCase`s, not just those that implement `wpSetUpBeforeClass` and `wpTearDownAfterClass`
* The tests run 10-20 seconds faster now
See #37699.
git-svn-id: https://develop.svn.wordpress.org/trunk@38398 602fd350-edb4-49c9-b593-d223f7449a82
The customizer's preview POST requests to static assets result in 405 Method Not Allowed responses.
Fixes#37828.
git-svn-id: https://develop.svn.wordpress.org/trunk@38396 602fd350-edb4-49c9-b593-d223f7449a82
This introduces a `{$type}_template_hierarchy` filter that allows the hierarchy of candidate template filenames for a given template type to be filtered.
This allows the hierarchy to be added to or altered completely without resorting to re-building the hierarchy from scratch within the `template_include` filter, which is common and prone to conflicts between plugins and prone to getting out of sync with core's hierarchy.
Fixes#14310
git-svn-id: https://develop.svn.wordpress.org/trunk@38385 602fd350-edb4-49c9-b593-d223f7449a82
To fiddle around with what it does, run `composer install` from the project root. If you do not have Composer installed:
https://getcomposer.org/doc/00-intro.md#locally
tl;dr for Mac/Homebrew users: `brew install composer`
Classes from `wp-includes` and `wp-admin` are eligible for autoloading via `autoload.classmap`. Through a tornado of recent commits, many unsuitable files have been transitioned into a more acceptable state for autoloading: 1 file per class, no side effects.
The file bootstrap in `wp-settings.php` can transition into `autoload.files`. This will be done with care and attention.
See #36335.
git-svn-id: https://develop.svn.wordpress.org/trunk@38384 602fd350-edb4-49c9-b593-d223f7449a82