Ticket #1749 (closed defect: invalid)

Opened 3 years ago

Last modified 2 years ago

Global Variables are not available in Plugin functions

Reported by: mani_monaj Assigned to: anonymous
Priority: highest omg bbq Milestone:
Component: General Version: 1.6
Severity: critical Keywords: Plugin , Global Variables bg|squashed
Cc:

Description

I've just tested out some plugins on Wordpress 1.6 that used to work in ver 1.5 , After an hour of debugging I found out that global variables are not available in plugin functions , for example

function mps_jalali_query($where) {
	global $m,$hour,$minute,$second,$year,$monthnum,$day;
...
...
}
...
add_filter("posts_where","mps_jalali_query");

but $m, $hour, $minute , etc are not available in the function , they are NULL in the function !

Change History

10/15/05 09:06:09 changed by markjaquith

try setting global $wp_query; and using $wp_query->query_varshour?, $wp_query->query_varsday?, etc...

11/06/05 05:28:00 changed by markjaquith

  • keywords changed from Plugin , Global Variables to Plugin , Global Variables bg|squashed.
  • status changed from new to closed.
  • resolution set to invalid.

11/30/06 19:41:47 changed by

  • milestone deleted.

Milestone 2.0 deleted