WordPress.org

Making WordPress.org

Changeset 2837


Ignore:
Timestamp:
03/28/2016 10:55:40 PM (3 years ago)
Author:
iandunn
Message:

WordCamp Post Type: Show status name instead of slug in new WordCamp log entry.

Location:
sites/branches/application-tracking/wordcamp.org/public_html/wp-content/plugins/wcpt
Files:
2 edited

Legend:

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

    r2832 r2837  
    4848    if ( isset( $_POST['submit-application'] ) ) {
    4949        create_wordcamp_post( validate_data( $_POST ) );
    50         // todo send a notification email to central?
     50        // todo email applicant a copy of application w/ the thank you message - just fire trigger and let organizer reminder send it? but how to attach org data? new placeholder?
    5151        $message = "Thank you for your application! We've received it, and we'll contact you once we've had a chance to review it."; // todo run by andrea
    5252
     
    156156function create_wordcamp_post( $data ) {
    157157    // Create the post
    158     $user = wcorg_get_user_by_canonical_names( $data['q_4236565_wporg_username'] );
     158    $user    = wcorg_get_user_by_canonical_names( $data['q_4236565_wporg_username'] );
     159    $statues = \WordCamp_Loader::get_post_statuses();
    159160
    160161    $post = array(
     
    197198    add_post_meta( $post_id, '_status_change', array(
    198199        'timestamp' => time(),
    199         'user_id'   => $user->ID,
    200         'message'   => sprintf( '%s -> %s', 'Application', 'Draft' ), /// todo use get_status_name() when it's ready    // todo update with new default status
     200        'user_id'   => $user->ID,   // todo check if WP_User first
     201        'message'   => sprintf( '%s -> %s', 'Application', $statues[ WCPT_DEFAULT_STATUS ] ),
    201202    ) );
    202203
  • sites/branches/application-tracking/wordcamp.org/public_html/wp-content/plugins/wcpt/wcpt-functions.php

    r2784 r2837  
    106106function wcpt_get_log_entries( $wordcamp_id ) {
    107107    $entries        = array();
    108     $notes          = get_post_meta( $wordcamp_id, '_note'          );  // todo better key name?
    109     $status_changes = get_post_meta( $wordcamp_id, '_status_change' );  // todo better key name? if yes, update get_last_status_update_time_diff too
     108    $notes          = get_post_meta( $wordcamp_id, '_note'          );
     109    $status_changes = get_post_meta( $wordcamp_id, '_status_change' );
    110110
    111111    foreach ( array( 'note' => $notes, 'status_change' => $status_changes ) as $entry_type => $raw_entries ) {
Note: See TracChangeset for help on using the changeset viewer.