$instance
$instance : mixed
Public static variable to hold the single instance of the class.
Class MainWP_Custom_Post_Type
MainWP Custom Post Type extension handler.
instance() : \MainWP\Child\MainWP_Custom_Post_Type|null
Create a public static instance of MainWP_Custom_Post_Type.
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.
string | $post_content | Post content to search. |
string | $upload_dir | Upload directory. |
boolean | $check_image | Check if file exists. Default: false. |
Error message or post content string.
insert_post(string $data, integer $edit_id, integer $parent_id) : array|boolean|array<mixed,string>
Insert data into published post.
string | $data | Data to insert. |
integer | $edit_id | Post ID to edit. |
integer | $parent_id | Post parent ID. |
Response array, true|false, Error message.
insert_postmeta(integer $post_id, string $data, boolean $check_image_existed, boolean $is_woocomerce) : array|boolean|array<mixed,string>
Insert post meta.
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. |
Response array, true|false, Error message.
upload_postmeta_image(array $product_images, array $meta_value, boolean $check_image_existed) : array|boolean
Method upload_postmeta_image()
Upload post meta image.
array | $product_images | Woocomerce product images. |
array | $meta_value | Meta values. |
boolean | $check_image_existed | Determins if the images already exists. |
Error message array or TRUE on success.