This avoids the performance overhead of the function call every time `dirname( __FILE__ )` was used instead of `__DIR__`.
This commit also includes:
* Removing unnecessary parentheses from `include`/`require` statements. These are language constructs, not function calls.
* Replacing `include` statements for several files with `require_once`, for consistency:
* `wp-admin/admin-header.php`
* `wp-admin/admin-footer.php`
* `wp-includes/version.php`
Props ayeshrajans, desrosj, valentinbora, jrf, joostdevalk, netweb.
Fixes#48082.
Built from https://develop.svn.wordpress.org/trunk@47198
git-svn-id: http://core.svn.wordpress.org/trunk@46998 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Since MySQL 5.7, InnoDB engine supports `FULLTEXT` indexes, so forcing MyISAM is unnecessary.
Follow-up to [47193], which addressed the issue in `Tests_dbDelta::setUp()`, but missed other tests.
Props xkon, joonasvanhatapio, SergeyBiryukov.
Fixes#49367.
Built from https://develop.svn.wordpress.org/trunk@47195
git-svn-id: http://core.svn.wordpress.org/trunk@46995 1a063a9b-81f0-0310-95a4-ce76da25c4cd
* MySQL 8.0.11 changed the `GeometryCollection` data type name to `GeomCollection`, with the latter being the preferred name.
* MySQL 8.0.17 removed support for the display width attribute for integer data types. Previously, default display width of 20 digits was used: `BIGINT(20)`.
The affected tests now check the MySQL server version and use the appropriate data types.
This leaves one unresolved failure on MySQL 8.0.17+ to be addressed in the future, caused by the same `BIGINT` display width discrepancy coming from `wp_get_db_schema()`.
Props kaggdesign, ottok, jeremyfelt, SergeyBiryukov.
Fixes#44384, #49344. See #49364.
Built from https://develop.svn.wordpress.org/trunk@47184
git-svn-id: http://core.svn.wordpress.org/trunk@46984 1a063a9b-81f0-0310-95a4-ce76da25c4cd
MySQL 8.0.11 removed support for the `NO_AUTO_CREATE_USER` SQL mode, which was used in as an example of a mode compatible with WordPress.
`NO_AUTO_VALUE_ON_ZERO` is now used in the affected tests instead, which is supported on both MySQL 5.7.x and 8.0.x.
Props kaggdesign, jeremyfelt, afragen.
Fixes#44586. See #49344.
Built from https://develop.svn.wordpress.org/trunk@47183
git-svn-id: http://core.svn.wordpress.org/trunk@46983 1a063a9b-81f0-0310-95a4-ce76da25c4cd
If the post status is not registered, assume it's not public, but still allow access to users with edit permissions (same as for a protected post status, e.g. `draft`), so that they could recover orphaned content.
Add unit tests.
Follow-up to [47178].
Props roytanck, SergeyBiryukov.
Fixes#48653.
Built from https://develop.svn.wordpress.org/trunk@47181
git-svn-id: http://core.svn.wordpress.org/trunk@46981 1a063a9b-81f0-0310-95a4-ce76da25c4cd
With `map_meta_cap` enabled for a post type, the `read_post` capability for posts with a public status is supposed to be mapped to the post type's `read` capability.
When a post is left in the database after the post status is no longer present, and WP does a `read_post` check against it, a PHP notice was thrown, and the cap check always failed.
As a more graceful fallback, the cap is now mapped onto `edit_others_posts`, which allows highly privileged users to be able to access orphaned content.
A `_doing_it_wrong()` notice is also added, so that developers and site administrators are aware that the cap mapping is failing in the absence of the registered post status.
Follow-up to [34091], which introduced a similar approach to checking mapped caps against an unregistered post type.
Props roytanck, SergeyBiryukov.
Fixes#48653.
Built from https://develop.svn.wordpress.org/trunk@47178
git-svn-id: http://core.svn.wordpress.org/trunk@46978 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Core did not include the navigation block PHP files.
This commit fixes the issue referred, and now the navigation block is executed on the frontend. The block still does not work as expected and throws an error during frontend execution. That problem is going to be fixed on the next WordPress package update.
This commit adds the file as it is on the npm package used.
Props gziolo.
Fixes#49348.
Built from https://develop.svn.wordpress.org/trunk@47176
git-svn-id: http://core.svn.wordpress.org/trunk@46976 1a063a9b-81f0-0310-95a4-ce76da25c4cd
* Change default value of the `$blog_id` parameter to match the documented type.
* Change the type of the `$reassign` parameter for consistency with `$user_id` and `$blog_id`.
* Add documentation for the return value.
See #49361.
Built from https://develop.svn.wordpress.org/trunk@47173
git-svn-id: http://core.svn.wordpress.org/trunk@46973 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Starting with MySQL 5.7.5, the `ANSI` mode implies `ONLY_FULL_GROUP_BY`, which is already listed in `wpdb` as incompatible per [27072].
When `ANSI` is enabled on MySQL 5.7.5+, `ONLY_FULL_GROUP_BY` remains enabled even after being "unset" by `wpdb::set_sql_mode()`.
To prevent this, the `ANSI` mode should also be listed as incompatible. It is not enabled on default MySQL installations.
Props jnylen0.
Fixes#48377.
Built from https://develop.svn.wordpress.org/trunk@47171
git-svn-id: http://core.svn.wordpress.org/trunk@46971 1a063a9b-81f0-0310-95a4-ce76da25c4cd
For dynamic blocks, there are several blocks whose metadata needs to be loaded in PHP. The attributes that are loaded via PHP are not exposed to the ReactNative components when Gutenberg loads the index.js files in the Mobile Apps. To support one master set of metadata that can be used to register in the PHP files and the Javascript files; with this patch, the block.json files are copied over with their corresponding PHP files.
Props chipsnyder and azaozz.
Fixes#49196.
Built from https://develop.svn.wordpress.org/trunk@47168
git-svn-id: http://core.svn.wordpress.org/trunk@46968 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The transient is only used in the `wp_dashboard_plugins_output()` function, which is deprecated and unused since [40607].
The function itself also sets the same transient, so it can be removed from `WP_Plugins_List_Table`.
Props aftabmuni.
Fixes#49340.
Built from https://develop.svn.wordpress.org/trunk@47167
git-svn-id: http://core.svn.wordpress.org/trunk@46967 1a063a9b-81f0-0310-95a4-ce76da25c4cd