Making WordPress.org

Changeset 14184


Ignore:
Timestamp:
11/20/2024 09:41:12 PM (2 months ago)
Author:
coffee2code
Message:

Photo Directory, Admin: Add a count within the Authors column of the contributor's rejected photos for today, if there are any.

File:
1 edited

Legend:

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

    r14183 r14184  
    814814        $display_name .= '</a>';
    815815
     816        $post_type     = Registrations::get_post_type();
     817        $reject_status = Rejection::get_post_status();
     818
    816819        // Show number of approved photos.
    817820        $approved_link = add_query_arg( [
    818             'post_type'   => Registrations::get_post_type(),
     821            'post_type'   => $post_type,
    819822            'post_status' => 'publish',
    820823            'author'      => $authordata->ID,
     
    831834        if ( $approved_today_count ) {
    832835            $approved_today_link = add_query_arg( [
    833                 'post_type'   => Registrations::get_post_type(),
     836                'post_type'   => $post_type,
    834837                'post_status' => 'publish',
    835838                'author'      => $authordata->ID,
     
    847850        if ( $pending_count ) {
    848851            $pending_link = add_query_arg( [
    849                 'post_type'   => Registrations::get_post_type(),
     852                'post_type'   => $post_type,
    850853                'post_status' => 'pending',
    851854                'author'      => $authordata->ID,
     
    864867        if ( $rejection_count ) {
    865868            $rejected_link = add_query_arg( [
    866                 'post_type'   => Registrations::get_post_type(),
    867                 'post_status' => Rejection::get_post_status(),
     869                'post_type'   => $post_type,
     870                'post_status' => $reject_status,
    868871                'author'      => $authordata->ID,
    869872            ], 'edit.php' );
     
    873876                    _n( 'Rejected: <strong>%s</strong>', 'Rejected: <strong>%s</strong>', $rejection_count, 'wporg-photos' ),
    874877                    sprintf( '<a href="%s">%d</a>', $rejected_link, $rejection_count )
     878                )
     879                . "</div>\n";
     880        }
     881
     882        // Show number of photos rejected on this calendar day.
     883        $rejected_today_count = User::count_photos_for_today( $reject_status );
     884        if ( $rejected_today_count ) {
     885            $rejected_today_link = add_query_arg( [
     886                'post_type'   => $post_type,
     887                'post_status' => $reject_status,
     888                'author'      => $authordata->ID,
     889            ], 'edit.php' );
     890            $display_name .= '<div class="user-rejected-today-count">'
     891                . sprintf(
     892                    __( '&#x21AA; (today): %s', 'wporg-photos' ),
     893                    sprintf( '<strong><a href="%s">%d</a></strong>', $rejected_today_link, $rejected_today_count )
    875894                )
    876895                . "</div>\n";
Note: See TracChangeset for help on using the changeset viewer.