• Resolved noplanman

    (@noplanman)


    Hi,

    We have a wealth of thousands of reviews and I’m working on a parser / importer for them all.

    I’d love to take advantage of the “Fetch Book Cover” extension, but the functionality of importing the cover from a URL is fixed to the data coming via $_POST.

    Is there any chance to make the save_and_attach_cover_data function statically available?
    Or how else would you recommend I go ahead with this?

    Copy-pasting your code into my plugin would work too, but I’d prefer to re-use what comes baked in.

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter noplanman

    (@noplanman)

    Quick update, which is working for me. Not sure how pretty this is though.

    $GLOBALS['review_id'] = $post_id;
    
    $_POST['rcno_reviews_gr_cover_url'] = get_post_meta( $post_id, 'rcno_reviews_book_cover_url', true );
    $_POST['rcno_book_title']           = get_post_meta( $post_id, 'rcno_book_title', true );
    $_POST['rcno_book_isbn']            = get_post_meta( $post_id, 'rcno_book_isbn', true );
    
    ( new Rcno_Fetch_Book_Cover() )->save_and_attach_cover_data();
    Plugin Author Kemory Grubb

    (@w33zy)

    This is clever and it works (though I understand why you think it doesn’t look pretty)

    Currently, I am rewriting the plugin to be more OOP-istic and I’ll look into adding some more hooks to this feature so it is more easily extended.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Import reviews programatically’ is closed to new replies.