images ) {
if ( ! current_user_can( 'edit_post', get_the_ID() ) ) {
return '';
}
$connection_unavailable = is_wp_error( $gallery ) && 'instagram_connection_unavailable' === $gallery->get_error_code();
$error_message = $connection_unavailable
? $gallery->get_error_message()
: esc_html__( 'An error occurred in the Latest Instagram Posts block. Please try again later.', 'jetpack' );
$message = $error_message
. '
'
. esc_html__( '(Only administrators and the post author will see this message.)', 'jetpack' );
return Jetpack_Gutenberg::notice( $message, 'error', Blocks::classes( Blocks::get_block_feature( __DIR__ ), $attributes ) );
}
if ( empty( $gallery->images ) ) {
return '';
}
$images = array_slice( $gallery->images, 0, $count );
Jetpack_Gutenberg::load_assets_as_required( __DIR__ );
ob_start();
?>