Make WordPress Core

Opened 10 years ago

Closed 9 years ago

Last modified 9 years ago

#30494 closed defect (bug) (worksforme)

$GLOBALS['pagenow'] is empty under the case wp-login.php

Reported by: dallaslu's profile dallaslu Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.0.1
Component: Login and Registration Keywords:
Focuses: Cc:

Description

as the title.

Change History (6)

#1 follow-up: @voldemortensen
10 years ago

  • Keywords reporter-feedback added

Could you provide some more information about the issue? $_GLOBALS['pagenow'] is never used in wp-login.php. Is there something you are trying to do with pagenow?

Last edited 9 years ago by SergeyBiryukov (previous) (diff)

#2 follow-up: @DrewAPicture
10 years ago

  • Component changed from General to Login and Registration

#3 @dallaslu
10 years ago

I am using:

function useso_take_over_google_is_login_page() {
	//global $pagenow;
	return in_array($_SERVER['PHP_SELF'], array('/wp-login.php', '/wp-register.php'));
}

It works.

Last edited 10 years ago by dallaslu (previous) (diff)

#4 in reply to: ↑ 1 @dallaslu
10 years ago

Replying to voldemortensen:

Could you provide some more information about the issue? $_GLOBALSpagenow? is never used in wp-login.php. Is there something you are trying to do with pagenow?

function useso_take_over_google_is_login_page() {
	return in_array($GLOBALS['pagenow'], array('wp-login.php', 'wp-register.php'));
}

this function will never return true.

#5 in reply to: ↑ 2 @dallaslu
10 years ago

Replying to DrewAPicture:

This and 'Login and Registratio' is no absolute relationship.

Last edited 10 years ago by dallaslu (previous) (diff)

#6 @afercia
9 years ago

  • Keywords reporter-feedback removed
  • Milestone Awaiting Review deleted
  • Resolution set to worksforme
  • Status changed from new to closed

Just checked both 4.0 and trunk and

in_array( $GLOBALS['pagenow'], array( 'wp-login.php', 'wp-register.php') )

returns true for me.

Note: See TracTickets for help on using tickets.