WordPress.org

Making WordPress.org

Changeset 6592


Ignore:
Timestamp:
02/10/2018 03:43:46 PM (21 months ago)
Author:
ocean90
Message:

Plugin Directory: Pass post_date and post_modified to wp_insert_post() when creating a new plugin post.

Prevents an invalid post_modified value due to the Plugin_Directory::filter_wp_insert_post_data() filter.

See #2605.
Fixes #3443.

File:
1 edited

Legend:

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

    r6411 r6592  
    13301330        $slug  = $args['post_name'] ?: sanitize_title( $title );
    13311331
     1332        $post_date     = current_time( 'mysql' );
     1333        $post_date_gmt = current_time( 'mysql', 1 );
     1334
    13321335        $args = wp_parse_args( $args, array(
    13331336            'post_title'        => $title,
    13341337            'post_name'         => $slug,
    13351338            'post_type'         => 'plugin',
    1336             'post_date'         => '',
    1337             'post_date_gmt'     => '',
    1338             'post_modified'     => '',
    1339             'post_modified_gmt' => '',
     1339            'post_date'         => $post_date,
     1340            'post_date_gmt'     => $post_date_gmt,
     1341            'post_modified'     => $post_date,
     1342            'post_modified_gmt' => $post_date_gmt,
    13401343        ) );
    13411344
Note: See TracChangeset for help on using the changeset viewer.