Making WordPress.org


Ignore:
Timestamp:
07/10/2023 10:40:52 PM (2 years ago)
Author:
coffee2code
Message:

Photo Directory, Rejection: Hook new filter to include post status as one having photo hashes.

File:
1 edited

Legend:

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

    r12107 r12731  
    111111        add_action( 'init',                                    [ __CLASS__, 'register_meta' ] );
    112112        add_filter( 'is_protected_meta',                       [ __CLASS__, 'is_protected_meta' ], 10, 2 );
     113
     114        // Rejected photos should be considered in photo hash checks..
     115        add_filter( 'wporg_photos_post_statuses_with_photo_hash', [ __CLASS__, 'amend_with_post_status' ] );
    113116
    114117        // Customize post row actions.
     
    208211            ],
    209212        ];
     213    }
     214
     215    /**
     216     * Amends an array with the rejection post status.
     217     *
     218     * @param string[] $post_statuses Array of post statuses.
     219     * @return string[]
     220     */
     221    public static function amend_with_post_status( $post_statuses ) {
     222        $post_statuses[] = self::get_post_status();
     223        return $post_statuses;
    210224    }
    211225
Note: See TracChangeset for help on using the changeset viewer.