[wp-hackers] changing the built in categories label on the add post screen
Dion Hulse (dd32)
wordpress at dd32.id.au
Sat Nov 19 00:04:29 UTC 2011
On 19 November 2011 10:59, IC IC <icwordpress at gmail.com> wrote:
> Paul,
>
> I got the point...
>
> I've been wondering those init hooks..
> When we run the add_action('init', 'whatever' ... , is that going to run
> everytime a page is served for some visitor for the rest of the time?
>
> Normally, you would run this code once and then comment it out right? So,
> such actions are there to run once right?
> there is no point of running it millions of time if that taxonomy exists do
> nothing part...
>
> however in this particular instance, I guess I have to remember of running
> it once after every core update?
>
> shouldn't there be a more elegant way to handle this UI matter?
No, You'd have to run it every page load (Well, Every admin page load,
so use the admin_init hook or so).
WordPress doesn't store most things in the Database, rather, it
dynamically registers everything on each page load. This adds a lot
more flexibility to the platform.
The standard way is to register a new taxonomy and hide the
Categories.. So yes, That's the Elegant UI way.
Your alternative is to add a gettext filter that does
str_replace('Categories', 'Topics', $text) on every single bit of text
in the admin..
More information about the wp-hackers
mailing list