\MainWP\ChildMainWP_Custom_Post_Type

Class MainWP_Custom_Post_Type

MainWP Custom Post Type extension handler.

Summary

Methods
Properties
Constants
instance()
mainwp_custom_post_type_handle_fatal_error()
action()
$instance
$information
$plugin_translate
No constants found
No protected methods found
No protected properties found
N/A
import_custom_post()
search_images()
insert_post()
insert_custom_data()
insert_postmeta()
upload_postmeta_image()
No private properties found
N/A

Properties

$instance

$instance : mixed

Public static variable to hold the single instance of the class.

Type

mixed — Default null

$information

$information : array

Public static variable containing the synchronization information.

Type

array — Synchronization information.

$plugin_translate

$plugin_translate : string

Public variable to hold the information about the language domain.

Type

string — 'mainwp-child' languge domain.

Methods

mainwp_custom_post_type_handle_fatal_error()

mainwp_custom_post_type_handle_fatal_error() 

Method mainwp_custom_post_type_handle_fatal_error()

Custom post type fatal error handler.

action()

action() 

Custom post type action.

import_custom_post()

import_custom_post() : array|array<mixed,string>

Import custom post type.

Returns

array|array<mixed,string> —

$return Response array, or error message on failure.

search_images()

search_images(string  $post_content, string  $upload_dir, boolean  $check_image = false) : string|array<mixed,string>

Search for images inside post content and upload it to Child Site.

Parameters

string $post_content

Post content to search.

string $upload_dir

Upload directory.

boolean $check_image

Check if file exists. Default: false.

Returns

string|array<mixed,string> —

Error message or post content string.

insert_post()

insert_post(string  $data, integer  $edit_id, integer  $parent_id) : array|boolean|array<mixed,string>

Insert data into published post.

Parameters

string $data

Data to insert.

integer $edit_id

Post ID to edit.

integer $parent_id

Post parent ID.

Returns

array|boolean|array<mixed,string> —

Response array, true|false, Error message.

insert_custom_data()

insert_custom_data(integer  $post_id, string  $data) : array|boolean|array<mixed,string>

Insert custom post data.

Parameters

integer $post_id

Post ID to update.

string $data

Custom data to add.

Returns

array|boolean|array<mixed,string> —

Response array, true|false, Error message.

insert_postmeta()

insert_postmeta(integer  $post_id, string  $data, boolean  $check_image_existed, boolean  $is_woocomerce) : array|boolean|array<mixed,string>

Insert post meta.

Parameters

integer $post_id

Post ID to update.

string $data

Meta datat add.

boolean $check_image_existed

Whether or not to check if image exists. true|false.

boolean $is_woocomerce

Whether or not the post is a woocommerce product. true|false.

Returns

array|boolean|array<mixed,string> —

Response array, true|false, Error message.

upload_postmeta_image()

upload_postmeta_image(array  $product_images, array  $meta_value, boolean  $check_image_existed) : array|boolean

Method upload_postmeta_image()

Upload post meta image.

Parameters

array $product_images

Woocomerce product images.

array $meta_value

Meta values.

boolean $check_image_existed

Determins if the images already exists.

Returns

array|boolean —

Error message array or TRUE on success.