[wp-hackers] using translated strings for action names
tohru at nakarika.com
Sun Jul 1 06:15:10 GMT 2007
> it appears that someone beat me to it by one full day:
It's me. :)
> tries to run an action called "options_page_foo"
> 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?
a. in case add_xxx_page() without the last argument $function,
$file must be unique among WP and related files.
b. in case add_xxx_page() with the last argument $function set,
$file is used just for action names, not used by `include'.
so plugin developer could set $file freely like as an unique ID.
Without framework's help that adding prefix from parent's menu
text and `_page_', developers still make hook tags to be unique.
FUJINAKA Tohru as reedom<tohru at nakarika.com>
More information about the wp-hackers