Making WordPress.org

Changeset 14650


Ignore:
Timestamp:
02/03/2026 01:39:17 AM (6 hours ago)
Author:
coffee2code
Message:

Photo Directory, Photo: Add has_exif() to determine if a photo has any associated EXIF data, or specifically the EXIF keys explicitly specified.

File:
1 edited

Legend:

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

    r14199 r14650  
    968968
    969969    /**
     970     * Determines if a photo has EXIF data.
     971     *
     972     * @param array $exif_keys Optional. EXIF keys to check for. An empty array will
     973     *                         check if any EXIF data exists. Default empty array.
     974     * @param int   $post_id   Optional. Post ID. Default null, indicating the current post.
     975     * @return bool True if the photo has EXIF data, else false.
     976     */
     977    public static function has_exif( $exif_keys = [], $post_id = null ) {
     978        $post_id = $post_id ?: get_the_ID();
     979        $exif = self::get_exif( $post_id, $exif_keys );
     980        return ! empty( $exif );
     981    }
     982
     983    /**
    970984     * Strips markups from text and UTF8 encodes it if it appears to be UTF8.
    971985     *
Note: See TracChangeset for help on using the changeset viewer.