strip_tags( $media[$i]['caption'] ), 'title' => $media[$i]['title'] ); } } } else { if ( preg_match( '#\sdata-model="([^"]+)"#', $html, $galleryOut ) ) { $model = json_decode( htmlspecialchars_decode( $galleryOut[1] ), true ); for( $i = 0; $i < count( $model ); $i++ ) { $data[] = array( 'label' => strip_tags( $model[$i][ 'caption' ] ), 'title' => $model[$i][ 'title' ] ); } } if ( preg_match_all('#data-(video|image)-key="([^"]+)".*?\s

(.*?)<\/h2>#is', $html, $galleryOut ) ) { for( $i = 0; $i < count( $galleryOut[0] ); $i++ ) { $data[] = array( 'label' => $galleryOut[3][$i], 'title' => $galleryOut[2][$i] ); } } if ( preg_match_all('#data-(video|image)-key="([^"]+)".*?