Forum Replies Created

Viewing 1 replies (of 1 total)
  • Action hooks such as publish_post take the id of the post as a parameter. Once you have the id, you can easily get everything else about the post…

    function foo($post_ID = 129) {
    $data = get_postdata($post_ID);
    print_r($data);
    }

    that should output something to the effect of:

    Array
    (
    [ID] => 129
    [Author_ID] => 1
    [Date] => 2005-06-13 16:45:57
    [Content] => post content here…
    [Excerpt] =>
    [Title] => Boiled Dogs
    [Category] => 0
    [post_status] => publish
    [comment_status] => open
    [ping_status] => open
    [post_password] =>
    [to_ping] =>
    [pinged] =>
    [post_name] => boiled-dogs
    )
    as far as permalinks, etc…. Once you have the id of the post, you can get any other information easily… Everything is just a function call/database query away… All the above information can be used to make the permalink.

Viewing 1 replies (of 1 total)