Making WordPress.org


Ignore:
Timestamp:
08/19/2024 08:12:52 PM (6 months ago)
Author:
coffee2code
Message:

Photo Directory, Admin: Show a toggle-able list of all EXIF data from a photo.

Props roytanck, jeroenrotty, coffee2code.
Fixes #7734.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/photo-directory/inc/admin.php

    r13814 r13975  
    593593        }
    594594        echo "</dl>\n";
     595
     596        // Show ALL EXIF data.
     597        $all_exif = Photo::get_all_exif( $parent_id );
     598        if ( $all_exif ) {
     599            ksort( $all_exif );
     600
     601            echo '<div class="photo-all-exif-container">';
     602            echo '<button id="photo-all-exif-toggle" class="button-link hide-if-no-js" type="button" aria-expanded="true">' . esc_html__( 'Toggle all raw EXIF data', 'wporg-photos' ) . '</button>';
     603            echo '<dl class="photo-all-exif">';
     604
     605            foreach ( $all_exif as $key => $value ) {
     606                if ( '' === $value ) {
     607                    continue;
     608                }
     609
     610                echo '<dt>' . esc_html( $key ) . "</dt>\n";
     611                if ( is_array( $value ) ) {
     612                    $value = '[' . implode( ', ', $value ) . ']';
     613                }
     614                echo '<dd>' . esc_html( $value ) . "</dd>\n";
     615            }
     616
     617            echo "</dl></div>\n";
     618        }
    595619    }
    596620
Note: See TracChangeset for help on using the changeset viewer.