Making WordPress.org

Changeset 6851


Ignore:
Timestamp:
03/10/2018 12:11:16 PM (9 years ago)
Author:
ocean90
Message:

Translate: Use new Plugin Directory code to obtain plugin icons.

Location:
sites/trunk/wordpress.org/public_html/wp-content/plugins
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/templates/style.css

    r6770 r6851  
    883883}
    884884
     885.projects .project-icon .plugin-icon {
     886        width: 128px;
     887        height: 128px;
     888        background-size: contain;
     889}
     890
    885891.projects .project-icon .default-icon span,
    886892.projects .project-icon .wordpress-icon span {
    … …  
    9971003
    9981004.project-box .project-icon .plugin-icon {
    999         margin: 0 !important;
     1005        width: 64px;
     1006        height: 64px;
     1007        background-size: contain;
    10001008}
    10011009
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-routes/inc/class-plugin.php

    r6319 r6851  
    3737         */
    3838        public function plugins_loaded() {
    39                 if ( file_exists( WPORGPATH . 'extend/plugins-plugins/_plugin-icons.php' ) ) {
    40                         include_once WPORGPATH . 'extend/plugins-plugins/_plugin-icons.php';
     39                if ( file_exists( WPORGPATH . 'wp-content/plugins/plugin-directory/class-template.php' ) ) {
     40                        include_once WPORGPATH . 'wp-content/plugins/plugin-directory/class-template.php';
    4141                }
    4242
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-routes/inc/routes/class-locale.php

    r6770 r6851  
    33namespace WordPressdotorg\GlotPress\Routes\Routes;
    44
    5 // wporg_get_plugin_icon()
    65use GP;
    76use GP_Locales;
    … …  
    311310                                        return '<div class="default-icon"><span class="dashicons dashicons-admin-appearance"></span></div>';
    312311                                }
    313                         case 'bbpress':
    314                         case 'buddypress':
    315                                 if ( function_exists( 'wporg_get_plugin_icon' ) ) {
    316                                         $screenshot = wporg_get_plugin_icon( $project->slug, $size );
    317                                         if ( $screenshot ) {
    318                                                 return $screenshot;
     312                        case 'wp-plugins':
     313                                $icon = '';
     314
     315                                if ( class_exists( 'WordPressdotorg\Plugin_Directory\Template' ) ) {
     316                                        $directory_post_id = gp_get_meta( 'wp-plugins', $sub_project->id, 'directory-post-id' );
     317                                        if ( $directory_post_id ) {
     318                                                switch_to_blog( WPORG_PLUGIN_DIRECTORY_BLOGID );
     319                                                $icon = \WordPressdotorg\Plugin_Directory\Template::get_plugin_icon( $directory_post_id, 'html' );
     320                                                restore_current_blog();
    319321                                        }
    320322                                }
     323
     324                                if ( $icon ) {
     325                                        return $icon;
     326                                }
     327
    321328                                return '<div class="default-icon"><span class="dashicons dashicons-admin-plugins"></span></div>';
    322                         case 'wp-plugins':
    323                                 if ( function_exists( 'wporg_get_plugin_icon' ) ) {
    324                                         $screenshot = wporg_get_plugin_icon( $sub_project->slug, $size );
    325                                         if ( $screenshot ) {
    326                                                 return $screenshot;
    327                                         }
    328                                 }
    329                                 return '<div class="default-icon"><span class="dashicons dashicons-admin-plugins"></span></div>';
    330                         case 'glotpress':
    331                                 return '<div class="icon"><img src="'. plugins_url( 'templates/images/glotpress.png', 'wporg-gp-customizations/wporg-gp-customizations.php' ) . '" width="' . $size . '" height="' . $size . '"></div>';
    332329                        case 'apps':
    333330                                return '<div class="default-icon"><span class="dashicons dashicons-smartphone"></span></div>';
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-routes/inc/routes/class-wp-plugins.php

    r3002 r6851  
    172172
    173173                $icon = '';
    174                 if ( function_exists( 'wporg_get_plugin_icon' ) ) {
    175                         $icon = wporg_get_plugin_icon( $project->slug, $size );
     174
     175                if ( class_exists( 'WordPressdotorg\Plugin_Directory\Template' ) ) {
     176                        $directory_post_id = gp_get_meta( 'wp-plugins', $project->id, 'directory-post-id' );
     177                        if ( $directory_post_id ) {
     178                                switch_to_blog( WPORG_PLUGIN_DIRECTORY_BLOGID );
     179                                $icon = \WordPressdotorg\Plugin_Directory\Template::get_plugin_icon( $directory_post_id, 'html' );
     180                                restore_current_blog();
     181                        }
    176182                }
    177183
Note: See TracChangeset for help on using the changeset viewer.