Making WordPress.org


Ignore:
Timestamp:
02/26/2018 10:41:18 PM (9 years ago)
Author:
iandunn
Message:

Email Post Changes Specific Post: Apply coding standards.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/email-post-changes-specific-post/email-post-changes-specific-post.php

    r108 r6776  
    55Description: Extends the Email Post Changes plugin to allow visitors to subscribe to a specific post/page
    66Version:     0.1
    7 Author:      Ian Dunn
     7Author:      WordPress Meta Team
    88*/
    99
    1010class EPCSpecificPost {
    11        
    1211        /**
    1312         * Constructor
    … …  
    2928        /**
    3029         * Override EPC's default options
    31          * 
     30         *
    3231         * @param  array $options
    3332         * @return array
    … …  
    3736                 * EPC assumes you always want to e-mail the admin, and will always include the admin_email in the 'Additional Email Addresses' field,
    3837                 * even if you submit an empty value, so emptying the default value works around that.
    39                  */ 
     38                 */
    4039                $options['emails']     = array();
    4140                $options['post_types'] = array( 'page' );
    42                
     41
    4342                return $options;
    4443        }
    … …  
    4746         * Inserts extra email addresses into the list of recipients
    4847         * When EPC is crafting a new notification, this method adds all of the addresses we've collected to it
    49          * 
    50          * @param  array $emails The list of addresses that EPC has collected
     48         *
     49         * @param  array $emails The list of addresses that EPC has collected.
    5150         * @param  int   $old_post_id
    5251         * @param  int   $new_post_id
    … …  
    5554        public function insert_subscribed_emails( $emails, $old_post_id, $new_post_id ) {
    5655                $subscribed_emails = get_option( 'epcsp_subscribed_addresses', array() );
    57                
     56
    5857                if ( isset( $subscribed_emails[ $old_post_id ] ) && is_array( $subscribed_emails[ $old_post_id ] ) ) {
    5958                        $emails = array_merge( $emails, $subscribed_emails[ $old_post_id ] );
    6059                        $emails = array_unique( $emails );
    6160                }
    62                
     61
    6362                return $emails;
    6463        }
    … …  
    6665
    6766require_once( __DIR__ . '/widget-subscribe.php' );
     67
    6868$GLOBALS['EPCSpecificPost'] = new EPCSpecificPost();
Note: See TracChangeset for help on using the changeset viewer.