Add missing function and parameter descriptions to a variety of functions in wp-admin/includes/image-edit.php.
Props NikV for the initial patch. Fixes #31353. git-svn-id: https://develop.svn.wordpress.org/trunk@31529 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
ced1630496
commit
4cc15f83cc
|
@ -7,8 +7,11 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param int $post_id
|
* Loads the WP image-editing interface.
|
||||||
* @param bool|object $msg
|
*
|
||||||
|
* @param int $post_id Post ID.
|
||||||
|
* @param bool|object $msg Optional. Message to display for image editor updates or errors.
|
||||||
|
* Default false.
|
||||||
*/
|
*/
|
||||||
function wp_image_editor($post_id, $msg = false) {
|
function wp_image_editor($post_id, $msg = false) {
|
||||||
$nonce = wp_create_nonce("image_editor-$post_id");
|
$nonce = wp_create_nonce("image_editor-$post_id");
|
||||||
|
@ -330,12 +333,31 @@ function wp_save_image_file( $filename, $image, $mime_type, $post_id ) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Image preview ratio. Internal use only.
|
||||||
|
*
|
||||||
|
* @since 2.9.0
|
||||||
|
*
|
||||||
|
* @ignore
|
||||||
|
* @param int $w Image width in pixels.
|
||||||
|
* @param int $h Image height in pixels.
|
||||||
|
* @return float|int Image preview ratio.
|
||||||
|
*/
|
||||||
function _image_get_preview_ratio($w, $h) {
|
function _image_get_preview_ratio($w, $h) {
|
||||||
$max = max($w, $h);
|
$max = max($w, $h);
|
||||||
return $max > 400 ? (400 / $max) : 1;
|
return $max > 400 ? (400 / $max) : 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// @TODO: Returns GD resource, but is NOT public
|
/**
|
||||||
|
* Returns an image resource. Internal use only.
|
||||||
|
*
|
||||||
|
* @since 2.9.0
|
||||||
|
*
|
||||||
|
* @ignore
|
||||||
|
* @param resource $img Image resource.
|
||||||
|
* @param float|int $angle Image rotation angle, in degrees.
|
||||||
|
* @return resource|false GD image resource, false otherwise.
|
||||||
|
*/
|
||||||
function _rotate_image_resource($img, $angle) {
|
function _rotate_image_resource($img, $angle) {
|
||||||
_deprecated_function( __FUNCTION__, '3.5', __( 'Use WP_Image_Editor::rotate' ) );
|
_deprecated_function( __FUNCTION__, '3.5', __( 'Use WP_Image_Editor::rotate' ) );
|
||||||
if ( function_exists('imagerotate') ) {
|
if ( function_exists('imagerotate') ) {
|
||||||
|
@ -349,14 +371,15 @@ function _rotate_image_resource($img, $angle) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @TODO: Only used within image_edit_apply_changes
|
* Flips an image resource. Internal use only.
|
||||||
* and receives/returns GD Resource.
|
|
||||||
* Consider removal.
|
|
||||||
*
|
*
|
||||||
* @param GD_Resource $img
|
* @since 2.9.0
|
||||||
* @param boolean $horz
|
*
|
||||||
* @param boolean $vert
|
* @ignore
|
||||||
* @return GD_Resource
|
* @param resource $img Image resource.
|
||||||
|
* @param bool $horz Whether to flip horizontally.
|
||||||
|
* @param bool $vert Whether to flip vertically.
|
||||||
|
* @return resource (maybe) flipped image resource.
|
||||||
*/
|
*/
|
||||||
function _flip_image_resource($img, $horz, $vert) {
|
function _flip_image_resource($img, $horz, $vert) {
|
||||||
_deprecated_function( __FUNCTION__, '3.5', __( 'Use WP_Image_Editor::flip' ) );
|
_deprecated_function( __FUNCTION__, '3.5', __( 'Use WP_Image_Editor::flip' ) );
|
||||||
|
@ -378,16 +401,17 @@ function _flip_image_resource($img, $horz, $vert) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @TODO: Only used within image_edit_apply_changes
|
* Crops an image resource. Internal use only.
|
||||||
* and receives/returns GD Resource.
|
|
||||||
* Consider removal.
|
|
||||||
*
|
*
|
||||||
* @param GD_Resource $img
|
* @since 2.9.0
|
||||||
* @param float $x
|
*
|
||||||
* @param float $y
|
* @ignore
|
||||||
* @param float $w
|
* @param resource $img Image resource.
|
||||||
* @param float $h
|
* @param float $x Source point x-coordinate.
|
||||||
* @return GD_Resource
|
* @param float $y Source point y-cooredinate.
|
||||||
|
* @param float $w Source width.
|
||||||
|
* @param float $h Source height.
|
||||||
|
* @return resource (maybe) cropped image resource.
|
||||||
*/
|
*/
|
||||||
function _crop_image_resource($img, $x, $y, $w, $h) {
|
function _crop_image_resource($img, $x, $y, $w, $h) {
|
||||||
$dst = wp_imagecreatetruecolor($w, $h);
|
$dst = wp_imagecreatetruecolor($w, $h);
|
||||||
|
@ -561,8 +585,12 @@ function stream_preview_image( $post_id ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param int $post_id
|
* Restores the metadata for a given attachment.
|
||||||
* @return stdClass
|
*
|
||||||
|
* @since 2.9.0
|
||||||
|
*
|
||||||
|
* @param int $post_id Attachment post ID.
|
||||||
|
* @return stdClass Image restoration message object.
|
||||||
*/
|
*/
|
||||||
function wp_restore_image($post_id) {
|
function wp_restore_image($post_id) {
|
||||||
$meta = wp_get_attachment_metadata($post_id);
|
$meta = wp_get_attachment_metadata($post_id);
|
||||||
|
|
Loading…
Reference in New Issue