Skip to content

Commit

Permalink
Merge branch 'release/1.5.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
nylen committed Jan 25, 2023
2 parents b45423c + fd98785 commit 69d9a67
Show file tree
Hide file tree
Showing 7 changed files with 228 additions and 98 deletions.
240 changes: 150 additions & 90 deletions readme.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion wp-includes/admin-bar.php
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,7 @@ function wp_admin_bar_edit_menu( $wp_admin_bar ) {
);
} elseif ( 'term' === $current_screen->base && isset( $tag ) && is_object( $tag ) && ! is_wp_error( $tag ) ) {
$tax = get_taxonomy( $tag->taxonomy );
if ( is_taxonomy_viewable( $tax ) ) {
if ( $tax->public ) {
$wp_admin_bar->add_menu(
array(
'id' => 'view',
Expand Down
8 changes: 4 additions & 4 deletions wp-includes/bookmark.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ function get_bookmarks( $args = '' ) {
$parsed_args['exclude'] = ''; //ignore exclude, category, and category_name params if using include
$parsed_args['category'] = '';
$parsed_args['category_name'] = '';
$inclinks = preg_split( '/[\s,]+/', $r['include'] );
$inclinks = preg_split( '/[\s,]+/', $parsed_args['include'] );

if ( count( $inclinks ) ) {
foreach ( $inclinks as $inclink ) {
Expand All @@ -194,7 +194,7 @@ function get_bookmarks( $args = '' ) {

$exclusions = '';
if ( ! empty( $parsed_args['exclude'] ) ) {
$exlinks = preg_split( '/[\s,]+/', $r['exclude'] );
$exlinks = preg_split( '/[\s,]+/', $parsed_args['exclude'] );
if ( count( $exlinks ) ) {
foreach ( $exlinks as $exlink ) {
if ( empty( $exclusions ) ) {
Expand Down Expand Up @@ -231,7 +231,7 @@ function get_bookmarks( $args = '' ) {
$join = '';

if ( ! empty( $parsed_args['category'] ) ) {
$incategories = preg_split( '/[\s,]+/', $r['category'] );
$incategories = preg_split( '/[\s,]+/', $parsed_args['category'] );
if ( count( $incategories ) ) {
foreach ( $incategories as $incat ) {
if ( empty( $category_query ) ) {
Expand Down Expand Up @@ -301,7 +301,7 @@ function get_bookmarks( $args = '' ) {
$query .= " ORDER BY $orderby $order";

if ( -1 != $parsed_args['limit'] ) {
$query .= ' LIMIT ' . $r['limit'];
$query .= ' LIMIT ' . $parsed_args['limit'];
}

$results = $wpdb->get_results( $query );
Expand Down
70 changes: 70 additions & 0 deletions wp-includes/compat.php
Original file line number Diff line number Diff line change
Expand Up @@ -501,3 +501,73 @@ function is_iterable( $var ) {
return ( is_array( $var ) || $var instanceof Traversable );
}
}

if ( ! function_exists( 'array_key_first' ) ) {
/**
* Polyfill for array_key_first() function added in PHP 7.3.
*
* Get the first key of the given array without affecting
* the internal array pointer.
*
* @since WP-5.9.0
*
* @param array $arr An array.
* @return string|int|null The first key of array if the array
* is not empty; `null` otherwise.
*/
function array_key_first( array $arr ) {
foreach ( $arr as $key => $value ) {
return $key;
}
}
}

if ( ! function_exists( 'array_key_last' ) ) {
/**
* Polyfill for `array_key_last()` function added in PHP 7.3.
*
* Get the last key of the given array without affecting the
* internal array pointer.
*
* @since WP-5.9.0
*
* @param array $arr An array.
* @return string|int|null The last key of array if the array
*. is not empty; `null` otherwise.
*/
function array_key_last( array $arr ) {
if ( empty( $arr ) ) {
return null;
}
end( $arr );
return key( $arr );
}
}

if ( ! function_exists( 'str_contains' ) ) {
/**
* Polyfill for `str_contains()` function added in PHP 8.0.
*
* Performs a case-sensitive check indicating if needle is
* contained in haystack.
*
* @since WP-5.9.0
*
* @param string $haystack The string to search in.
* @param string $needle The substring to search for in the haystack.
* @return bool True if `$needle` is in `$haystack`, otherwise false.
*/
function str_contains( $haystack, $needle ) {
return ( '' === $needle || false !== strpos( $haystack, $needle ) );
}
}

// IMAGETYPE_WEBP constant is only defined in PHP 7.1 or later.
if ( ! defined( 'IMAGETYPE_WEBP' ) ) {
define( 'IMAGETYPE_WEBP', 18 );
}

// IMG_WEBP constant is only defined in PHP 7.0.10 or later.
if ( ! defined( 'IMG_WEBP' ) ) {
define( 'IMG_WEBP', IMAGETYPE_WEBP ); // phpcs:ignore PHPCompatibility.Constants.NewConstants.imagetype_webpFound
}
2 changes: 1 addition & 1 deletion wp-includes/post-thumbnail-template.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ function get_the_post_thumbnail( $post = null, $size = 'post-thumbnail', $attr =
$attr = array( 'loading' => $loading );
} elseif ( is_array( $attr ) && ! array_key_exists( 'loading', $attr ) ) {
$attr['loading'] = $loading;
} elseif ( is_string( $attr ) && ! preg_match( '/(^|&)loading=', $attr ) ) {
} elseif ( is_string( $attr ) && ! preg_match( '/(^|&)loading=/', $attr ) ) {
$attr .= '&loading=' . $loading;
}

Expand Down
2 changes: 1 addition & 1 deletion wp-includes/script-loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function classicpress_asset_version( $type = 'script', $handle = null ) {
static $default_version;

if ( empty( $default_version ) ) {
$default_version = 'cp_dface6e4';
$default_version = 'cp_ac99bf62';
}

/**
Expand Down
2 changes: 1 addition & 1 deletion wp-includes/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
*
* @global string $cp_version
*/
$cp_version = '1.5.0';
$cp_version = '1.5.1';

/**
* The WordPress version string
Expand Down

0 comments on commit 69d9a67

Please sign in to comment.