Plugin Directory

Changeset 1586810


Ignore:
Timestamp:
02/01/2017 09:49:35 PM (9 years ago)
Author:
pressupinc
Message:

Added all sizes directly to "Attachment Display Settings" dialog

Location:
display-all-image-sizes/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • display-all-image-sizes/trunk/display-all-image-sizes.php

    r1218226 r1586810  
    44Description: Displays all sizes of each image, including name, dimensions, and permalink for each size. A major time-saver if you frequently use custom-generated image sizes.
    55Author: Press Up
    6 Version: 1.1.3
     6Version: 1.1.4
    77Author URI: http://pressupinc.com/
    88Text Domain: display-all-image-sizes
     
    102102    return $size_data_html;
    103103}
     104
     105// Register the three useful image sizes for use in Add Media modal
     106add_filter( 'image_size_names_choose', 'wpshout_custom_sizes' );
     107function wpshout_custom_sizes( $sizes ) {
     108    global $post;
     109    $size_names = get_intermediate_image_sizes( $post->ID );
     110
     111    $size_merge = [];
     112    foreach( $size_names as $size ) {
     113        $size_merge[$size] = wpshout_deslug( $size );
     114    }
     115
     116    return array_merge( $sizes, $size_merge );
     117}
     118
     119function wpshout_deslug( $string ) {
     120    return ucwords( str_replace( '-', ' ', $string ) );
     121}
  • display-all-image-sizes/trunk/readme.txt

    r1218226 r1586810  
    44Requires at least: 3.5
    55Tested up to: 4.2.4
    6 Stable tag: 1.1.3
     6Stable tag: 1.1.4
    77License: MIT
    88License URI: http://opensource.org/licenses/MIT
     
    5252== CHANGELOG ==
    5353
     54= 1.1.4 (02.01.2017) =
     55Added all sizes directly to "Attachment Display Settings" dialog
     56
    5457= 1.1.3 (11.08.2015) =
    5558Styling cleanup
Note: See TracChangeset for help on using the changeset viewer.