WordPress/wp-includes/version.php

48 lines
939 B
PHP
Raw Normal View History

<?php
/**
* WordPress Version
*
* Contains version information for the current WordPress release.
*
* @package WordPress
* @since 1.2.0
*/
/**
* The WordPress version string.
*
* Holds the current version number for WordPress core. Used to bust caches
* and to enable development mode for scripts when running from the /src directory.
*
* @global string $wp_version
*/
Code Modernization: Fix null to non-nullable deprecations in `wp_xmlrpc_server::mw_newPost()`. The `wp_xmlrpc_server::mw_newPost()` method creates a new post via `wp_insert_post()`, but the default/fallback values used in the function were not in line with the default/fallback values used in the `wp_insert_post()` function. The `wp_insert_post()` function does a `wp_parse_args()` (array merge) of the received arguments with the defaults. If any of the received arguments are `null`, this would overwrite the default value, as seen in [https://3v4l.org/bfVlv array_merge() example], and lead to "passing null to non-nullable" deprecation notices on PHP 8.1 for certain arguments. This commit: * Ensures that all arguments are defined before they are `compact()`'ed together to the arguments array. * Verifies that the default/fallback value of the arguments as set within the `wp_xmlrpc_server::mw_newPost()` method are the same as the default/fallback values used in the `wp_insert_post()` function. * Verifies that arguments which do not have a default/fallback value defined in the `wp_insert_post()` function are handled correctly. * This was not the case for `$post_name`, which would previously already get an empty string default value in the `wp_xmlrpc_server::mw_newPost()` function, but then in the `wp_insert_post()` function, this would prevent the slug generation from being activated. Fixed now by setting the default in the `wp_xmlrpc_server::mw_newPost()` function to `null`. * The `page_template` argument was handled, but not documented in the `wp_insert_post()` function. The argument is now documented in the `wp_insert_post()` function DocBlock. Note: There are more than likely several other potential arguments missing from that list, but verifying the whole list is outside the scope of this particular commit. Includes minor simplifications, such as: * Setting a default ahead of an `if`, instead of in an `else` clause (as long as no function call is needed to set the default). * Removing the unnecessary logic duplication in the `$post_status` switch. * Using a combined concatenation + assignment operator for adding `$post_more`. Fixes various errors along the lines of: {{{ 1) Tests_XMLRPC_mw_editPost::test_draft_not_prematurely_published strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated /var/www/src/wp-includes/formatting.php:2497 /var/www/src/wp-includes/class-wp-hook.php:308 /var/www/src/wp-includes/plugin.php:205 /var/www/src/wp-includes/post.php:2835 /var/www/src/wp-includes/post.php:2720 /var/www/src/wp-includes/post.php:4066 /var/www/src/wp-includes/class-wp-xmlrpc-server.php:5616 /var/www/tests/phpunit/tests/xmlrpc/mw/editPost.php:315 ... 23) Tests_XMLRPC_mw_editPost::test_draft_not_prematurely_published json_decode(): Passing null to parameter #1 ($json) of type string is deprecated /var/www/src/wp-includes/kses.php:2074 /var/www/src/wp-includes/class-wp-hook.php:307 /var/www/src/wp-includes/plugin.php:205 /var/www/src/wp-includes/post.php:2835 /var/www/src/wp-includes/post.php:2720 /var/www/src/wp-includes/post.php:4066 /var/www/src/wp-includes/class-wp-xmlrpc-server.php:5615 /var/www/tests/phpunit/tests/xmlrpc/mw/editPost.php:315 /var/www/vendor/bin/phpunit:123 }}} Follow-up to [1563], [4793], [7900], [16824], [19848], [40677], [51968]. Props jrf. See #55656. Built from https://develop.svn.wordpress.org/trunk@54320 git-svn-id: http://core.svn.wordpress.org/trunk@53879 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-27 04:00:09 +02:00
$wp_version = '6.1-beta1-54320';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
*
* @global int $wp_db_version
*/
$wp_db_version = 53496;
/**
* Holds the TinyMCE version.
*
* @global string $tinymce_version
*/
$tinymce_version = '49110-20201110';
/**
* Holds the required PHP version.
*
* @global string $required_php_version
*/
$required_php_version = '5.6.20';
/**
* Holds the required MySQL version.
*
* @global string $required_mysql_version
*/
$required_mysql_version = '5.0';