Making WordPress.org


Ignore:
Timestamp:
04/19/2016 08:09:35 PM (9 years ago)
Author:
obenland
Message:

Plugin Directory: Add meta data on plugin submission.

Adds readme meta data to the plugin post after uploading a new plugin.

See #1570, #1571.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/metabox/class-custom-fields.php

    r2655 r2983  
    99class Custom_Fields {
    1010    static function display() {
    11         $post = get_post();
     11        $post   = get_post();
    1212        $fields = array(
    1313            'version' => 'Latest Plugin Version',
     
    2222            'header_description' => 'Plugin Description',
    2323        );
     24
    2425        echo '<dl>';
    2526        foreach ( $fields as $field => $text ) {
    26             if ( ! ($value = get_post_meta( $post->ID, $field, true ) ) ) {
     27            if ( ! $value = get_post_meta( $post->ID, $field, true ) ) {
    2728                continue;
    2829            }
    2930            printf( '<dt>%s</dt><dd>%s</dd>', esc_html( $text ), make_clickable( esc_html( $value ) ) );
    3031        }
    31         // Description is stored in the post_excerpt rather than meta
    32         printf( '<dt>%s</dt><dd>%s</dd>', esc_html( $fields['header_description'] ), get_the_excerpt() );
    3332        echo '</dl>';
    3433    }
Note: See TracChangeset for help on using the changeset viewer.