: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
// wp-admin pages are checked more carefully
if ( is_network_admin() )
preg_match('#/wp-admin/network/?(.*?)$#i', $PHP_SELF, $self_matches);
elseif ( is_user_admin() )
preg_match('#/wp-admin/user/?(.*?)$#i', $PHP_SELF, $self_matches);
preg_match('#/wp-admin/?(.*?)$#i', $PHP_SELF, $self_matches);
$pagenow = $self_matches[1];
$pagenow = trim($pagenow, '/');
$pagenow = preg_replace('#\?.*?$#', '', $pagenow);
if ( '' === $pagenow || 'index' === $pagenow || 'index.php' === $pagenow ) {
preg_match('#(.*?)(/|$)#', $pagenow, $self_matches);
$pagenow = strtolower($self_matches[1]);
if ( '.php' !== substr($pagenow, -4, 4) )
$pagenow .= '.php'; // for Options +Multiviews: /wp-admin/themes/index.php (themes.php is queried)
if ( preg_match('#([^/]+\.php)([?/].*?)?$#i', $PHP_SELF, $self_matches) )
$pagenow = strtolower($self_matches[1]);