Code Modernization: Use str_starts_with() and str_ends_with() in a few more places.

`str_starts_with()` and `str_ends_with()` were introduced in PHP 8.0 to perform a case-sensitive check indicating if the string to search in (haystack) begins or ends with the given substring (needle).

WordPress core includes a polyfill for these functions on PHP < 8.0 as of WordPress 5.9.

Follow-up to [55990], [56014], [56019].

See #58220.
Built from https://develop.svn.wordpress.org/trunk@56020


git-svn-id: http://core.svn.wordpress.org/trunk@55532 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov
2023-06-24 17:17:23 +00:00
parent 32e94b4de1
commit e28f97b887
4 changed files with 5 additions and 5 deletions

View File

@@ -980,7 +980,7 @@ function get_links($category = -1, $before = '', $after = '<br />', $between = '
$title = $desc;
if ( $show_updated )
if (substr($row->link_updated_f, 0, 2) !== '00')
if ( !str_starts_with($row->link_updated_f, '00') )
$title .= ' ('.__('Last updated') . ' ' . gmdate(get_option('links_updated_date_format'), $row->link_updated_f + (get_option('gmt_offset') * HOUR_IN_SECONDS)) . ')';
if ( '' != $title )