Making WordPress.org

Changeset 7733


Ignore:
Timestamp:
10/16/2018 05:09:51 PM (8 years ago)
Author:
vedjain
Message:

WordCamp: Add log with with timestamp when status is changed.

This will allow us to query status changes within a given timeperiod. Also minor fixes in meetup public status list and meta keys.

Location:
sites/trunk/wordcamp.org/public_html/wp-content/plugins/wcpt
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wcpt/wcpt-event/class-event-admin.php

    r7640 r7733  
    263263                $new_status = get_post_status_object( $new_status );
    264264
    265                 add_post_meta(
     265                $log_id = add_post_meta(
    266266                        $post->ID, '_status_change', array(
    267267                                'timestamp' => time(),
     
    270270                        )
    271271                );
    272         }
    273 
     272                // Encoding $post_type and status_change meta ID in key so that we can fetch it if needed while simultaneously be able to have a where clause on value
     273                // Because of the way MySQL works, it will still be able to use index on meta_key when searching, as long as we are querying just the prefix
     274                if ( $log_id ) {
     275                        add_post_meta( $post->ID, "_status_change_log_$post->post_type $log_id", time() );
     276                }
     277        }
    274278
    275279        /**
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wcpt/wcpt-meetup/class-meetup-admin.php

    r7692 r7733  
    660660
    661661                /**
     662                 * List of meta keys that can be exposed publicly.
     663                 *
     664                 * @return array
     665                 */
     666                public static function get_public_meta_keys() {
     667                        return array(
     668                                'Meetup URL',
     669                                'Meetup Location (From meetup.com)',
     670                                'Last meetup on',
     671                        );
     672                }
     673
     674                /**
    662675                 * Schedule cron job for updating data from meetup API
    663676                 */
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wcpt/wcpt-meetup/class-meetup-application.php

    r7653 r7733  
    7575         */
    7676        public static function get_public_post_statuses() {
    77                 return array( 'wcpt-mtp-nds-swag', 'wcpt-mtp-active', 'wcpt-mtp-dormant' );
     77                return array( 'wcpt-mtp-nds-vet', 'wcpt-mtp-active', 'wcpt-mtp-dormant' );
    7878        }
    7979
Note: See TracChangeset for help on using the changeset viewer.