mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00: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. git-svn-id: https://develop.svn.wordpress.org/trunk@57170 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
8035bdaec0
commit
d859cbe790
@ -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().
|
||||
*
|
||||
|
||||
Loading…
Reference in New Issue
Block a user