Make WordPress Core

Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#33545 closed defect (bug) (fixed)

Check for existence of pagenow global

Reported by: kalenjohnson's profile KalenJohnson Owned by:
Milestone: 4.4 Priority: normal
Severity: normal Version: 3.7
Component: Bootstrap/Load Keywords:
Focuses: template Cc:


There are some plugins that call home_url() or get_home_url() without being in any type of hook, so it's happening right when the plugin get's loaded. It doesn't seem like this is always an issue, but I am seeing many warnings of an undefined index.

This patch I don't believe will break anything, since if things are being loaded before the $pagenow global exists, this check won't work anyways, so checking for it and removing a PHP warning seems like a win.

Attachments (1)

check_for_existence_of_pagenow_global.diff (605 bytes) - added by KalenJohnson 9 years ago.

Download all attachments as: .zip

Change History (5)

#1 @SergeyBiryukov
9 years ago

  • Milestone changed from Awaiting Review to 4.4
  • Version changed from 4.3 to 3.7

Introduced in [24844].

#2 @wonderboymusic
9 years ago

In 33736:

In get_home_url(), import the $pagenow global to avoid having to check if it exists before comparing against it.

Props KalenJohnson.
See #33545.

#3 @wonderboymusic
9 years ago

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.