WordPress.org

Making WordPress.org

Changeset 3188


Ignore:
Timestamp:
05/20/2016 04:04:40 AM (4 years ago)
Author:
dd32
Message:

Plugin Directory: Allow the post date to be specified.
See #1584

File:
1 edited

Legend:

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

    r3184 r3188  
    599599        $desc    = ! empty( $plugin_info['description'] ) ? $plugin_info['description'] : '';
    600600        $content = ! empty( $plugin_info['content'] )     ? $plugin_info['content']     : '';
    601         $tags    = ! empty( $plugin_info['tags'] )        ? $plugin_info['tags']        : array();
    602601        $meta    = ! empty( $plugin_info['meta'] )        ? $plugin_info['meta']        : array();
     602
     603        $post_date         = ! empty( $plugin_info['post_date'] )         ? $plugin_info['post_date']         : '';
     604        $post_date_gmt     = ! empty( $plugin_info['post_date_gmt'] )     ? $plugin_info['post_date_gmt']     : '';
     605        $post_modified     = ! empty( $plugin_info['post_modified'] )     ? $plugin_info['post_modified']     : '';
     606        $post_modified_gmt = ! empty( $plugin_info['post_modified_gmt'] ) ? $plugin_info['post_modified_gmt'] : '';
    603607
    604608        $id = wp_insert_post( array(
     
    610614            'post_content' => $content,
    611615            'post_excerpt' => $desc,
    612             'tags_input'   => $tags,
    613616            'meta_input'   => $meta,
     617            'post_date'         => $post_date,
     618            'post_date_gmt'     => $post_date_gmt,
     619            'post_modified'     => $post_modified,
     620            'post_modified_gmt' => $post_modified_gmt,
    614621        ), true );
    615622
Note: See TracChangeset for help on using the changeset viewer.