WP::register_globals and reserved names
-
Ahoy all,
I’m reading through the process of how WP constructs it’s main query and have a question regarding the global variables registered in WP::register_globals. This method extracts all the query_vars from the main query and dumps them into the global space:
// Extract updated query vars back into global namespace. foreach ( (array) $wp_query->query_vars as $key => $value ) { $GLOBALS[ $key ] = $value; }
- What is the reason for this?
I see that in https://codex.www.ads-software.com/Global_Variables there is a reserved name list, however the global scope is populated with far more variables than is listed there. For example, the $perma_query_vars are broadcast as globals.
2. Is the reserved name list exhaustive? i.e Do devs need to be concerned with overwriting any of the other global variables?
Thanks,
J
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘WP::register_globals and reserved names’ is closed to new replies.