SmackUCI_API

Seamlessly create / update posts, custom posts, pages, products, media, SEO and contents of premium plugins from your CSV data with ease.

Class SmackUCI_API | wp-ultimate-csv-importer-api.php

Summary

Methods
Properties
Constants
get_available_fields()
getMapping()
saveMapping()
importData()
setFeaturedImage()
setTerms()
registerField()
fetchRecord()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
saveTemplate()
No private properties found
N/A

Methods

get_available_fields()

get_available_fields(  $module = null) : array

Function to get available fields based on the module

Parameters

$module
  • Name of the module | Posts (or) WooCommerce (or) Event (or) movie. Here, movie belongs to CustomPost.

Returns

array —
  • Fields set as based on the groups

getMapping()

getMapping(  $name) : array

Function to get the mapping template information

Parameters

$name
  • Name of the template ( For your reference on future imports )

Returns

array —
  • Template information as based on the field groups

saveMapping()

saveMapping(  $module,   $eventMapping,   $is_template,   $template_name) : array|string

Function which helps to save the mapping

Parameters

$module
  • Name of the module | Posts (or) Pages (or) WooCommerce (or) movie ( movie belongs to CustomPost )
$eventMapping
  • Group based mapping | WP fields (Vs) CSV Headers.
$is_template
  • Save Template ( optional ). Value can be 0 / 1.
$template_name
  • Name of the template.

Returns

array|string —
  • Saved template information

importData()

importData(  $importType,   $importMethod,   $mode,   $data,   $row_no = 1,   $eventMapping,   $affectedRecords = array(), array  $mediaConfig = array(), array  $importConfig = array(), integer  $is_template,   $template_name = null) : array

Function to push the data into WordPress as below Posts, Pages, Products, Custom Posts, Comments, Categories, Tags, Taxonomies, Customer Reviews & Users

Parameters

$importType
  • Name of the module | Posts (or) WooCommerce (or) Event (or) movie. Here, movie belongs to CustomPost.
$importMethod
  • Import Method as "import_with_api"
$mode
  • Import Mode | "Insert" (or) "Update"
$data
  • Data Array | Group based field with value.
$row_no
  • Row Number ( optional ).
$eventMapping
  • Mapping information | Group based field mapping, WP Fields (vs) CSV Headers.
$affectedRecords
array $mediaConfig
  • Media Configuration ( optional ).
array $importConfig
  • Import Configuration ( optional ).
integer $is_template
  • Save Template ( optional ). Value can be 0 / 1.
$template_name
  • Name of the template ( It can be an existing template or new one )

Returns

array —
  • Information about the processed data

setFeaturedImage()

setFeaturedImage(  $imageURL,   $postID,   $renameImage = null) : array

Function which helps to assign featured image to the specific post / product

Parameters

$imageURL

| External URL of the image

$postID

| Valid ID of the Post / Page / Product

$renameImage

| Name of the image which you want to assign it.

Returns

array

setTerms()

setTerms(  $terms,   $taxonomy_name,   $pID) : array

Function which helps to assign the terms with parent -> child hierarchical as any number of depth for a specific post / product

Parameters

$terms

| Terms with any number of Parent -> Child hierarchical Ex:- Cars -> BMW -> Safety kits -> Airbags

$taxonomy_name

| Name of the taxonomy Ex:- Product Category

$pID

| Valid ID of the Post / Page / Product.

Returns

array

registerField()

registerField(  $field_info,   $module,   $import_type,   $plugin) : array

Function which helps to register the custom field for ACF, PODS, Toolset Types plugins

Parameters

$field_info

| It has the field information like ( label, name, desc, field_type, required, choice, role, related_to, bi_directional )

$module

| Name of the module | Posts (or) WooCommerce (or) Event (or) CustomPost.

$import_type

| If you want to register field under any custom post means, the value should be like movie. Here, movie is a custom post type.

$plugin

| Should mention the plugin name like acf (or) types (or) pods

Returns

array

fetchRecord()

fetchRecord(  $data) : mixed

Function which helps you to fetch the record based on the module & ID of the specific record

Parameters

$data

| Which contains the ID of the specific record & module name.

Returns

mixed

saveTemplate()

saveTemplate(  $template_name,   $template_info,   $module) : array|string

Save mapping as a template

Parameters

$template_name
  • Name of the template
$template_info
  • Template information "Group based mapping" | WP fields (Vs) CSV Headers.
$module
  • Name of the module | Posts (or) WooCommerce (or) Event (or) movie. Here, movie belongs to CustomPost.

Returns

array|string —
  • Saved template information