Creating an Admin Bar button that does multiple things
-
Hi, using some code that I found laying around the web, I’ve added a Move To Trash button to my admin bar. It works fine –?when I click on it, it does in fact delete the current post. However, there are some files associated with each post that I would also like to delete. My Move To Trash button uses an href argument to call get_delete_post_link:
{ $wp_admin_bar->add_node( array( 'id' => 'delete', 'title' => __('Move to Trash'), 'href' => get_delete_post_link($current_object->term_id) ) );
What I don’t know how to do is execute additional commands. Is there a way that I can get this link to execute a subroutine of some kind, rather than a single href link?
Thanks!
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Creating an Admin Bar button that does multiple things’ is closed to new replies.