Making WordPress.org


Ignore:
Timestamp:
02/03/2016 10:52:41 PM (10 years ago)
Author:
obenland
Message:

W.org Themes: Be more verbose in checking for previous meta values.

The bug fix introduced in [1387] caused every theme to have a version 0.

File:
1 edited

Legend:

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

    r2189 r2456  
    268268 */
    269269function wporg_themes_update_version_status( $post_id, $current_version, $new_status ) {
    270     $meta       = (array) get_post_meta( $post_id, '_status', true );
    271     $old_status = isset( $meta[ $current_version ] ) ? $meta[ $current_version ] : false;
     270    $meta = get_post_meta( $post_id, '_status', true );
     271
     272    if ( empty( $meta ) ) {
     273        $meta = array();
     274        $old_status = false;
     275    } else {
     276        $old_status = $meta[ $current_version ];
     277    }
    272278
    273279    // Don't do anything when the status hasn't changed.
Note: See TracChangeset for help on using the changeset viewer.