Changeset 6776 for sites/trunk/wordcamp.org/public_html/wp-content/plugins/email-post-changes-specific-post/email-post-changes-specific-post.php
- Timestamp:
- 02/26/2018 10:41:18 PM (8 years ago)
- 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 5 5 Description: Extends the Email Post Changes plugin to allow visitors to subscribe to a specific post/page 6 6 Version: 0.1 7 Author: Ian Dunn7 Author: WordPress Meta Team 8 8 */ 9 9 10 10 class EPCSpecificPost { 11 12 11 /** 13 12 * Constructor … … 29 28 /** 30 29 * Override EPC's default options 31 * 30 * 32 31 * @param array $options 33 32 * @return array … … 37 36 * EPC assumes you always want to e-mail the admin, and will always include the admin_email in the 'Additional Email Addresses' field, 38 37 * even if you submit an empty value, so emptying the default value works around that. 39 */ 38 */ 40 39 $options['emails'] = array(); 41 40 $options['post_types'] = array( 'page' ); 42 41 43 42 return $options; 44 43 } … … 47 46 * Inserts extra email addresses into the list of recipients 48 47 * 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. 51 50 * @param int $old_post_id 52 51 * @param int $new_post_id … … 55 54 public function insert_subscribed_emails( $emails, $old_post_id, $new_post_id ) { 56 55 $subscribed_emails = get_option( 'epcsp_subscribed_addresses', array() ); 57 56 58 57 if ( isset( $subscribed_emails[ $old_post_id ] ) && is_array( $subscribed_emails[ $old_post_id ] ) ) { 59 58 $emails = array_merge( $emails, $subscribed_emails[ $old_post_id ] ); 60 59 $emails = array_unique( $emails ); 61 60 } 62 61 63 62 return $emails; 64 63 } … … 66 65 67 66 require_once( __DIR__ . '/widget-subscribe.php' ); 67 68 68 $GLOBALS['EPCSpecificPost'] = new EPCSpecificPost();
Note: See TracChangeset
for help on using the changeset viewer.