Making WordPress.org


Ignore:
Timestamp:
06/11/2014 08:13:51 PM (12 years ago)
Author:
iandunn
Message:

WordCamp Organizer Reminders: Switch to new wcpt_added_to_final_schedule action.

r691 introduced canonical actions for WordCamp status changes, so this no longer needs to be aware of and verify
the post type, status, etc.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-organizer-reminders/wcor-mailer.php

    r690 r692  
    1414                $this->triggers = array(
    1515                        'wcor_added_to_schedule' => array(
    16                                 'name'     => 'WordCamp Added to schedule',
     16                                'name'     => 'WordCamp Added to final schedule',
    1717                                'actions'  => array(
    1818                                        array(
    19                                                 'name'       => 'transition_post_status',
     19                                                'name'       => 'wcpt_added_to_final_schedule',
    2020                                                'callback'   => 'send_trigger_added_to_schedule',
    2121                                                'priority'   => 10,
    22                                                 'parameters' => 3,
     22                                                'parameters' => 1,
    2323                                        ),
    2424                                ),
     
    404404         * Sends e-mails hooked to the wcor_added_to_schedule trigger.
    405405         *
    406          * This fires when a WordCamp is added to the schedule (i.e., when their `wordcamp` post goes from 'draft' to 'publish').
    407          *
    408          * @param string  $new_status
    409          * @param string  $old_status
    410          * @param WP_Post $wordcamp
    411          */
    412         public function send_trigger_added_to_schedule( $new_status, $old_status, $wordcamp ) {
    413                 if ( empty( $wordcamp->post_type ) || WCPT_POST_TYPE_ID != $wordcamp->post_type ) {
    414                         return;
    415                 }
    416 
    417                 if ( 'pending' != $old_status || 'publish' != $new_status ) {
    418                         return;
    419                 }
    420 
     406         * This fires when a WordCamp is added to the final schedule.
     407         *
     408         * @param WP_Post $wordcamp
     409         */
     410        public function send_trigger_added_to_schedule( $wordcamp ) {
    421411                $this->send_triggered_emails( $wordcamp, 'wcor_added_to_schedule' );
    422412        }
Note: See TracChangeset for help on using the changeset viewer.