Press This: support passing i parameter to add an image src.

Props stephdau, azaozz. Fixes #32173.
Built from https://develop.svn.wordpress.org/trunk@32936


git-svn-id: http://core.svn.wordpress.org/trunk@32907 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Ozz 2015-06-25 03:06:25 +00:00
parent eaadfde950
commit d3ee649cb9
2 changed files with 10 additions and 1 deletions

View File

@ -738,6 +738,15 @@ class WP_Press_This {
}
}
}
// Support passing a single image src as `i`
if ( ! empty( $_REQUEST['i'] ) && ( $img_src = $this->_limit_img( wp_unslash( $_REQUEST['i'] ) ) ) ) {
if ( empty( $data['_images'] ) ) {
$data['_images'] = array( $img_src );
} elseif ( ! in_array( $img_src, $data['_images'], true ) ) {
array_unshift( $data['_images'], $img_src );
}
}
}
/**

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.3-alpha-32935';
$wp_version = '4.3-alpha-32936';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.