From 88229587c04d136e7b830bd7211997c2b1a0871e Mon Sep 17 00:00:00 2001 From: Drew Jaynes Date: Mon, 13 Jul 2015 17:51:24 +0000 Subject: [PATCH] Improving formatting for various pieces of inline documentation in the new `WP_Site_Icon` class added in 4.3. See [32994]. See #32891. Built from https://develop.svn.wordpress.org/trunk@33198 git-svn-id: http://core.svn.wordpress.org/trunk@33170 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/class-wp-site-icon.php | 92 ++++++++++++++---------- wp-includes/version.php | 2 +- 2 files changed, 56 insertions(+), 38 deletions(-) diff --git a/wp-admin/includes/class-wp-site-icon.php b/wp-admin/includes/class-wp-site-icon.php index 99469a1056..cb7dbbb1a2 100644 --- a/wp-admin/includes/class-wp-site-icon.php +++ b/wp-admin/includes/class-wp-site-icon.php @@ -1,7 +1,6 @@ @@ -160,9 +169,10 @@ class WP_Site_Icon { } /** - * Settings field for file upload. + * Handles settings field for file upload. * * @since 4.3.0 + * @access public */ public function upload_field() { wp_enqueue_media(); @@ -191,11 +201,12 @@ class WP_Site_Icon { } /** - * Check if the image needs cropping. + * Checks if the image needs cropping. * * If it doesn't need cropping, proceed to set the icon. * * @since 4.3.0 + * @access public */ public function maybe_skip_cropping() { if ( empty( $_REQUEST['action'] ) || 'crop_site_icon' !== $_REQUEST['action'] ) { @@ -222,9 +233,10 @@ class WP_Site_Icon { } /** - * Crop a the image admin view. + * Handles the image crop admin view. * * @since 4.3.0 + * @access public */ public function crop_page() { check_admin_referer( 'crop-site-icon' ); @@ -314,9 +326,10 @@ class WP_Site_Icon { } /** - * Saves a new Site Icon. + * Handles saving a new Site Icon. * * @since 4.3.0 + * @access public */ public function set_site_icon() { check_admin_referer( 'set-site-icon' ); @@ -324,9 +337,7 @@ class WP_Site_Icon { $attachment_id = absint( $_REQUEST['attachment_id'] ); $create_new_attachement = ! empty( $_REQUEST['create-new-attachment'] ); - /* - * If the current attachment as been set as site icon don't delete it. - */ + // If the current attachment as been set as site icon don't delete it. if ( get_option( 'site_icon' ) == $attachment_id ) { // Get the file path. $image_url = get_attached_file( $attachment_id ); @@ -373,9 +384,10 @@ class WP_Site_Icon { } /** - * Upload the file to be cropped in the second step. + * Handles uploading the file to be cropped in the second step. * * @since 4.3.0 + * @access public */ public function handle_upload() { $uploaded_file = $_FILES['site-icon']; @@ -411,7 +423,7 @@ class WP_Site_Icon { } /** - * Create an attachment 'object'. + * Creates an attachment 'object'. * * @since 4.3.0 * @@ -440,9 +452,10 @@ class WP_Site_Icon { } /** - * Insert an attachment. + * Inserts an attachment. * * @since 4.3.0 + * @access public * * @param array $object Attachment object. * @param string $file File path of the attached image. @@ -456,7 +469,7 @@ class WP_Site_Icon { } /** - * Update the metadata of an attachment. + * Handles updating the metadata of an attachment. * * @since 4.3.0 * @@ -480,12 +493,13 @@ class WP_Site_Icon { } /** - * Add additional sizes to be made when creating the site_icon images. + * Adds additional sizes to be made when creating the site_icon images. * * @since 4.3.0 + * @access public * - * @param array $sizes - * @return array + * @param array $sizes List of additional sizes. + * @return array Additional image sizes. */ public function additional_sizes( $sizes = array() ) { $only_crop_sizes = array(); @@ -524,12 +538,13 @@ class WP_Site_Icon { } /** - * Add Site Icon sizes to the array of image sizes on demand. + * Adds Site Icon sizes to the array of image sizes on demand. * * @since 4.3.0 + * @access public * - * @param array $sizes - * @return array + * @param array $sizes List of image sizes. + * @return array List of intermediate image sizes. */ public function intermediate_image_sizes( $sizes = array() ) { /** This filter is documented in wp-admin/includes/site-icon.php */ @@ -545,8 +560,9 @@ class WP_Site_Icon { * Deletes all additional image sizes, used for site icons. * * @since 4.3.0 + * @access public * - * @return bool + * @return bool Whether the site icon was successfully deleted. */ public function delete_site_icon() { // We add the filter to make sure that we also delete all the added images. @@ -561,6 +577,7 @@ class WP_Site_Icon { * Deletes the Site Icon when the image file is deleted. * * @since 4.3.0 + * @access public * * @param int $post_id Attachment ID. */ @@ -576,14 +593,14 @@ class WP_Site_Icon { * Adds custom image sizes when meta data for an image is requested, that happens to be used as Site Icon. * * @since 4.3.0 + * @access public * - * @param null|array|string $value The value get_metadata() should - * return - a single metadata value, - * or an array of values. + * @param null|array|string $value The value get_metadata() should return a single metadata value, or an + * array of values. * @param int $post_id Post ID. * @param string $meta_key Meta key. * @param string|array $single Meta value, or an array of values. - * @return array|null|string + * @return array|null|string The attachment metadata value, array of values, or null. */ public function get_post_metadata( $value, $post_id, $meta_key, $single ) { $site_icon_id = get_option( 'site_icon' ); @@ -596,9 +613,10 @@ class WP_Site_Icon { } /** - * Get the data required to work with the uploaded image + * Gets the data required to work with the uploaded image * * @since 4.3.0 + * @access private * * @return array containing the collected data */ diff --git a/wp-includes/version.php b/wp-includes/version.php index 2753fb5ab6..41129ae533 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.3-beta2-33197'; +$wp_version = '4.3-beta2-33198'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.