Maybe attempts to generate attachment metadata, if missing.
Parameters
$attachment
WP_Postrequired- Attachment object.
Source
'ids' => implode( ',', $ids ),
'src' => $srcs,
);
continue;
}
// Otherwise, extract srcs from the innerHTML.
preg_match_all( '#src=([\'"])(.+?)\1#is', $block['innerHTML'], $found_srcs, PREG_SET_ORDER );
if ( ! empty( $found_srcs[0] ) ) {
foreach ( $found_srcs as $src ) {
if ( isset( $src[2] ) && ! in_array( $src[2], $srcs, true ) ) {
$srcs[] = $src[2];
}
}
}
$galleries[] = array( 'src' => $srcs );
}
Changelog
Version | Description |
---|---|
3.9.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.