• I am writing a post filtering plugin that should work with
    publish_post
    edit_post
    and the feedworpress-plugin-created hook
    syndicated_post

    It seems simple but I want to make sure of the ins and outs of
    a) which data I will be getting
    b) when exactly the functions I write will parse the data
    c) what usually happens to this same data before and after these hooks

    I think it would be awesome if after learning this stuff, I could add to the codex a page for plugin writers that shows the sequence of ‘events’ or processes. The Loop is documented pretty well, I think. The other ‘Loops’ that make WordPress tick are not so well documented/centralized. I want to help make it easier as well as use these functionalities efficiently.
    thanks for everything!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter interrupt

    (@interrupt)

    tidbits I am picking up: (: let me know if the info is wrong ??

    publish_post passes the id of a post before it is actually published.

    With this id, one can use

    get_post($id)

    to get the post data array and look at it, change it and trigger things because of what is in its elements.

    When one grabs this info and changes it, where does one put that modified data?

    The function for updating the post data is

    update_post($post_array)

    These two functions used together is what one needs for filtering post content.

    If you are using FeedWordPress, then syndicated_post will pass the array directly in the same form as get_post($id). This hook will pass the array for every news feed post.

    Thread Starter interrupt

    (@interrupt)

    edit_post is not *directly* relevant to filtering posts as they are being published. edit_post acts on display of post data to be edited. The key is ‘on display,’ this means that the data is not changed in the database but changed on its way out.

    calling update_post after a post has been published seems like a waste of database writing cycles.
    Does the wordpress team plan on adding an array-passing hook into the core?

    Thread Starter interrupt

    (@interrupt)

    In the source code for the function wp_insert_post (wp-includes/functions-post.php), one can see the place where filters are applied at line 26 – line 33, could these be consolidated into one application of a hook that passes the array of all post data ?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘publish_post definitive info’ is closed to new replies.