[wp-hackers] using translated strings for action names

FUJINAKA Tohru tohru at nakarika.com
Sun Jul 1 09:34:52 GMT 2007


Hi,

On Sun, 01 Jul 2007 10:23:43 +0300
Sabin Iacob <iacobs at m0n5t3r.info> wrote:

> FUJINAKA Tohru wrote:
> >> This seems reasonable (although it looks like a textbook case for the 
> >> YAFL antipattern), but...
> >>     
> >
> > How come is it reasonable?
> > It isn't enough that just using $file argument of add_xxx_page() to
> > build action names?
> >   
> 
> the mechanism seems thought out for people that put everything (almost 
> everything... I haven't seen someone retarded enough to also put images) 
> in one gigantic file; otherwise, it is really YAFL (Yet Another Layer - 
> to use the description from Wikipedia which avoids the F :D):

Um? I can't make out, uhh, is that the reason that building action tags of
"admin_head-*" and "admin_print_script-*" with parent menu's text (e.g.
"option") and "_page_"?

> 
> > Conditions:
> >  a. in case add_xxx_page() without the last argument $function, 
> >     $file must be unique among WP and related files.
> >   
> 
> in this case, $file should be a plugin_basename and that's it. no more 
> action hook lookup, just include it if possible; this is similar to the 
> current behaviour for options pages

As I wrote in ticket #4563, I think the hooks for a specific plugin should
be kicked, too.
For pages want to load custom css/javascrips.

> >  b. in case add_xxx_page() with the last argument $function set, 
> 
> ... or make sure the name is predictible (build $admin_page_hooks before 
> loading l10n)

While embedded "option" and "_page_" strings in hook tags are useful for
something. :)

--
  FUJINAKA Tohru <tohru at nakarika.com>



More information about the wp-hackers mailing list