453 pointsWPMU DEV ExpertSeriously helpful member
AndrewTraub
Member
—
9th January 2012
I've seen Akismet that they add a custom hover item ("History") to the comment menu which goes to the edit page and the #history div. Does anyone know how to add a function that is called from the admin hover menus (whether to a page list, post list, comment list, etc) that performs a custom action and then returns to the page list? In other words, can I just write a custom php page, pass in the variables I need in the a link, process, and then just redirect to the original page, or does wordpress provide some functionality I should hook into?
I've seen Akismet that they add a custom hover item ("History") to the comment menu which goes to the edit page and the #history div. Does anyone know how to add a function that is called from the admin hover menus (whether to a page list, post list, comment list, etc) that performs a custom action and then returns to the page list? In other words, can I just write a custom php page, pass in the variables I need in the a link, process, and then just redirect to the original page, or does wordpress provide some functionality I should hook into?
Responses (3)
WPMU DEV Fanatic — 9th January 2012 #
Hi Andrew,
Good question and I think the following article covers that very nicely!
http://sumtips.com/2011/03/customize-wordpress-admin-bar.html
Also, in case you haven't seen it, the following plugin provides some nice features for customizing the adminbar items as well:
http://wordpress.org/extend/plugins/wordpress-admin-bar-improved/
Hope that helps!
-David
Member — 16th January 2012 #
Thanks David,
What I'm really trying to figure out is the best way to call a php function from the admin area when a hyperlink is clicked.
Should it be done with Ajax?
Possibly some sort of page hook for the settings page?
A call to a php page which then redirects to another page when done?
Also, should the link be modified with wp_nonce_url? Created with admin_url?
Andrew
Member — 16th January 2012 #
I should mention that I'm also considering adding a parse request action, but that seems overkill.
Andrew
Become a member