This is a class that allows you to import posts from Wix into WordPress.

Overview

Wix Posts to WordPress

This is a class that allows you to import posts from Wix into WordPress.

Requirements

composer require 20minutes/php-draftjs-html

  • Wix API key

Usage

<?php

// autoload composer dependencies
require_once __DIR__ . '/vendor/autoload.php';
require_once __DIR__ . '/class-wix-import.php';

// create WixBlogImport instance
$api_key = 'your-api-key';
$wix_blog_import = new WixBlogImport($api_key);

// import posts from Wix
$params = [
    'fieldsToInclude' => 'CONTENT', // Content field is required for successful import
    'paging' => [
        'limit' => 100,
        'offset' => 0,
    ]
];

$wix_blog_import->import($params);

Hooks

WixBlogImport/insert_metas

<?php

/**
 * Fires while inserting post metas.
 *
 * @param int $post_id Added Post ID
 * @param array $item Wix Post Item
 */
add_action('WixBlogImport/insert_metas', function ($post_id, $item) {
    // do something
});

WixBlogImport/after_insert_post

<?php

/**
 * Fires after a post has been successfully inserted.
 *
 * @param int $post_id Added Post ID
 * @param array $item Wix Post Item
 */

add_action('WixBlogImport/after_insert_post', function ($post_id, $item) {
    // do something
});

WixBlogImport/post_data

<?php

/**
 * Filters post data before inserting post.
 *
 * @param array $post_data Post data
 * @param array $item Wix Post Item
 */

add_filter('WixBlogImport/post_data', function ($post_data, $item) {
    // do something
    // maybe you want to change the post status before inserting the post.
    return $post_data;
});
You might also like...
A hacky PHP script to download posts, images, videos and framework grading from Parent Zone

ParentZoneDownloader A hacky PHP script to download posts, images, videos and framework grading from Parent Zone Pre-Requisites Tested on PHP 7.4, but

Stores the customer_user for WooCommerce orders and subscriptions in the post_author column of posts table.

Post Author Optimization for WooCommerce Requires PHP: 7.0 WP requires at least: 5.7 WP tested up to: 5.7 WC requires at least: 5.6.0 WC tested up to:

The plugin generates posts/pages. Useful to generate millions of records in wp_posts table
The plugin generates posts/pages. Useful to generate millions of records in wp_posts table

KAGG Generator The plugin generates posts/pages. Useful to generate millions of records in wp_posts table. In WordPress development, sometimes it is n

Exploiting and fixing security vulnerabilities of an old version of E-Class. Project implemented as part of the class YS13 Cyber-Security.

Open eClass 2.3 Development of XSS, CSRF, SQLi, RFI attacks/defences of an older,vulnerable version of eclass. Project implemented as part of the clas

A class to help convert bytes into other units (kb, mb, etc).

A class to help convert bytes into other units (kb, mb, etc). This package can be used to convert int|float values from bytes to KB, MB and GB as well

Allows generate class files parse from json and map json to php object, including multi-level and complex objects;

nixihz/php-object Allows generate class files parse from json and map json to php object, including multi-level and complex objects; Installation You

Plugin that allows a player to morph into mobs
Plugin that allows a player to morph into mobs

BurgerMorphs This plugin adds a Morphs system to PMMP. Players can morph into most mobs available in the game. Players can also morph into baby versio

Import your Foursquare/Swarm checkins to your Micropub-enabled website

Swarm Checkins Import Import your Foursquare/Swarm checkins to your Micropub-enabled website Installation You'll need PHP and Composer to install this

Magento-bulk - Bulk Import/Export helper scripts and CLI utilities for Magento Commerce

Magento Bulk Bulk operations for Magento. Configuration Copy config.php.sample to config.php and edit it. Product Attribute Management List All Attrib

Owner
Basework
Development Studio
Basework
Talkino allows you to integrate multi social messengers and contact into your website and enable your users to contact you using multi social messengers' accounts.

Talkino Welcome to our GitHub Repository Talkino is a click to chat plugin to show your agents’ multiple social messengers, phone and emails on the ch

Traxconn 2 Sep 21, 2022
Q2A plugin that allows users to import and export Q2A configuration

Configuration Manager [by Gabriel Zanetti] Description Configuration Manager is a Question2Answer plugin that allows users to import and export Q2A co

Gabriel Zanetti 1 Nov 22, 2021
Coder Metabox for WordPress - Create Pages, Posts Custom Meta Fields options

Coder Metabox for WordPress Coder Metabox for WordPress - Create Pages, Posts Custom Meta Fields options. Step 1 call coder-metabox.php file in functi

Ashikur Rahman 3 Feb 19, 2022
Sync Wordpress Pages and Posts (even custom post types + fields) from static Markdown + YAML files

Sync Markdown Files to WordPress Posts and Pages Static site generators let you use a revision-controlled tree of markdown files to make a site, but d

null 26 Sep 26, 2022
Re-skinning BotCloaker enables you to add a SMART button at the end of all posts on your blog.

Re-skinning BotCloaker Wordpress Plugin Re-skinning BotCloaker enables you to add a SMART button at the end of all posts on your blog. Re-skinning Bot

Mohammed cha 120 Nov 11, 2022
Miniset allows you to create compact sets of fields that either combine into a string of classes, or return a simple array of values

Miniset allows you to create compact sets of fields that either combine into a string of classes, or return a simple array of values. Miniset

Jack Sleight 5 Jun 13, 2022
Thirdweb-wp - A community WordPress plugin for thirdweb. Turn your WordPress website into Web3 instantly and easily with thirdweb. 💻🌏

Thirdweb WP ?? Nominate (@WarenGonzaga) as GitHub Star. If you appreciate his hardwork and dedication to open source. A community WordPress plugin for

Waren Gonzaga 8 Dec 19, 2022