• Incredible plugin. I noticed there is no ‘post_format’ field for CSV’s. You can use the below code to add a post format to posts after they have been processed by the plugin.

    `php
    add_filter( ‘really_simple_csv_importer_post_saved’, function($post) {

    // Checks if the post category is video (this can be any category you choose.) Or any
    // conditional.

    $first_category_slug = get_the_category($post->ID)[0]->slug;

    if($first_category_slug === ‘video’) {
    // Use WP set_post_format method.
    set_post_format($post->ID, ‘video’);
    }

    }, 10, 1 );
    `

  • The topic ‘Save Post Format’ is closed to new replies.