Making WordPress.org

Changeset 12768


Ignore:
Timestamp:
08/01/2023 10:01:16 PM (23 months ago)
Author:
coffee2code
Message:

Photo Directory, Moderation: Only link moderator's last moderated post if current user can edit it.

See #7130.

File:
1 edited

Legend:

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

    r12767 r12768  
    818818            $last_moderated = User::get_last_moderated( $user->ID, true );
    819819            if ( $last_moderated ) {
    820                 printf( '<a href="%s">%s</a>', get_edit_post_link( $last_moderated->ID ), get_the_date( 'Y-m-d', $last_moderated->ID ) );
     820                $edit_url = get_edit_post_link( $last_moderated->ID );
     821                $last_mod_date = get_the_date( 'Y-m-d', $last_moderated->ID );
     822                if ( $edit_url ) {
     823                    printf( '<a href="%s">%s</a>', esc_url( $edit_url ), $last_mod_date );
     824                } else {
     825                    echo $last_mod_date;
     826                }
    821827            }
    822828            echo '</td>';
Note: See TracChangeset for help on using the changeset viewer.