Making WordPress.org

Changeset 13983


Ignore:
Timestamp:
08/20/2024 04:14:05 AM (22 months ago)
Author:
dd32
Message:

Photo Directory, Uploads: Revert [13980].

See #7600.

File:
1 edited

Legend:

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

    r13980 r13983  
    8181        // Enqueue scripts.
    8282        add_action( 'wp_enqueue_scripts',               [ __CLASS__, 'wp_enqueue_scripts' ] );
    83         // Adds user's recent submissions above upload form.
    84         add_filter( 'wporg_photos_pre_upload_form',     [ __CLASS__, 'output_user_recent_submissions' ] );
    8583        // Disable upload form and show message if user not allowed to upload.
    8684        add_filter( 'the_content',                      [ __CLASS__, 'insert_upload_disallowed_notice' ], 1 );
     
    890888        if ( is_page( self::SUBMIT_PAGE_SLUG ) ) {
    891889            $content .= apply_filters( 'wporg_photos_pre_upload_form', $content );
     890
     891            if ( User::count_published_photos( get_current_user_id() ) ) {
     892                $content .= sprintf(
     893                    /* translators: %s: URL to current user's photo archive. */
     894                    '<p>' . __( 'View <a href="%s">your archive of photos</a> to see what you&#8217;ve already had published.', 'wporg-photos' ) . '</p>',
     895                    get_author_posts_url( get_current_user_id() )
     896                );
     897            }
    892898
    893899            $content .= '<fieldset id="wporg-photo-upload">';
     
    10091015        return $transforms;
    10101016    }
    1011 
    1012     /**
    1013      * Adds current user's 6 most recent photo submissions above upload form.
    1014      *
    1015      * @param string $content Existing content before the upload form.
    1016      * @return string
    1017      */
    1018     public static function output_user_recent_submissions( $content ) {
    1019         // Bail if user does not have any published photos.
    1020         if ( ! User::count_published_photos( get_current_user_id() ) ) {
    1021             return $content;
    1022         }
    1023 
    1024         $recent_photos = User::get_recent_photos( get_current_user_id(), 6, false );
    1025         if ( $recent_photos ) {
    1026             $content .= '<h2 class="latest-photos">' . esc_html__( 'Your latest published photos', 'wporg-photos' ) . '</h2>' . "\n";
    1027             $content .= '<div class="photos-grid">' . "\n";
    1028 
    1029             foreach ( $recent_photos as $photo ) {
    1030                 $content .= Template_Tags\get_photo_as_grid_item( $photo, 'medium', 'post' );
    1031             }
    1032 
    1033             $content .= "</div>\n";
    1034         }
    1035 
    1036         $content .= sprintf(
    1037             /* translators: %s: URL to current user's photo archive. */
    1038             '<p>' . __( 'View <a href="%s">your archive of photos</a> to see everything you&#8217;ve already had published.', 'wporg-photos' ) . '</p>',
    1039             esc_url( get_author_posts_url( get_current_user_id() ) )
    1040         );
    1041 
    1042         return $content;
    1043     }
    1044 
    10451017}
    10461018
Note: See TracChangeset for help on using the changeset viewer.