wpView: improve handling of embed errors/error messages, see #28195

git-svn-id: https://develop.svn.wordpress.org/trunk@28754 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz
2014-06-15 22:52:45 +00:00
parent 084cc046ac
commit ed07c215dc
4 changed files with 35 additions and 17 deletions
+12
View File
@@ -824,3 +824,15 @@ function heartbeat_autosave( $response, $data ) {
}
// Run later as we have to set DOING_AUTOSAVE for back-compat
add_filter( 'heartbeat_received', 'heartbeat_autosave', 500, 2 );
/**
* Send error message when an URL cannot be embedded. Used in wp_ajax_parse_embed().
*
* @access private
* @since 4.0
*/
function _wpview_embed_error( $output, $url ) {
wp_send_json_error( array(
'message' => sprintf( __( '%s failed to embed.' ), esc_url( $url ) ),
) );
}