Making WordPress.org

Changeset 13651


Ignore:
Timestamp:
05/02/2024 07:16:42 AM (6 weeks ago)
Author:
dd32
Message:

Plugin Directory: Helpscout: Include the info endpoint on download urls in Helpscout.

See #7385.

Location:
sites/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/api.wordpress.org/public_html/dotorg/helpscout/plugins-themes.php

    r13015 r13651  
    2121
    2222*/
     23
     24// Run as the plugin directory, such that any filters are correct.
     25$wp_init_host = 'https://wordpress.org/plugins/';
    2326
    2427include __DIR__ . '/common.php';
     
    166169                    'posts_per_page' => 1,
    167170                ] );
    168                 $download_link = $attachments ? wp_get_attachment_url( $attachments[0]->ID ) : '#';
     171                $download_link = $attachments ? wp_get_attachment_url( $attachments[0]->ID ) : '';
     172            }
     173
     174            // Append Info URL.
     175            if ( $download_url && class_exists( '\WordPressdotorg\Plugin_Directory\API\Routes\Plugin_Review' ) ) {
     176                $download_url = \WordPressdotorg\Plugin_Directory\API\Routes\Plugin_Review::append_plugin_review_info_url( $download_url, $post );
    169177            }
    170178        }
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-plugin-directory.php

    r13649 r13651  
    18591859        }
    18601860
    1861         if ( ! $url || ! $post || ! current_user_can( 'edit_post', $post->ID ) ) {
     1861        if ( ! $url || ! $post || 'plugin' !== $post->post_type || ! current_user_can( 'edit_post', $post->ID ) ) {
    18621862            return $url;
    18631863        }
Note: See TracChangeset for help on using the changeset viewer.