How do I pass arguments using add_action() to an existing action?
-
Hello everyone,
Instead of doing something like this…
function remove_taxonomy_boxes() { remove_meta_box('categorydiv', 'post', 'side'); } add_action( 'admin_menu' , 'remove_taxonomy_boxes' );
Is it possible to do something more like this?
function remove_taxonomy_boxes($box_id, $page, $context) { remove_meta_box($box_id, $page, $context); } add_action( 'admin_menu' , 'remove_taxonomy_boxes', 10, 3 ); do_action( 'admin_menu', 'categorydiv', 'post', 'side');
I understand the second code example is incorrect, but the idea is what I’m trying to do. I want to try and make my code a little more reusable instead of having to write the first code example’s custom function with hard coded values for every case I want. Maybe there is an entirely different approach?
I found this thread, it’s closed though and not quite what I’m looking for.
Many thanks!
-Tim
Viewing 9 replies - 1 through 9 (of 9 total)
Viewing 9 replies - 1 through 9 (of 9 total)
- The topic ‘How do I pass arguments using add_action() to an existing action?’ is closed to new replies.