Where is the best place to use add_filter
Should I use the function add_filter In my plugin’s init action hook or just the in the main plugin script?
Should I use the function add_filter In my plugin’s init action hook or just the in the main plugin script?
I’m surprised by the fact that my function that I’ve tacked onto the save_post action fires when I click the “New Post” link in the Admin Dashboard. Note – this is before I’ve pressed Save or Update, and it fires immediately, not after an elapsed time or auto-update.
I have been developing plugins for WordPress, most plugins I have developed use two or three classes, hence not as huge as Buddypress or WooCommerce.
I made a WordPress plugin like this:
I’m trying to do something similar to this question here: remove_action or remove_filter with external classes?
Is there a way to know what functions are hooked to a particular hook? For example if I’d like to know what functions are hooked to the wp_head hook.
I’m trying to debug a plugin which I didn’t develop and I want to list all the registered actions. I’ve read this SO thread:
I was surprised to discover that add_role() modifies the database and fails if the role already exists. There are two implications here, one first more serious than the other: 1) if you’re in development and update your add_role code, you must first remove_role() 2) once you have it right, you should never have to run that code again.
I am having trouble wrapping my head around these two functions. I understand do_action() but I don’t see clearly when do_action_ref_array() would be useful. Couldn’t we pass an array to do_action() as well?
I am writing a plugin that fetches some extended user info from a remote service and I need it to execute its function each time a user logs in.