onSearchModalReturn( returnValue ) {
		const { setAttributes } = this.props;

		const base_rest_path = '/wp-museum/v1/';

		if ( returnValue != null ) {
			setAttributes( { 
				objectID    : returnValue,
				imgURL      : null,
				imgHeight   : null,
				imgWidth    : null,
				imgIndex    : 0,
				totalImages : 0,
			} );

			const object_path = base_rest_path + 'all/' + returnValue;
			apiFetch( { path: object_path } ).then( result => {
				setAttributes( {
					title     : result[ 'post_title' ],
					objectURL : result[ 'link' ],
					catID     : result[ result[ 'cat_field' ] ],
				} );
			} );
		}
	}
/**
	 * Callback function from object search box. Sets the post_id for the object.
	 *
	 * @param {number} returnValue WordPress post_id returned from search modal.
	 */
Callback function from object search box. Sets the post_id for the object.
@param {number} returnValue WordPress post_id returned from search modal.
Callback function from object search box . Sets the post_id for the object . @param { number } returnValue WordPress post_id returned from search modal .
onSearchModalReturn( returnValue ) {
		const { setAttributes } = this.props;
		const base_rest_path = '/wp-museum/v1/';
		if ( returnValue != null ) {
			setAttributes( { 
				objectID    : returnValue,
				imgURL      : null,
				imgHeight   : null,
				imgWidth    : null,
				imgIndex    : 0,
				totalImages : 0,
			} );
			const object_path = base_rest_path + 'all/' + returnValue;
			apiFetch( { path: object_path } ).then( result => {
				setAttributes( {
					title     : result[ 'post_title' ],
					objectURL : result[ 'link' ],
					catID     : result[ result[ 'cat_field' ] ],
				} );
			} );
		}
	}
onSearchModalReturn ( returnValue ) { const { setAttributes } = this . props ; const base_rest_path = '/wp-museum/v1/' ; if ( returnValue != null ) { setAttributes ( { objectID : returnValue , imgURL : null , imgHeight : null , imgWidth : null , imgIndex : 0 , totalImages : 0 , } ) ; const object_path = base_rest_path + 'all/' + returnValue ; apiFetch ( { path : object_path } ) . then ( result => { setAttributes ( { title : result [ 'post_title' ] , objectURL : result [ 'link' ] , catID : result [ result [ 'cat_field' ] ] , } ) ; } ) ; } }
Callback function from object search box.
Callback function from object search box .