Making WordPress.org


Ignore:
Timestamp:
03/29/2016 01:42:45 PM (10 years ago)
Author:
kovshenin
Message:

WordCamp Post Type: Fix notices around WordCamp statuses logging.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/branches/application-tracking/wordcamp.org/public_html/wp-content/plugins/wcpt/wcpt-wordcamp/wordcamp-admin.php

    r2840 r2841  
    649649     */
    650650    public function log_status_changes( $new_status, $old_status, $post ) {
    651         $statues = WordCamp_Loader::get_post_statuses();
    652 
    653         if ( $new_status === $old_status ) {
     651        if ( $new_status === $old_status || $new_status == 'auto-draft' ) {
    654652            return;
    655653        }
     
    658656            return;
    659657        }
     658
     659        $old_status = get_post_status_object( $old_status );
     660        $new_status = get_post_status_object( $new_status );
    660661
    661662        add_post_meta( $post->ID, '_status_change', array(
    662663            'timestamp' => time(),
    663664            'user_id'   => get_current_user_id(),
    664             'message'   => sprintf( '%s -> %s', $statues[ $old_status ], $statues[ $new_status ] ),
     665            'message'   => sprintf( '%s → %s', $old_status->label, $new_status->label ),
    665666        ) );
    666667    }
Note: See TracChangeset for help on using the changeset viewer.