Advertisement
Guest User

Edit Flow / Include post in email notification

a guest
Aug 6th, 2012
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.13 KB | None | 0 0
  1. 46,47c46
  2. <                       'always_notify_admin' => 'off',
  3. <                       'include_post' => 'on',
  4. ---
  5. >                               'always_notify_admin' => 'off',
  6. 406a406
  7. >                       $body .= sprintf( __( 'Author: %1$s (%2$s)', 'edit-flow' ), $post_author->display_name, $post_author->user_email ) . "\r\n";
  8. 408,415d407
  9. <                       if( 'on' == $this->module->options->include_post ) {
  10. <                       $content = get_post($post->ID);
  11. <                       $body .= sprintf( __( 'Author: %1$s (%2$s)', 'edit-flow' ), $post_author->display_name, $post_author->user_email ) . "\r\n\r\n";
  12. <                       $body .= sprintf( __( 'Summary: %s', 'edit-flow' ), $content->post_content ) . "\r\n\r\n\r\n";
  13. <                       } else {
  14. <                         $body .= sprintf( __( 'Author: %1$s (%2$s)', 'edit-flow' ), $post_author->display_name, $post_author->user_email ) . "\r\n";
  15. <                       }              
  16. <      
  17. 900d891
  18. <                       add_settings_field( 'include_post', __( 'Send post in notification', 'edit-flow' ), array( $this, 'settings_include_post_option'), $this->module->options_group_name, $this->module->options_group_name . '_general' );
  19. 932,951d922
  20. <         /**
  21. <          * Option for whether the email notification should include the post content or not
  22. <          *
  23. <          * @since 0.7.4
  24. <          */
  25. <         function settings_include_post_option() {
  26. <                 $options = array(
  27. <                         'off' => __( 'Disabled', 'edit-flow' ),
  28. <                         'on' => __( 'Enabled', 'edit-flow' ),
  29. <                 );
  30. <                 echo '<select id="include_post" name="' . $this->module->options_group_name . '[include_post]">';
  31. <                 foreach ( $options as $value => $label ) {
  32. <                         echo '<option value="' . esc_attr( $value ) . '"';
  33. <                         echo selected( $this->module->options->include_post, $value );
  34. <                         echo '>' . esc_html( $label ) . '</option>';
  35. <                 }
  36. <                 echo '</select>';
  37. <         }
  38. <
  39. <
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement