<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
		>
	<channel>
		<title>WordPress Ideas &#187; Topic: Global functions for global variables.</title>
		<link>http://wordpress.org/ideas/topic/global-functions-for-global-variables</link>
		<description>WordPress Ideas &#187; Topic: Global functions for global variables.</description>
		<language>en-US</language>
		<pubDate>Thu, 23 May 2013 03:07:34 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.1</generator>
				<atom:link href="http://wordpress.org/ideas/rss/topic/global-functions-for-global-variables" rel="self" type="application/rss+xml" />

		<item>
			<title>Peter Westwood on "Global functions for global variables."</title>
			<link>http://wordpress.org/ideas/topic/global-functions-for-global-variables#post-16424</link>
			<pubDate>Thu, 25 Mar 2010 19:15:51 +0000</pubDate>
			<dc:creator>Peter Westwood</dc:creator>
			<guid isPermaLink="false">16424@http://wordpress.org/ideas/</guid>
			<description><![CDATA[<p>The globals are there for easy access to the functionality both from within plugins and within themes.</p>
<p>However the data is stored within the running script it has to exist in something within the global space.</p>
<p>Adding functions to get hold of things like the current instance of the db class don't add any benefit and just end up increasing code bloat.
</p>]]></description>
					</item>
		<item>
			<title>scribu on "Global functions for global variables."</title>
			<link>http://wordpress.org/ideas/topic/global-functions-for-global-variables#post-16415</link>
			<pubDate>Thu, 25 Mar 2010 19:00:10 +0000</pubDate>
			<dc:creator>scribu</dc:creator>
			<guid isPermaLink="false">16415@http://wordpress.org/ideas/</guid>
			<description><![CDATA[<p>Because using getter functions can't be enforced, it won't solve much.</p>
<p>Until WP moves to PHP5-only syntax, this will remain a problem.</p>
<p>Suggest closing.
</p>]]></description>
					</item>
		<item>
			<title>zackdesign on "Global functions for global variables."</title>
			<link>http://wordpress.org/ideas/topic/global-functions-for-global-variables#post-5128</link>
			<pubDate>Fri, 28 Mar 2008 11:51:00 +0000</pubDate>
			<dc:creator>zackdesign</dc:creator>
			<guid isPermaLink="false">5128@http://wordpress.org/ideas/</guid>
			<description><![CDATA[<p>Global variables have been killing us when creating a certain plugin. Must be fixed! Template tags like the_title and the_content were crapping themselves out :(</p>
<p>And this was even when we were following recommended loop guidelines!
</p>]]></description>
					</item>
		<item>
			<title>John Blackbourn (johnbillion) on "Global functions for global variables."</title>
			<link>http://wordpress.org/ideas/topic/global-functions-for-global-variables#post-1492</link>
			<pubDate>Thu, 01 Feb 2007 06:12:33 +0000</pubDate>
			<dc:creator>John Blackbourn (johnbillion)</dc:creator>
			<guid isPermaLink="false">1492@http://wordpress.org/ideas/</guid>
			<description><![CDATA[<p>I don't see how this will prevent people from inadvertently writing to the global variable, as the global variable must still exist in order to be written to when needed.</p>
<p>If someone writes their own plugin and is worried about inadvertently writing to the global variable, they can create their own function within the plugin to give themselves this functionality.
</p>]]></description>
					</item>
		<item>
			<title>anadgouda on "Global functions for global variables."</title>
			<link>http://wordpress.org/ideas/topic/global-functions-for-global-variables#post-150</link>
			<pubDate>Wed, 10 Jan 2007 03:38:26 +0000</pubDate>
			<dc:creator>anadgouda</dc:creator>
			<guid isPermaLink="false">150@http://wordpress.org/ideas/</guid>
			<description><![CDATA[<p>I understand that global variables are convenient for extending Wordpress. However, it is also dangerous since someone can inadvertently write into the global variable, affecting the entire system. Instead of providing access to the variables directly, can Wordpress provide a set of global functions that return the variable? For example</p>
<p><code><br />
getDB()-&#62;query();<br />
</code></p>
<p>instead of </p>
<p><code><br />
$wpdb-&#62;query();<br />
</code></p>
<p>This will not enforce but allow global variables to read from, without using the explicit global variable.</p>
<p>If someone wants to write into them, he/she can choose to use the explicit global variable.
</p>]]></description>
					</item>

	</channel>
</rss>
