Making WordPress.org

Changeset 1398


Ignore:
Timestamp:
03/13/2015 01:00:33 PM (10 years ago)
Author:
obenland
Message:

WP.org Themes: Update post to also update post_time.

wp_publish_post() only transitions the post status, leaving us with
inacurate post dates of new themes.

See #943.

File:
1 edited

Legend:

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

    r1397 r1398  
    371371        $content = sprintf( __( 'Congratulations, your new theme %1$s is now available to the public at %2$s.', 'wporg-themes' ), $post->post_title, "https://wordpress.org/themes/{$post->post_name}" ) . "\n\n";
    372372
    373         // First time approval: Publish the theme.
    374         wp_publish_post( $post_id );
     373        /*
     374         * First time approval: Publish the theme.
     375         *
     376         * Uses `wp_update_post()` to also update post_time.
     377         */
     378        wp_update_post( array(
     379            'ID'          => $post_id,
     380            'post_status' => 'publish',
     381        ) );
    375382    }
    376383
Note: See TracChangeset for help on using the changeset viewer.