Making WordPress.org

Changeset 14377


Ignore:
Timestamp:
02/05/2025 09:54:57 PM (12 months ago)
Author:
coffee2code
Message:

Plugin Directory, API: Change author attribution markup to link to owner's profile.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/api/routes/class-plugin.php

    r14153 r14377  
    104104        $result['version'] = get_post_meta( $post_id, 'version', true ) ?: '0.0';
    105105
    106         $result['author'] = strip_tags( get_post_meta( $post_id, 'header_author', true ) ) ?: get_user_by( 'id', $post->post_author )->display_name;
    107         if ( false != ( $author_url = get_post_meta( $post_id, 'header_author_uri', true ) ) ) {
    108             $result['author'] = sprintf( '<a href="%s">%s</a>', esc_url_raw( $author_url ), $result['author'] );
    109         }
     106        $profile_url = $this->get_user_profile_link( $post->post_author );
     107        $result['author'] = sprintf(
     108            '<a href="%s">%s</a>',
     109            esc_url_raw( $profile_url ),
     110            ( strip_tags( get_post_meta( $post_id, 'header_author', true ) ) ?: get_user_by( 'id', $post->post_author )->display_name )
     111        );
    110112
    111113        // Profile of the original plugin submitter
    112         $result['author_profile'] = $this->get_user_profile_link( $post->post_author );
     114        $result['author_profile'] = $profile_url;
    113115        $result['contributors']   = array();
    114116
Note: See TracChangeset for help on using the changeset viewer.