• Resolved Nahum

    (@nahummadrid)


    I have created a custom taxonomy for wprss_feed_item and am trying to save the source name as a term.

    Any way to get the source feed ID in order to get its title to send to wp_set_object_terms before new feed items get inserted/saved.

    • This topic was modified 5 years, 10 months ago by Nahum.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Miguel Muscat

    (@mekku)

    Hi nm,

    You can use the wprss_items_create_post_meta action. This action is triggered right after an item is saved in the database and provides you the item’s ID, the item object from SimplePie and the feed source ID. You can retrieve the feed source name from its ID using the WordPress function: get_the_title().

    Here’s an example:

    
    add_action( 'wprss_items_create_post_meta', 'my_function', 3 );
    function my_function( $item_id, $item, $source_id ) {
        $source_name = get_the_title( $source_id );
        // ...
        wp_set_object_terms( $item_id, $terms, $taxonomy );
    }
    

    Hope this helps!

    • This reply was modified 5 years, 10 months ago by Miguel Muscat.
    Thread Starter Nahum

    (@nahummadrid)

    Thanks @mekku I was in the ballpark originally with wprss_items_create_post_meta….but I was trying $inserted_ID & $feed_ID

    Thanks again

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Save Source Name as Custom Term’ is closed to new replies.