Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author C. Johnson

    (@radgeek)

    Hi there,

    Briefly, yes.

    FeedWordPress uses the standard WP API function wp_insert_post when it first creates a new post based on an item from the syndication feed. wp_insert_post triggers both the save_post and the wp_insert_post actions.

    If you need to programmatically alter the post body, the best way to do that depends a bit on your circumstances. Probably the best thing to do would be to use a syndicated_item_content filter (see https://feedwordpress.radgeek.com/wiki/syndicated_item_content ), unless you need to do something fairly complex in terms of how the old content is stored? But if you tell me a bit more about the details of what you are trying to do, I may be able to give more detailed advice.

    Cheers,
    C

    Thread Starter diop5

    (@diop5)

    Thanks a lot for your reply.

    I’am importing content from many sources. I need to download all images inside the item’s description, add them to the media library and change their path to a local path. After that, I’ll parse the body content and set the first image as the featured for the post.

    I’ve already used the hook save_post and it works if I create the post from the WordPress GUI but not on imported post. I’ll try ‘syndicated_item_content’ hook and let you know !

    Cheers,

    Plugin Author C. Johnson

    (@radgeek)

    Hey there,

    Alright, cool, so if you’re looking to download images contained in a post and rewrite paths, you might take a look at this add-on module:

    https://github.com/radgeek/FWP—SIC–Em

    Depending on the details of how you want to implement this, the add-on module itself may or may not do exactly what you need it to do. But even if it doesn’t do exactly what you need it to do, the techniques used in it may be useful as a reference for your own implementation.

    Hope this helps!

    -C

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Is hook save_post called ?’ is closed to new replies.