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

Austin Matzko if.website at gmail.com
Wed Dec 26 16:59:30 GMT 2007


The difference is that  in the other example, $domain is passed in as
a function argument.

On 12/26/07, Stephen Rider <wp-hackers at striderweb.com> wrote:
>
> 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?
>
> Stephen
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>

-- 
Sent from Gmail for mobile | mobile.google.com


More information about the wp-hackers mailing list