Make WordPress Core

Opened 9 years ago

Closed 8 years ago

Last modified 8 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
9 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 8 years ago by SergeyBiryukov (previous) (diff)

#2 follow-up: @DrewAPicture
9 years ago

  • Component changed from General to Login and Registration

#3 @dallaslu
9 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 9 years ago by dallaslu (previous) (diff)

#4 in reply to: ↑ 1 @dallaslu
9 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
9 years ago

Replying to DrewAPicture:

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

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

#6 @afercia
8 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.