WordPress.org

Making WordPress.org

Changeset 3222


Ignore:
Timestamp:
05/23/2016 10:28:15 PM (6 years ago)
Author:
obenland
Message:

Plugin Directory: Return shortcode content rather than displaying it.

Give the shortcode handler the chance to insert the content at the right position.

See #1719, [3219].

File:
1 edited

Legend:

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

    r3220 r3222  
    1616        $post       = get_post();
    1717        $committers = Tools::get_plugin_committers( $post->post_name );
    18     ?>
    19         <ul class="plugin-developers">
    2018
    21         <?php
    22             foreach ( $committers as $committer_slug ) :
    23                 $committer = get_user_by( 'slug', $committer_slug );
    24         ?>
    25             <li><?php echo get_avatar( $committer->ID, 32 ) . $committer->display_name; ?></li>
    26         <?php endforeach; ?>
     19        $output = '<ul class="plugin-developers">';
     20        foreach ( $committers as $committer_slug ) {
     21            $committer = get_user_by( 'slug', $committer_slug );
    2722
    28         </ul>
     23            $output .= '<li>' . get_avatar( $committer->ID, 32 ) . $committer->display_name . '</li>';
     24        }
     25        $output .= '</ul>';
    2926
    30         <h5><?php _e( 'Browse the code', 'wporg-plugins' ); ?></h5>
    31         <ul>
    32             <li>
    33                 <a href="<?php echo esc_url( "https://plugins.trac.wordpress.org/log/{$post->post_name}/" ); ?>" rel="nofollow"><?php _e( 'Development Log', 'wporg-plugins' ); ?></a>
    34                 <a href="<?php echo esc_url( "https://plugins.trac.wordpress.org/log/{$post->post_name}/?limit=100&mode=stop_on_copy&format=rss" ); ?>" rel="nofollow"><img src="//s.w.org/style/images/feedicon.png" /></a>
    35             </li>
    36             <li><a href="<?php echo esc_url( "https://plugins.svn.wordpress.org/{$post->post_name}/" ); ?>" rel="nofollow"><?php _e( 'Subversion Repository', 'wporg-plugins' ); ?></a></li>
    37             <li><a href="<?php echo esc_url( "https://plugins.trac.wordpress.org/browser/{$post->post_name}/" ); ?>" rel="nofollow"><?php _e( 'Browse in Trac', 'wporg-plugins' ); ?></a></li>
    38             <li><a href="<?php echo esc_url( "https://translate.wordpress.org/projects/wp-plugins/{$post->post_name}/" ); ?>" rel="nofollow"><?php _e( 'Translation Contributors', 'wporg-plugins' ); ?></a></li>
    39         </ul>
    40     <?php
     27        return $output .
     28            '<h5>' . __( 'Browse the code', 'wporg-plugins' ) . '</h5>' .
     29            '<ul>' .
     30                '<li>' .
     31                    '<a href="' . esc_url( "https://plugins.trac.wordpress.org/log/{$post->post_name}/" ) . '" rel="nofollow">' . __( 'Development Log', 'wporg-plugins' ) . '</a>' . "\n" .
     32                    '<a href="' . esc_url( "https://plugins.trac.wordpress.org/log/{$post->post_name}/?limit=100&mode=stop_on_copy&format=rss" ) . '" rel="nofollow"><img src="//s.w.org/style/images/feedicon.png" /></a>' .
     33                '</li>' .
     34                '<li><a href="' . esc_url( "https://plugins.svn.wordpress.org/{$post->post_name}/" ) . '" rel="nofollow">' . __( 'Subversion Repository', 'wporg-plugins' ) . '</a></li>' .
     35                '<li><a href="' . esc_url( "https://plugins.trac.wordpress.org/browser/{$post->post_name}/" ) . '" rel="nofollow">' . __( 'Browse in Trac', 'wporg-plugins' ) . '</a></li>' .
     36                '<li><a href="' . esc_url( "https://translate.wordpress.org/projects/wp-plugins/{$post->post_name}/" ) . '" rel="nofollow">' . __( 'Translation Contributors', 'wporg-plugins' ) . '</a></li>' .
     37            '</ul>';
    4138    }
    4239}
Note: See TracChangeset for help on using the changeset viewer.