[wp-hackers] Howdy Don't plugin (was Decision time in re: admin rework)

Stephen Rider wp-hackers at striderweb.com
Wed Dec 26 16:29:47 GMT 2007

On Dec 26, 2007, at 9:12 AM, Stephen Rider wrote:

>> Since the filter only works when there is a localization file in  
>> use, I wanted to make it so the Options page only appears under  
>> the same condition.  I tried the following:
>> function howdy_load_optionspage() {
>> 	global $l10n;
>> 	if( isset( $l10n[$domain] ) ) {
>> 		add_options_page( "Howdy Don't", "Howdy Don't",  
>> 'manage_options', basename(__FILE__), 'howdy_options_page');
>> 	}
>> }
>> But for some reason the if( isset() ) always results in "false".   
>> I copied that test straight out of the l10n.php file from core.   
>> Any idea why it doesn't work here?

> On Dec 26, 2007, at 9:16 AM, Austin Matzko wrote:
> In your code, it looks like $domain is undefined.

Correct.  But the exact same test in l10n.php returns true, as  
evidenced by the fact that the text gets translated.  How does if 
( isset( $l10n[$domain] ) ) return true one moment and moments later  
return false?


More information about the wp-hackers mailing list