public

class.email-post-changes.php.diff

  • Download Gist
class.email-post-changes.php.diff
Diff
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
33d32
< 'post_ids' => array(),
182,198d180
< $options = $this->get_options();
< $ids = explode(",", $options['post_ids']);
<
< if (in_array($this->right_post->ID, $ids)){
<
< // Send email
< $charset = apply_filters( 'wp_mail_charset', get_option( 'blog_charset' ) );
< $blogname = html_entity_decode( get_option( 'blogname' ), ENT_QUOTES, $charset );
< $title = html_entity_decode( $the_title, ENT_QUOTES, $charset );
<
< add_action( 'phpmailer_init', array( &$this, 'phpmailer_init_once' ) );
<
< wp_mail(
< null, // see hack in ::phpmailer_init_once()
< sprintf( __( '[%s] %s changed: %s' ), $blogname, $post_type, $title ),
< $html_diff
< );
200,202c182,193
< do_action( 'email_post_changes_email_sent' );
<
< } else {
---
> // Send email
> $charset = apply_filters( 'wp_mail_charset', get_option( 'blog_charset' ) );
> $blogname = html_entity_decode( get_option( 'blogname' ), ENT_QUOTES, $charset );
> $title = html_entity_decode( $the_title, ENT_QUOTES, $charset );
>
> add_action( 'phpmailer_init', array( &$this, 'phpmailer_init_once' ) );
>
> wp_mail(
> null, // see hack in ::phpmailer_init_once()
> sprintf( __( '[%s] %s changed: %s' ), $blogname, $post_type, $title ),
> $html_diff
> );
204,206c195
< return;
<
< }
---
> do_action( 'email_post_changes_email_sent' );
267d255
< add_settings_field( self::ADMIN_PAGE . '_post_ids', __( 'Post IDs' ), array( &$this, 'post_ids_setting' ), self::ADMIN_PAGE, self::ADMIN_PAGE );
315,316d302
< $return['post_ids'] = $options['post_ids'];
<
403,411d388
< function post_ids_setting() {
< $options = $this->get_options();
< ?>
< <input type="text" style="width: 40em;" name="email_post_changes[post_ids]" value="<?php echo $options['post_ids']; ?>" />
< <p class="description"><?php _e( 'Comma separated list of Post/Page IDs' ); ?></p>
<
< <?php
< }
<
455a433
>

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.