rebase on oct-10-2023

This commit is contained in:
Rachit Bhargava
2023-10-10 17:23:21 -04:00
parent d37566ffb6
commit d096058d7d
4789 changed files with 254611 additions and 307223 deletions

View File

@@ -76,19 +76,19 @@ function extract_from_markers( $filename, $marker ) {
$state = false;
foreach ( $markerdata as $markerline ) {
if ( false !== strpos( $markerline, '# END ' . $marker ) ) {
if ( str_contains( $markerline, '# END ' . $marker ) ) {
$state = false;
}
if ( $state ) {
if ( '#' === substr( $markerline, 0, 1 ) ) {
if ( str_starts_with( $markerline, '#' ) ) {
continue;
}
$result[] = $markerline;
}
if ( false !== strpos( $markerline, '# BEGIN ' . $marker ) ) {
if ( str_contains( $markerline, '# BEGIN ' . $marker ) ) {
$state = true;
}
}
@@ -194,10 +194,10 @@ Any changes to the directives between these markers will be overwritten.'
$found_end_marker = false;
foreach ( $lines as $line ) {
if ( ! $found_marker && false !== strpos( $line, $start_marker ) ) {
if ( ! $found_marker && str_contains( $line, $start_marker ) ) {
$found_marker = true;
continue;
} elseif ( ! $found_end_marker && false !== strpos( $line, $end_marker ) ) {
} elseif ( ! $found_end_marker && str_contains( $line, $end_marker ) ) {
$found_end_marker = true;
continue;
}
@@ -750,7 +750,7 @@ function set_screen_options() {
default:
$screen_option = false;
if ( '_page' === substr( $option, -5 ) || 'layout_columns' === $option ) {
if ( str_ends_with( $option, '_page' ) || 'layout_columns' === $option ) {
/**
* Filters a screen option value before it is set.
*
@@ -1572,7 +1572,16 @@ function _wp_privacy_settings_filter_draft_page_titles( $title, $page ) {
* @since 5.1.0
* @since 5.1.1 Added the {@see 'wp_is_php_version_acceptable'} filter.
*
* @return array|false Array of PHP version data. False on failure.
* @return array|false {
* Array of PHP version data. False on failure.
*
* @type string $recommended_version The PHP version recommended by WordPress.
* @type string $minimum_version The minimum required PHP version.
* @type bool $is_supported Whether the PHP version is actively supported.
* @type bool $is_secure Whether the PHP version receives security updates.
* @type bool $is_acceptable Whether the PHP version is still acceptable or warnings
* should be shown and an update recommended.
* }
*/
function wp_check_php_version() {
$version = PHP_VERSION;
@@ -1595,14 +1604,6 @@ function wp_check_php_version() {
return false;
}
/**
* Response should be an array with:
* 'recommended_version' - string - The PHP version recommended by WordPress.
* 'is_supported' - boolean - Whether the PHP version is actively supported.
* 'is_secure' - boolean - Whether the PHP version receives security updates.
* 'is_acceptable' - boolean - Whether the PHP version is still acceptable or warnings
* should be shown and an update recommended.
*/
$response = json_decode( wp_remote_retrieve_body( $response ), true );
if ( ! is_array( $response ) ) {