WC_Meta_Box_Product_Images::get_media_gallery_json
Encode media gallery items for the hidden form field.
Method of the class: WC_Meta_Box_Product_Images{}
No Hooks.
Returns
string.
Usage
$result = WC_Meta_Box_Product_Images::get_media_gallery_json( $media_gallery );
- $media_gallery(array) (required)
- Media gallery items.
WC_Meta_Box_Product_Images::get_media_gallery_json() WC Meta Box Product Images::get media gallery json code WC 11.1.2
private static function get_media_gallery_json( $media_gallery ) {
$json = wp_json_encode( $media_gallery );
return false === $json ? '[]' : $json;
}