Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I modified the wordpress admin with a plugin I wrote, and my last problem is that there's no action anymore while the post is being updated or published in the admin. I looked around for a function or something that'ld let me do something while the post is being updated but so far I didn't have any luck. Anyone know how to do it ? I'ld like to add HTML (a div) if I can but really anything would be nice !

Thanks for your help :)

share|improve this question

1 Answer 1

It sounds like you're looking for the publish_post hook which (per the Codex):

Runs when a post is published, or if it is edited and its status is "published". Action function arguments: post ID.

Alternately, there's save_post which is

triggered whenever a post or page is created or updated, which could be from an import, post/page edit form, xmlrpc, or post by email.

share|improve this answer
    
Hi, I actually tryed to work with both of these, but they didn't work, because they're called when the post is published. I'm looking for something to use while the post is being published, and I want to add a div or something, and with publish_post or save_post, echo, var_dump, or JS don't work (at least I couldn't make them to...) so it won't work :( –  Matoma16 May 9 '12 at 6:00
    
These are the only hooks there are (i.e. this answers your question), you just have to make sure you're doing the right thing with them. This post might get you started on the right path: stackoverflow.com/questions/4043976/… –  mrwweb May 9 '12 at 15:25

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.