Content Copier Copy Using Given Data

So I am wondering if there is a way to copy data via some function. I would basically supply the post_id (s) that needed to be copied, the source blogs id and the destination blogs id. I can't seem to find a quick function that I can use. Thanks - Brandon

  • aristath
    • Recruit

    Hello again @Brashell,

    I have notified the plugin developer about this one.
    If there's a function you can use to do this using your own code he'll let us know. :slight_smile:
    Please keep in mind though that plugin developers have a lot of responsibilities so this might take a bit longer than a normal ticket.

    Cheers,
    Ari.

  • Ignacio
    • HummingBird

    Hi @Brashell.

    Please, download this zip and extract it into multisite-content-copier main folder. You'll see just a file called api.php. You just need to include it from an external location ( for instance, another plugin) and then do the following steps:

    1. Include the core files:
    <?php mcc_include_core_files(); ?>

    2. Call the copy items function:

    mcc_copy_items( $type, $items_ids, $source_blog_id, $dest_blog_ids, $args = array() )

    $type can be 'page', 'post' or a Custom Post Type slug.
    $items_ids must be an array of IDs (post/pages or CPTs IDs), you cannot copy pages and posts at the same time.
    $dest_blog_ids must be an array of Blog IDs where you want to copy the items into.
    $args is an array of settings, you can see more information about what are those settings in api.php.

    Regards.
    Ignacio.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.