When to use global $post and other global variables?
I am trying to understand when and why I should use the global $post variable. I have tried to do the following on … Read more
I am trying to understand when and why I should use the global $post variable. I have tried to do the following on … Read more
I’ve defined a variable – let’s call it $header_var, which is placed in the header.php file. I would like this variable to be … Read more
The $content_width GLOBAL in WordPress effects many themes and even some plugins by limiting the size of images and embeds in posts, it … Read more
I have a function like this: add_settings_field( ‘contact_phone’, ‘Contact Phone’, ‘settings_callback’, ‘general’); That works. It calls settings_callback. Cool. The problem I have with … Read more
Setting up a WP multisite instance – the client has an existing ontology / set of categories that they want to classify all … Read more
@toscho left a comment to this answer which had me thinking again. How much trust should we have in the global scope, specially … Read more
People are often confused about how to get data from global objects/variables Question: In which ways can you inspect global variables? This Q … Read more
UPDATE: My original question has been solved, but this is turning into a valid discussion about why not to use global variables, so … Read more