WordPress.org

Make WordPress Core


Ignore:
Timestamp:
07/18/2008 03:16:53 AM (12 years ago)
Author:
ryan
Message:

Move plugin data translation and display markup to plugins page. Props DD32. see #3089

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/plugins.php

    r8218 r8368  
    217217foreach( (array)$all_plugins as $plugin_file => $plugin_data) {
    218218
     219    //Translate fields
     220    if( !empty($plugin_data['TextDomain']) ) {
     221        if( !empty( $plugin_data['DomainPath'] ) )
     222            load_plugin_textdomain($plugin_data['TextDomain'], dirname($plugin_file). $plugin_data['DomainPath']);
     223        else
     224            load_plugin_textdomain($plugin_data['TextDomain'], dirname($plugin_file));
     225
     226        foreach ( array('Name', 'PluginURI', 'Description', 'Author', 'AuthorURI', 'Version') as $field )
     227            $plugin_data[ $field ] = translate($plugin_data[ $field ], $plugin_data['TextDomain']);
     228    }
     229
     230    //Apply Markup
     231    $plugin_data['Title'] = $plugin_data['Name'];
     232    if ( !empty($plugin_data['PluginURI']) && !empty($plugin_data['Name']) )
     233        $plugin_data['Title'] = '<a href="' . $plugin_data['PluginURI'] . '" title="'.__( 'Visit plugin homepage' ).'">' . $plugin_data['Name'] . '</a>';
     234   
     235    if ( ! empty($plugin_data['AuthorURI']) )
     236        $plugin_data['Author'] = '<a href="' . $plugin_data['AuthorURI'] . '" title="'.__( 'Visit author homepage' ).'">' . $plugin_data['Author'] . '</a>';
     237   
     238    $plugin_data['Description'] = wptexturize( $plugin_data['Description'] );
     239
    219240    // Sanitize all displayed data
    220241    $plugin_data['Title']       = wp_kses($plugin_data['Title'], $plugins_allowedtags);
     
    264285        if( 'active' == $context )
    265286            $action_links[] = '<a href="' . wp_nonce_url('plugins.php?action=deactivate&amp;plugin=' . $plugin_file, 'deactivate-plugin_' . $plugin_file) . '" title="' . __('Deactivate this plugin') . '" class="delete">' . __('Deactivate') . '</a>';
    266         else //Available or Recently deactivated
     287        else //Inactive or Recently deactivated
    267288            $action_links[] = '<a href="' . wp_nonce_url('plugins.php?action=activate&amp;plugin=' . $plugin_file, 'activate-plugin_' . $plugin_file) . '" title="' . __('Activate this plugin') . '" class="edit">' . __('Activate') . '</a>';
    268289
Note: See TracChangeset for help on using the changeset viewer.