Make WordPress Core


Ignore:
Timestamp:
10/28/2015 09:54:04 PM (9 years ago)
Author:
azaozz
Message:

Responsive images: add inline docs for private functions.

Props swissspidy.
See #34430.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/media.php

    r35419 r35426  
    870870
    871871/**
    872  * Private, do not use
     872 * Caches and returns the base URL of the uploads directory.
     873 *
     874 * @since 4.4.0
     875 * @access private
     876 *
     877 * @return string The base URL, cached.
    873878 */
    874879function _wp_upload_dir_baseurl() {
     
    884889
    885890/**
    886  * Private, do not use
    887  */
    888 function _wp_get_image_size_from_meta( $size, $image_meta ) {
    889     if ( $size === 'full' ) {
     891 * Get the image size as array from its meta data.
     892 *
     893 * Used for responsive images.
     894 *
     895 * @since 4.4.0
     896 * @access private
     897 *
     898 * @param string $size_name  Image size. Accepts any valid image size name (thumbnail, medium, etc.).
     899 * @param array  $image_meta The image meta data.
     900 * @return array|bool Array of width and height values in pixels (in that order)
     901 *                    or false if the size doesn't exist.
     902 */
     903function _wp_get_image_size_from_meta( $size_name, $image_meta ) {
     904    if ( $size_name === 'full' ) {
    890905        return array(
    891906            absint( $image_meta['width'] ),
    892907            absint( $image_meta['height'] ),
    893908        );
    894     } elseif ( ! empty( $image_meta['sizes'][$size] ) ) {
     909    } elseif ( ! empty( $image_meta['sizes'][$size_name] ) ) {
    895910        return array(
    896             absint( $image_meta['sizes'][$size]['width'] ),
    897             absint( $image_meta['sizes'][$size]['height'] ),
     911            absint( $image_meta['sizes'][$size_name]['width'] ),
     912            absint( $image_meta['sizes'][$size_name]['height'] ),
    898913        );
    899914    }
Note: See TracChangeset for help on using the changeset viewer.