Changeset 27129 for trunk/src/wp-includes/media.php
- Timestamp:
- 02/08/2014 12:40:15 AM (13 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/media.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/media.php
r27128 r27129 182 182 183 183 /** 184 * Register s a new image size184 * Register a new image size. 185 185 * 186 186 * @since 2.9.0 187 * 188 * @param string $name The image size name. 189 * @param int $width The image's width. 190 * @param int $height The image's width. 191 * @param bool $width Whether to crop the image to fit the dimensions. Default false. 187 192 */ 188 193 function add_image_size( $name, $width = 0, $height = 0, $crop = false ) { 189 194 global $_wp_additional_image_sizes; 190 $_wp_additional_image_sizes[$name] = array( 'width' => absint( $width ), 'height' => absint( $height ), 'crop' => (bool) $crop ); 191 } 192 193 /** 194 * Check if an image size exists 195 $_wp_additional_image_sizes[ $name ] = array( 196 'width' => absint( $width ), 197 'height' => absint( $height ), 198 'crop' => (bool) $crop, 199 ); 200 } 201 202 /** 203 * Check if an image size exists. 195 204 * 196 205 * @since 3.9.0 197 206 * 198 * @param string $name The image size name.207 * @param string $name The image size to check. 199 208 * @return bool True if it exists, false if not. 200 209 */ … … 202 211 global $_wp_additional_image_sizes; 203 212 204 return isset( $_wp_additional_image_sizes[$name] ); 213 return isset( $_wp_additional_image_sizes[ $name ] ); 214 } 215 216 /** 217 * Remove a new image size. 218 * 219 * @since 3.9.0 220 * 221 * @param string $name The image size to remove. 222 * @return bool True on success, false on failure. 223 */ 224 function remove_image_size( $name ) { 225 global $_wp_additional_image_sizes; 226 227 if ( isset( $_wp_additional_image_sizes[ $name ] ) ) { 228 unset( $_wp_additional_image_sizes[ $name ] ); 229 return true; 230 } 231 232 return false; 205 233 } 206 234
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)