I'm coding a custom plugin to perform some actions at specific times. I'm playing with add_action and add_filter but the current task I'm working on is posting the post url to Twitter account. Problem, is I would like to display twitter API HTTP response as an Admin Notice (Codex of Admin Notice) but I'm completely lost.
Here's my code Logic :
function Twit_the_url( $post_ID ) { //connect to twitter api //send tweet with url //get twitter response //send response to admin notice : add_action('admin_notices', create_function( "", "echo \"$httpstatus
\";" ) ); return $post_ID; } add_action( 'publish_post', 'Twit_the_url');
Everything goes well until I call the admin_notices. the tweet is created, $httpstatus exist but my message is not displayed ! I've been looking around for tips and how-to but I can't understand why it's not working. I've looked at two differents plugins to see how they do it but it change nothing.
So if anyone could tell me where I'm wrong that would be great ! Thx