ClassesBigCommerceImportImage Importer

Image_Importer

Class Image_Importer

Imports an image from a URL and attaches it to a post

  • Full name: \BigCommerce\Import\Image_Importer

Constants

ConstantVisibilityTypeValue
SOURCE_URLpublic’bigcommerce_source_url’
URL_ZOOMpublic’url_zoom’
URL_STDpublic’url_standard’
URL_THUMBpublic’url_thumbnail’
URL_TINYpublic’url_tiny’
IMAGE_ALTpublic’image_alt’
FULL_IMAGE_IMPORTpublic’bigcommerce_allow_full_image_import’
CDN_IMAGE_IMPORTpublic’bigcommerce_allow_cdn_image_import’
DISABLE_IMAGE_IMPORTpublic’bigcommerce_disable_image_import’
MIMESpublic[IMAGETYPE_GIF => ‘image/gif’, IMAGETYPE_JPEG => ‘image/jpg’, IMAGETYPE_PNG => ‘image/png’, IMAGETYPE_SWF => ‘image/swf’, IMAGETYPE_PSD => ‘image/psd’, IMAGETYPE_BMP => ‘image/bmp’, IMAGETYPE_TIFF_II => ‘image/tiff’, IMAGETYPE_TIFF_MM => ‘image/tiff’, IMAGETYPE_JPC => ‘image/jpc’, IMAGETYPE_JP2 => ‘image/jp2’, IMAGETYPE_JPX => ‘image/jpx’, IMAGETYPE_JB2 => ‘image/jb2’, IMAGETYPE_SWC => ‘image/swc’, IMAGETYPE_IFF => ‘image/iff’, IMAGETYPE_WBMP => ‘image/wbmp’, IMAGETYPE_XBM => ‘image/xbm’, IMAGETYPE_ICO => ‘image/ico’]

Methods

__construct

public __construct(mixed $image_url, mixed $attach_to_post_id): mixed

Parameters:

ParameterTypeDescription
$image_urlmixed
$attach_to_post_idmixed

import

public import(false $is_category = false): false|int|\WP_Error

Parameters:

ParameterTypeDescription
$is_categoryfalse

should_load_from_cdn

Check if images serving from BigCommerce CDN is enabled

public static should_load_from_cdn(): bool
  • This method is static.

is_image_import_allowed

Check whether image import is enabled

public static is_image_import_allowed(): bool
  • This method is static.

Is featured image exists only on WP side

public static has_local_featured_image(int $post_id): bool
  • This method is static.

Parameters:

ParameterTypeDescription
$post_idint


Automatically generated on 2025-01-21