Make WordPress Core

Opened 12 years ago

Closed 11 years ago

Last modified 11 years ago

#30494 closed defect (bug) (worksforme)

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

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

Description

as the title.

Change History (6)

#1 follow-up: @voldemortensen
12 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 11 years ago by SergeyBiryukov (previous) (diff)

#2 follow-up: @DrewAPicture
12 years ago

  • Component General → Login and Registration

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

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

Replying to DrewAPicture:

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

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

#6 @afercia
11 years ago

  • Keywords reporter-feedback removed
  • Milestone Awaiting Review
  • Resolution → worksforme
  • Status new → 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.