mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-22 09:07:59 +01:00
General: Avoid early initialization of variable in get_bloginfo()
.
This is a very minor, yet simple performance optimization in a commonly called function, avoiding unnecessary initialization of the `$url` variable when it may not be needed. The conditional is simple enough to not use a variable altogether. Props Cybr, swissspidy. Fixes #59450. Built from https://develop.svn.wordpress.org/trunk@57170 git-svn-id: http://core.svn.wordpress.org/trunk@56681 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
f402ce754d
commit
7926dbb4d5
@ -906,17 +906,12 @@ function get_bloginfo( $show = '', $filter = 'raw' ) {
|
||||
break;
|
||||
}
|
||||
|
||||
$url = true;
|
||||
|
||||
if ( ! str_contains( $show, 'url' )
|
||||
&& ! str_contains( $show, 'directory' )
|
||||
&& ! str_contains( $show, 'home' )
|
||||
) {
|
||||
$url = false;
|
||||
}
|
||||
|
||||
if ( 'display' === $filter ) {
|
||||
if ( $url ) {
|
||||
if (
|
||||
str_contains( $show, 'url' )
|
||||
|| str_contains( $show, 'directory' )
|
||||
|| str_contains( $show, 'home' )
|
||||
) {
|
||||
/**
|
||||
* Filters the URL returned by get_bloginfo().
|
||||
*
|
||||
|
@ -16,7 +16,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '6.5-alpha-57169';
|
||||
$wp_version = '6.5-alpha-57170';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
Loading…
Reference in New Issue
Block a user