I’m having the same issue with the library when using search or date filter. It’s the same as BjornW was talking about regarding the widget_id missing.
$_SERVER['HTTP_REFERER'] === '.../wp-admin/media-upload.php?type=image&tab=library&post_id=0&post_mime_type=&context=&s=sebb&m=0'
$this->base_id === 'widget_sp_image'
$_REQUEST['_wp_http_referer'] === '/wp-admin/media-upload.php?type=image&tab=library&post_id=0&post_mime_type=&context=&s=sebb&m=0'
$_REQUEST['widget_id'] === NULL
Because of this is_sp_widget_context()
returns false in image_send_to_editor
and so does function does not output the required JS globals.
Unfortunately I’ve never written code for WP so I’m not sure how to fix this issue.