Automattic\WooCommerce\Internal\ProductGallery
ProductMediaGallery::decode_video_gallery_meta
Decode video gallery post meta.
Method of the class: ProductMediaGallery{}
No Hooks.
Returns
array.
Usage
$result = ProductMediaGallery::decode_video_gallery_meta( $value ): array;
- $value(mixed) (required)
- Raw video gallery meta value.
ProductMediaGallery::decode_video_gallery_meta() ProductMediaGallery::decode video gallery meta code WC 11.1.2
private static function decode_video_gallery_meta( $value ): array {
if ( is_array( $value ) ) {
return $value;
}
if ( ! is_string( $value ) || '' === $value ) {
return array();
}
$decoded = json_decode( $value, true );
return is_array( $decoded ) ? $decoded : array();
}