Making WordPress.org

Changeset 12730


Ignore:
Timestamp:
07/10/2023 10:39:41 PM (3 years ago)
Author:
coffee2code
Message:

Photo Directory, Photo: Add and use get_post_statuses_with_photo_hash() to get post statuses that should be considered in a photo hash check.

File:
1 edited

Legend:

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

    r12724 r12730  
    412412
    413413    /**
     414     * Returns an array of post statuses for which a photo can or had been
     415     * associated.
     416     *
     417     * These post statuses will be included in checks for already generated
     418     * photo hashes. This basically consists of posts statuses from
     419     * `self::get_post_statuses_with_photo()` and any added by the filter
     420     * (mainly to include new post statuses that don't actively have a photo
     421     * associated with them but did at one point, e.g. rejected photos).
     422     *
     423     * @return string[] Array of post statuses.
     424     */
     425    public static function get_post_statuses_with_photo_hash() {
     426        return (array) apply_filters(
     427            'wporg_photos_post_statuses_with_photo_hash',
     428            self::get_post_statuses_with_photo()
     429        );
     430    }
     431
     432    /**
    414433     * Returns an array of photo post statuses that are considered pending.
    415434     *
     
    443462                'value'      => $hash,
    444463            ] ],
    445             'post_status'    => [ 'draft', 'pending', 'private', 'publish', Rejection::get_post_status() ],
     464            'post_status'    => self::get_post_statuses_with_photo_hash(),
    446465            'post_type'      => Registrations::get_post_type(),
    447466            'posts_per_page' => 1,
Note: See TracChangeset for help on using the changeset viewer.