• hi,

    i need to do the following, and finding help on this here in zurich is proving to be a really big issue.

    anyways, each time an admin creates a new post on his blog, i need to get my plugin to detect this, and then grab all the data from the wp_posts table, and send it to our server(backend), the server is going to make some small custom alterations to the content and then send it back, and then it needs to get updated in the same table.

    so I’ve been working on this and have the following code,

    function example()
    
    {
    
       $posts = $wpdb->get_results("SELECT ID, post_title FROM wp_posts WHERE post_status = 'publish'
       AND post_type='post'  LIMIT 1")
    
    }
    
    add_action('publish_post', 'example');

    basically at this stage I’M totally lost, since i just want to get the thing to run when a post is published, and it simple wont work.
    i also need to know how to send this to my server(php/mysql)–any links that i can read would be useful.
    thanks,
    alexei.

The topic ‘wp_posts retrieve data, on post_publish’ is closed to new replies.