Changeset 3789375
- Timestamp:
- 11/07/2026 10:36:52 AM (15 hours ago)
- Location:
- show-thumbnail-sizes-name
- Files:
-
- 9 edited
- 3 copied
-
assets/banner-1544x500.png (modified) (1 prop) ( previous)
-
assets/banner-772x250.png (modified) (1 prop) ( previous)
-
assets/icon-128x128.png (modified) (1 prop) ( previous)
-
assets/icon-256x256.png (modified) (1 prop) ( previous)
-
assets/screenshot-1.png (modified) (1 prop) ( previous)
-
tags/0.7 (copied) (copied from show-thumbnail-sizes-name/trunk )
-
tags/0.7/index.php (modified) (1 diff)
-
tags/0.7/readme.txt (copied) (copied from show-thumbnail-sizes-name/trunk/readme.txt ) (6 diffs)
-
tags/0.7/show-thumbnail-sizes-name.php (copied) (copied from show-thumbnail-sizes-name/trunk/show-thumbnail-sizes-name.php ) (2 diffs)
-
trunk/index.php (modified) (1 diff)
-
trunk/readme.txt (modified) (6 diffs)
-
trunk/show-thumbnail-sizes-name.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
show-thumbnail-sizes-name/assets/banner-1544x500.png
-
Property svn:mime-type
changed from
application/octet-streamtoimage/png
-
Property svn:mime-type
changed from
-
show-thumbnail-sizes-name/assets/banner-772x250.png
-
Property svn:mime-type
changed from
application/octet-streamtoimage/png
-
Property svn:mime-type
changed from
-
show-thumbnail-sizes-name/assets/icon-128x128.png
-
Property svn:mime-type
changed from
application/octet-streamtoimage/png
-
Property svn:mime-type
changed from
-
show-thumbnail-sizes-name/assets/icon-256x256.png
-
Property svn:mime-type
changed from
application/octet-streamtoimage/png
-
Property svn:mime-type
changed from
-
show-thumbnail-sizes-name/assets/screenshot-1.png
-
Property svn:mime-type
changed from
application/octet-streamtoimage/png
-
Property svn:mime-type
changed from
-
show-thumbnail-sizes-name/tags/0.7/index.php
r1971583 r3789375 1 1 <?php 2 // Silence is golden. 2 /** 3 * Silence is golden. 4 * 5 * @package ShowThumbnailSizesName 6 */ -
show-thumbnail-sizes-name/tags/0.7/readme.txt
r3358895 r3789375 1 === Thumbnail ( image) size names and dimensions ===1 === Thumbnail (Image) Size Names and Dimensions === 2 2 Contributors: kgmservizi 3 3 Donate link: https://kgmservizi.com 4 Tags: thumbnail, thumbnail name, thumbnail sizes, thumbnail sizes name, thumbnail size, image sizes, image sizes dimension, thumbnail names5 Requires at least: 3.06 Tested up to: 6.84 Tags: thumbnail, thumbnail sizes, image sizes, image size names, image dimensions 5 Requires at least: 4.6 6 Tested up to: 7.1 7 7 Requires PHP: 5.6 8 Stable tag: 0. 68 Stable tag: 0.7 9 9 License: GPLv2 or later 10 10 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 16 16 **Don't work? Open ticket, we answer in max 48h.** 17 17 18 You can eas y view all image size names and dimensions in a settings page.18 You can easily view all image size names and dimensions in a page under Tools. 19 19 20 **Need to manage sizes generation?** Use our plugin [Disable Thumbnails, Threshold and Image Options](https:// uskgm.it/disable-thumb-image-plugin"Disable Thumbnails, Threshold and Image Options")20 **Need to manage sizes generation?** Use our plugin [Disable Thumbnails, Threshold and Image Options](https://wordpress.org/plugins/disable-thumbnails-and-threshold/ "Disable Thumbnails, Threshold and Image Options") 21 21 22 22 … … 25 25 1. Upload the plugin files to the '/wp-content/plugins/' directory, or install the plugin through the WordPress plugins page directly. 26 26 2. Activate the plugin through the 'Plugins' page in WordPress. 27 3. Show plugin page in Tools -> Thumbnail Size.27 3. Open the plugin page in Tools -> Image Sizes. 28 28 29 29 == Frequently Asked Questions == … … 40 40 41 41 == Changelog == 42 43 = 0.7 = 44 * Code review and WordPress coding standards, translatable strings. 45 * Minimum WordPress version raised to 4.6. 46 * 7.1 compatibility. 47 * Direct link to the Disable Thumbnails plugin page. 48 * Image sizes shown in a standard, accessible admin table. 42 49 43 50 = 0.6 = … … 83 90 == Upgrade Notice == 84 91 92 = 0.7 = 93 Code review, coding standards and 7.1 compatibility. 94 85 95 = 0.6 = 86 96 6.8 compatibility and code revisions. … … 121 131 = 0.1 = 122 132 Initial release. 123 124 `<?php code(); // goes in backticks ?>` -
show-thumbnail-sizes-name/tags/0.7/show-thumbnail-sizes-name.php
r3358895 r3789375 1 1 <?php 2 2 /** 3 * Plugin Name: Thumbnail (Image) Size Names 4 * Version: 0.6 5 * Description: List of image size names of your installation. 6 * Author: KGM Servizi 7 * Author URI: https://kgmservizi.com 8 * License: GPLv2 or later 9 * License URI: https://www.gnu.org/licenses/gpl-2.0.html 3 * Plugin Name: Thumbnail (Image) Size Names and Dimensions 4 * Version: 0.7 5 * Description: List of image size names and dimensions of your installation. 6 * Author: KGM Servizi 7 * Author URI: https://kgmservizi.com 8 * License: GPLv2 or later 9 * License URI: https://www.gnu.org/licenses/gpl-2.0.html 10 * Text Domain: show-thumbnail-sizes-name 11 * Requires at least: 4.6 12 * Requires PHP: 5.6 13 * 14 * @package ShowThumbnailSizesName 10 15 */ 11 16 17 defined( 'ABSPATH' ) || exit; 18 19 add_action( 'admin_menu', 'show_thumbnail_sizes_name_menu' ); 20 12 21 /** 13 * 14 * Image size names menù and option15 * 22 * Registers the page under Tools. 23 * 24 * @return void 16 25 */ 17 add_action('admin_menu', 'show_thumbnail_sizes_name_menu');18 26 function show_thumbnail_sizes_name_menu() { 19 add_management_page('Image Sizes', 'Image Sizes', 'activate_plugins', 'show-thumbnail-size-name', 'show_thumbnail_sizes_name_function'); 20 } 21 22 // Add nonce via admin_init hook 23 add_action('admin_init', 'show_thumbnail_sizes_handle_nonce_redirect'); 24 function show_thumbnail_sizes_handle_nonce_redirect() { 25 if (isset($_GET['page']) && $_GET['page'] === 'show-thumbnail-size-name') { 26 if (!isset($_GET['_wpnonce']) || !wp_verify_nonce($_GET['_wpnonce'], 'show_thumbnail_sizes_nonce')) { 27 // Redirect to add nonce 28 $redirect_url = add_query_arg('_wpnonce', wp_create_nonce('show_thumbnail_sizes_nonce'), admin_url('tools.php?page=show-thumbnail-size-name')); 29 wp_redirect($redirect_url); 30 exit; 31 } 32 } 27 add_management_page( 28 __( 'Image Sizes', 'show-thumbnail-sizes-name' ), 29 __( 'Image Sizes', 'show-thumbnail-sizes-name' ), 30 'activate_plugins', 31 'show-thumbnail-size-name', 32 'show_thumbnail_sizes_name_function' 33 ); 33 34 } 34 35 35 36 /** 36 * 37 * Show list of image sizes 37 * Renders the list of registered image sizes. 38 * 39 * Read-only page: it changes no state, so it needs no nonce. Core already 40 * enforces the menu capability; the check below is defence in depth. 41 * 42 * @return void 38 43 */ 39 44 function show_thumbnail_sizes_name_function() { 40 // Enhanced security checks41 45 if ( ! current_user_can( 'activate_plugins' ) ) { 42 wp_die( 43 '<h1>' . __( 'Access Denied' ) . '</h1>' . 44 '<p>' . __( 'You do not have sufficient permissions to access this page. This page requires the ability to activate plugins.' ) . '</p>', 45 __( 'Access Denied' ), 46 wp_die( 47 esc_html__( 'You do not have sufficient permissions to access this page.', 'show-thumbnail-sizes-name' ), 48 esc_html__( 'Access Denied', 'show-thumbnail-sizes-name' ), 46 49 array( 'response' => 403 ) 47 50 ); 48 51 } 49 50 // Nonce is already verified in admin_init hook 51 52 echo '<div style="margin: 50px 25px;">'; 53 echo '<h1 style="margin: 0 0 25px 0">Image Size Names</h1>'; 54 echo '<h3>You can disable image sizes with <a href="https://uskgm.it/disable-thumb-image-plugin" target="_blank" rel="noopener">this plugin</a>.</h3>'; 55 echo '<pre>'; 56 foreach ( show_thumbnail_sizes_name_get_image_size() as $name => $_size ) { 57 echo '<div style="margin: 50px 0 0 0">'; 58 echo '<h3>' . esc_html( $name ) . '</h3>'; 59 echo 'width => ' . esc_html( $_size['width'] ) . '</br>'; 60 echo 'height => ' . esc_html( $_size['height'] ) . '</br>'; 61 if ($_size['crop'] == 1) { 62 echo 'crop => <b>TRUE</b>'; 63 } else { 64 echo 'crop => false'; 65 } 66 echo '</div>'; 67 } 68 echo '</pre></div>'; 52 ?> 53 <div class="wrap"> 54 <h1><?php esc_html_e( 'Image Size Names', 'show-thumbnail-sizes-name' ); ?></h1> 55 <p> 56 <?php 57 printf( 58 /* translators: %s: link to the Disable Thumbnails plugin. */ 59 esc_html__( 'You can disable image sizes with %s.', 'show-thumbnail-sizes-name' ), 60 '<a href="' . esc_url( 'https://wordpress.org/plugins/disable-thumbnails-and-threshold/' ) . '" target="_blank" rel="noopener">' . esc_html__( 'this plugin', 'show-thumbnail-sizes-name' ) . '<span class="screen-reader-text"> ' . esc_html__( '(opens in a new tab)', 'show-thumbnail-sizes-name' ) . '</span></a>' 61 ); 62 ?> 63 </p> 64 <table class="widefat striped"> 65 <caption class="screen-reader-text"><?php esc_html_e( 'Registered image sizes', 'show-thumbnail-sizes-name' ); ?></caption> 66 <thead> 67 <tr> 68 <th scope="col"><?php esc_html_e( 'Name', 'show-thumbnail-sizes-name' ); ?></th> 69 <th scope="col"><?php esc_html_e( 'Width', 'show-thumbnail-sizes-name' ); ?></th> 70 <th scope="col"><?php esc_html_e( 'Height', 'show-thumbnail-sizes-name' ); ?></th> 71 <th scope="col"><?php esc_html_e( 'Crop', 'show-thumbnail-sizes-name' ); ?></th> 72 </tr> 73 </thead> 74 <tbody> 75 <?php foreach ( show_thumbnail_sizes_name_get_image_size() as $name => $size ) : ?> 76 <tr> 77 <td><code><?php echo esc_html( $name ); ?></code></td> 78 <td><?php echo esc_html( $size['width'] ); ?></td> 79 <td><?php echo esc_html( $size['height'] ); ?></td> 80 <td> 81 <?php 82 if ( $size['crop'] ) { 83 echo '<strong>' . esc_html__( 'Yes', 'show-thumbnail-sizes-name' ) . '</strong>'; 84 } else { 85 esc_html_e( 'No', 'show-thumbnail-sizes-name' ); 86 } 87 ?> 88 </td> 89 </tr> 90 <?php endforeach; ?> 91 </tbody> 92 </table> 93 </div> 94 <?php 69 95 } 70 96 71 97 /** 72 * 73 * Function for retrieve all image sizes74 * 98 * Collects every intermediate image size with its dimensions. 99 * 100 * @return array<string, array{width: int, height: int, crop: bool}> Sizes keyed by name. 75 101 */ 76 102 function show_thumbnail_sizes_name_get_image_size() { … … 79 105 $sizes = array(); 80 106 81 foreach ( get_intermediate_image_sizes() as $_size ) { 82 if ( in_array( $_size, array('thumbnail', 'medium', 'medium_large', 'large') ) ) { 83 $width = get_option( "{$_size}_size_w" ); 84 $height = get_option( "{$_size}_size_h" ); 85 $crop = get_option( "{$_size}_crop" ); 86 87 $sizes[ $_size ]['width'] = is_numeric( $width ) ? (int) $width : 0; 88 $sizes[ $_size ]['height'] = is_numeric( $height ) ? (int) $height : 0; 89 $sizes[ $_size ]['crop'] = (bool) $crop; 90 } elseif ( isset( $_wp_additional_image_sizes[ $_size ] ) ) { 91 $additional_size = $_wp_additional_image_sizes[ $_size ]; 92 93 $sizes[ $_size ] = array( 94 'width' => is_numeric( $additional_size['width'] ) ? (int) $additional_size['width'] : 0, 95 'height' => is_numeric( $additional_size['height'] ) ? (int) $additional_size['height'] : 0, 96 'crop' => (bool) $additional_size['crop'], 97 ); 107 foreach ( get_intermediate_image_sizes() as $size_name ) { 108 if ( in_array( $size_name, array( 'thumbnail', 'medium', 'medium_large', 'large' ), true ) ) { 109 $width = get_option( "{$size_name}_size_w" ); 110 $height = get_option( "{$size_name}_size_h" ); 111 $crop = get_option( "{$size_name}_crop" ); 112 } elseif ( isset( $_wp_additional_image_sizes[ $size_name ] ) ) { 113 $width = $_wp_additional_image_sizes[ $size_name ]['width']; 114 $height = $_wp_additional_image_sizes[ $size_name ]['height']; 115 $crop = $_wp_additional_image_sizes[ $size_name ]['crop']; 116 } else { 117 continue; 98 118 } 119 120 $sizes[ $size_name ] = array( 121 'width' => is_numeric( $width ) ? (int) $width : 0, 122 'height' => is_numeric( $height ) ? (int) $height : 0, 123 // Crop may be an array of positions for custom sizes: any non-empty value means cropped. 124 'crop' => (bool) $crop, 125 ); 99 126 } 100 127 -
show-thumbnail-sizes-name/trunk/index.php
r1971583 r3789375 1 1 <?php 2 // Silence is golden. 2 /** 3 * Silence is golden. 4 * 5 * @package ShowThumbnailSizesName 6 */ -
show-thumbnail-sizes-name/trunk/readme.txt
r3358895 r3789375 1 === Thumbnail ( image) size names and dimensions ===1 === Thumbnail (Image) Size Names and Dimensions === 2 2 Contributors: kgmservizi 3 3 Donate link: https://kgmservizi.com 4 Tags: thumbnail, thumbnail name, thumbnail sizes, thumbnail sizes name, thumbnail size, image sizes, image sizes dimension, thumbnail names5 Requires at least: 3.06 Tested up to: 6.84 Tags: thumbnail, thumbnail sizes, image sizes, image size names, image dimensions 5 Requires at least: 4.6 6 Tested up to: 7.1 7 7 Requires PHP: 5.6 8 Stable tag: 0. 68 Stable tag: 0.7 9 9 License: GPLv2 or later 10 10 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 16 16 **Don't work? Open ticket, we answer in max 48h.** 17 17 18 You can eas y view all image size names and dimensions in a settings page.18 You can easily view all image size names and dimensions in a page under Tools. 19 19 20 **Need to manage sizes generation?** Use our plugin [Disable Thumbnails, Threshold and Image Options](https:// uskgm.it/disable-thumb-image-plugin"Disable Thumbnails, Threshold and Image Options")20 **Need to manage sizes generation?** Use our plugin [Disable Thumbnails, Threshold and Image Options](https://wordpress.org/plugins/disable-thumbnails-and-threshold/ "Disable Thumbnails, Threshold and Image Options") 21 21 22 22 … … 25 25 1. Upload the plugin files to the '/wp-content/plugins/' directory, or install the plugin through the WordPress plugins page directly. 26 26 2. Activate the plugin through the 'Plugins' page in WordPress. 27 3. Show plugin page in Tools -> Thumbnail Size.27 3. Open the plugin page in Tools -> Image Sizes. 28 28 29 29 == Frequently Asked Questions == … … 40 40 41 41 == Changelog == 42 43 = 0.7 = 44 * Code review and WordPress coding standards, translatable strings. 45 * Minimum WordPress version raised to 4.6. 46 * 7.1 compatibility. 47 * Direct link to the Disable Thumbnails plugin page. 48 * Image sizes shown in a standard, accessible admin table. 42 49 43 50 = 0.6 = … … 83 90 == Upgrade Notice == 84 91 92 = 0.7 = 93 Code review, coding standards and 7.1 compatibility. 94 85 95 = 0.6 = 86 96 6.8 compatibility and code revisions. … … 121 131 = 0.1 = 122 132 Initial release. 123 124 `<?php code(); // goes in backticks ?>` -
show-thumbnail-sizes-name/trunk/show-thumbnail-sizes-name.php
r3358895 r3789375 1 1 <?php 2 2 /** 3 * Plugin Name: Thumbnail (Image) Size Names 4 * Version: 0.6 5 * Description: List of image size names of your installation. 6 * Author: KGM Servizi 7 * Author URI: https://kgmservizi.com 8 * License: GPLv2 or later 9 * License URI: https://www.gnu.org/licenses/gpl-2.0.html 3 * Plugin Name: Thumbnail (Image) Size Names and Dimensions 4 * Version: 0.7 5 * Description: List of image size names and dimensions of your installation. 6 * Author: KGM Servizi 7 * Author URI: https://kgmservizi.com 8 * License: GPLv2 or later 9 * License URI: https://www.gnu.org/licenses/gpl-2.0.html 10 * Text Domain: show-thumbnail-sizes-name 11 * Requires at least: 4.6 12 * Requires PHP: 5.6 13 * 14 * @package ShowThumbnailSizesName 10 15 */ 11 16 17 defined( 'ABSPATH' ) || exit; 18 19 add_action( 'admin_menu', 'show_thumbnail_sizes_name_menu' ); 20 12 21 /** 13 * 14 * Image size names menù and option15 * 22 * Registers the page under Tools. 23 * 24 * @return void 16 25 */ 17 add_action('admin_menu', 'show_thumbnail_sizes_name_menu');18 26 function show_thumbnail_sizes_name_menu() { 19 add_management_page('Image Sizes', 'Image Sizes', 'activate_plugins', 'show-thumbnail-size-name', 'show_thumbnail_sizes_name_function'); 20 } 21 22 // Add nonce via admin_init hook 23 add_action('admin_init', 'show_thumbnail_sizes_handle_nonce_redirect'); 24 function show_thumbnail_sizes_handle_nonce_redirect() { 25 if (isset($_GET['page']) && $_GET['page'] === 'show-thumbnail-size-name') { 26 if (!isset($_GET['_wpnonce']) || !wp_verify_nonce($_GET['_wpnonce'], 'show_thumbnail_sizes_nonce')) { 27 // Redirect to add nonce 28 $redirect_url = add_query_arg('_wpnonce', wp_create_nonce('show_thumbnail_sizes_nonce'), admin_url('tools.php?page=show-thumbnail-size-name')); 29 wp_redirect($redirect_url); 30 exit; 31 } 32 } 27 add_management_page( 28 __( 'Image Sizes', 'show-thumbnail-sizes-name' ), 29 __( 'Image Sizes', 'show-thumbnail-sizes-name' ), 30 'activate_plugins', 31 'show-thumbnail-size-name', 32 'show_thumbnail_sizes_name_function' 33 ); 33 34 } 34 35 35 36 /** 36 * 37 * Show list of image sizes 37 * Renders the list of registered image sizes. 38 * 39 * Read-only page: it changes no state, so it needs no nonce. Core already 40 * enforces the menu capability; the check below is defence in depth. 41 * 42 * @return void 38 43 */ 39 44 function show_thumbnail_sizes_name_function() { 40 // Enhanced security checks41 45 if ( ! current_user_can( 'activate_plugins' ) ) { 42 wp_die( 43 '<h1>' . __( 'Access Denied' ) . '</h1>' . 44 '<p>' . __( 'You do not have sufficient permissions to access this page. This page requires the ability to activate plugins.' ) . '</p>', 45 __( 'Access Denied' ), 46 wp_die( 47 esc_html__( 'You do not have sufficient permissions to access this page.', 'show-thumbnail-sizes-name' ), 48 esc_html__( 'Access Denied', 'show-thumbnail-sizes-name' ), 46 49 array( 'response' => 403 ) 47 50 ); 48 51 } 49 50 // Nonce is already verified in admin_init hook 51 52 echo '<div style="margin: 50px 25px;">'; 53 echo '<h1 style="margin: 0 0 25px 0">Image Size Names</h1>'; 54 echo '<h3>You can disable image sizes with <a href="https://uskgm.it/disable-thumb-image-plugin" target="_blank" rel="noopener">this plugin</a>.</h3>'; 55 echo '<pre>'; 56 foreach ( show_thumbnail_sizes_name_get_image_size() as $name => $_size ) { 57 echo '<div style="margin: 50px 0 0 0">'; 58 echo '<h3>' . esc_html( $name ) . '</h3>'; 59 echo 'width => ' . esc_html( $_size['width'] ) . '</br>'; 60 echo 'height => ' . esc_html( $_size['height'] ) . '</br>'; 61 if ($_size['crop'] == 1) { 62 echo 'crop => <b>TRUE</b>'; 63 } else { 64 echo 'crop => false'; 65 } 66 echo '</div>'; 67 } 68 echo '</pre></div>'; 52 ?> 53 <div class="wrap"> 54 <h1><?php esc_html_e( 'Image Size Names', 'show-thumbnail-sizes-name' ); ?></h1> 55 <p> 56 <?php 57 printf( 58 /* translators: %s: link to the Disable Thumbnails plugin. */ 59 esc_html__( 'You can disable image sizes with %s.', 'show-thumbnail-sizes-name' ), 60 '<a href="' . esc_url( 'https://wordpress.org/plugins/disable-thumbnails-and-threshold/' ) . '" target="_blank" rel="noopener">' . esc_html__( 'this plugin', 'show-thumbnail-sizes-name' ) . '<span class="screen-reader-text"> ' . esc_html__( '(opens in a new tab)', 'show-thumbnail-sizes-name' ) . '</span></a>' 61 ); 62 ?> 63 </p> 64 <table class="widefat striped"> 65 <caption class="screen-reader-text"><?php esc_html_e( 'Registered image sizes', 'show-thumbnail-sizes-name' ); ?></caption> 66 <thead> 67 <tr> 68 <th scope="col"><?php esc_html_e( 'Name', 'show-thumbnail-sizes-name' ); ?></th> 69 <th scope="col"><?php esc_html_e( 'Width', 'show-thumbnail-sizes-name' ); ?></th> 70 <th scope="col"><?php esc_html_e( 'Height', 'show-thumbnail-sizes-name' ); ?></th> 71 <th scope="col"><?php esc_html_e( 'Crop', 'show-thumbnail-sizes-name' ); ?></th> 72 </tr> 73 </thead> 74 <tbody> 75 <?php foreach ( show_thumbnail_sizes_name_get_image_size() as $name => $size ) : ?> 76 <tr> 77 <td><code><?php echo esc_html( $name ); ?></code></td> 78 <td><?php echo esc_html( $size['width'] ); ?></td> 79 <td><?php echo esc_html( $size['height'] ); ?></td> 80 <td> 81 <?php 82 if ( $size['crop'] ) { 83 echo '<strong>' . esc_html__( 'Yes', 'show-thumbnail-sizes-name' ) . '</strong>'; 84 } else { 85 esc_html_e( 'No', 'show-thumbnail-sizes-name' ); 86 } 87 ?> 88 </td> 89 </tr> 90 <?php endforeach; ?> 91 </tbody> 92 </table> 93 </div> 94 <?php 69 95 } 70 96 71 97 /** 72 * 73 * Function for retrieve all image sizes74 * 98 * Collects every intermediate image size with its dimensions. 99 * 100 * @return array<string, array{width: int, height: int, crop: bool}> Sizes keyed by name. 75 101 */ 76 102 function show_thumbnail_sizes_name_get_image_size() { … … 79 105 $sizes = array(); 80 106 81 foreach ( get_intermediate_image_sizes() as $_size ) { 82 if ( in_array( $_size, array('thumbnail', 'medium', 'medium_large', 'large') ) ) { 83 $width = get_option( "{$_size}_size_w" ); 84 $height = get_option( "{$_size}_size_h" ); 85 $crop = get_option( "{$_size}_crop" ); 86 87 $sizes[ $_size ]['width'] = is_numeric( $width ) ? (int) $width : 0; 88 $sizes[ $_size ]['height'] = is_numeric( $height ) ? (int) $height : 0; 89 $sizes[ $_size ]['crop'] = (bool) $crop; 90 } elseif ( isset( $_wp_additional_image_sizes[ $_size ] ) ) { 91 $additional_size = $_wp_additional_image_sizes[ $_size ]; 92 93 $sizes[ $_size ] = array( 94 'width' => is_numeric( $additional_size['width'] ) ? (int) $additional_size['width'] : 0, 95 'height' => is_numeric( $additional_size['height'] ) ? (int) $additional_size['height'] : 0, 96 'crop' => (bool) $additional_size['crop'], 97 ); 107 foreach ( get_intermediate_image_sizes() as $size_name ) { 108 if ( in_array( $size_name, array( 'thumbnail', 'medium', 'medium_large', 'large' ), true ) ) { 109 $width = get_option( "{$size_name}_size_w" ); 110 $height = get_option( "{$size_name}_size_h" ); 111 $crop = get_option( "{$size_name}_crop" ); 112 } elseif ( isset( $_wp_additional_image_sizes[ $size_name ] ) ) { 113 $width = $_wp_additional_image_sizes[ $size_name ]['width']; 114 $height = $_wp_additional_image_sizes[ $size_name ]['height']; 115 $crop = $_wp_additional_image_sizes[ $size_name ]['crop']; 116 } else { 117 continue; 98 118 } 119 120 $sizes[ $size_name ] = array( 121 'width' => is_numeric( $width ) ? (int) $width : 0, 122 'height' => is_numeric( $height ) ? (int) $height : 0, 123 // Crop may be an array of positions for custom sizes: any non-empty value means cropped. 124 'crop' => (bool) $crop, 125 ); 99 126 } 100 127
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)