const handleRemoveLocation = ( index ) => {
const locations = [ …props.attributes.locations ];
locations.splice( index, 1 );
props.setAttributes( { locations } );
};
$documents = get_posts(array(
‘post_type’ => ‘document’,
‘posts_per_page’ => -1, //add this line