Changeset 1234449
- Timestamp:
- 08/31/2015 07:50:47 AM (11 years ago)
- Location:
- subscribe-to-category/trunk
- Files:
-
- 2 added
- 3 edited
-
classes/class-subscribe.php (modified) (4 diffs)
-
languages/stc_textdomain-lt_LT.mo (added)
-
languages/stc_textdomain-lt_LT.po (added)
-
readme.txt (modified) (4 diffs)
-
subscribe-to-category.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
subscribe-to-category/trunk/classes/class-subscribe.php
r1205558 r1234449 77 77 78 78 // adding checkbox to publish meta box if activated 79 if( $this->settings['resend_option'] == 1 )79 if( isset( $this->settings['resend_option'] ) && $this->settings['resend_option'] == 1 ) 80 80 add_action( 'post_submitbox_misc_actions', array( $this, 'resend_post_option' ) ); 81 81 … … 946 946 $subject = '=?UTF-8?B?'.base64_encode( $email_subject ).'?='; 947 947 948 wp_mail( $email['email'], $subject, $message, $headers ); 948 949 if( STC_DEV_MODE === true ){ 950 echo $subject . '<br>' . $message; 951 die(); 952 }else{ 953 wp_mail( $email['email'], $subject, $message, $headers ); 954 } 955 949 956 950 957 // sleep 2 seconds once every 25 email to prevent blacklisting … … 995 1002 */ 996 1003 private function email_html_content( $email ){ 1004 $sum_of_words = 130; 1005 1006 $output['title'] = '<h3><a href="' . get_permalink( $email['post_id'] ) . '">' . $email['post']->post_title . '</a></h3>'; 1007 $output['link_to_post'] = '<div style="border-bottom: 1px solid #cccccc; padding-bottom: 10px;"><a href="' . get_permalink( $email['post_id'] ) .'">' . __('Click here to read full story', STC_TEXTDOMAIN ) . '</a></div>'; 1008 $output['unsubscribe'] = '<div style="margin-top: 20px;"><a href="' . get_bloginfo('url') . '/?stc_unsubscribe=' . $email['hash'] . '&stc_user=' . $email['email'] . '">' . __('Unsubscribe me', STC_TEXTDOMAIN ) . '</a></div>'; 1009 997 1010 ?> 998 <h3><a href="<?php echo get_permalink( $email['post_id']) ?>"><?php echo $email['post']->post_title; ?></a></h3> 999 <div><?php echo apply_filters('the_content', $this->string_cut( $email['post']->post_content, 130 ) );?></div> 1000 <div style="border-bottom: 1px solid #cccccc; padding-bottom: 10px;"><a href="<?php echo get_permalink( $email['post_id'] ); ?>"> <?php _e('Click here to read full story', STC_TEXTDOMAIN ); ?></a></div> 1001 <div style="margin-top: 20px;"><a href="<?php echo get_bloginfo('url') . '/?stc_unsubscribe=' . $email['hash'] . '&stc_user=' . $email['email']; ?>"><?php _e('Unsubscribe me', STC_TEXTDOMAIN ); ?></a></div> 1011 <?php do_action( 'stc_before_message', $email['post_id'], $email['subscriber_id'] ); ?> 1012 1013 <?php do_action( 'stc_before_message_title', $email['post_id'], $email['subscriber_id'] ); ?> 1014 <?php echo apply_filters( 'stc_message_title_html', $output['title'], $email['post_id'], $email['subscriber_id'] ); ?> 1015 <?php do_action( 'stc_after_message_title', $email['post_id'], $email['subscriber_id'] ); ?> 1016 1017 <?php do_action( 'stc_before_message_content', $email['post_id'], $email['subscriber_id'] ); ?> 1018 <div><?php echo apply_filters('the_content', $this->string_cut( $email['post']->post_content, apply_filters( 'stc_message_length_sum_of_words', $sum_of_words ) ) );?></div> 1019 <?php do_action( 'stc_after_message_content', $email['post_id'], $email['subscriber_id'] ); ?> 1020 1021 <?php echo apply_filters( 'stc_message_link_to_post_html', $output['link_to_post'] ); ?> 1022 <?php echo apply_filters( 'stc_message_unsubscribe_html', $output['unsubscribe'] ); ?> 1023 1024 <?php do_action( 'stc_after_message', $email['post_id'], $email['subscriber_id'] ); ?> 1025 1002 1026 <?php 1003 1027 } … … 1013 1037 * @return string 1014 1038 */ 1015 private function string_cut( $string, $max_length ){ 1039 private function string_cut( $string, $max_length ){ 1040 1041 if( $max_length < 0 ) 1042 return $string; 1016 1043 1017 1044 // remove shortcode if there is -
subscribe-to-category/trunk/readme.txt
r1205558 r1234449 3 3 Tags: subscribe to post, subscribe to category, subscribe to news, subscribe 4 4 Requires at least: 3.9 5 Tested up to: 4. 2.36 Stable tag: 1. 2.15 Tested up to: 4.3 6 Stable tag: 1.3 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 35 35 * French 36 36 * Italian 37 * Lithuanian 37 38 * Russian 38 39 * Spanish … … 56 57 For both attributes you can use a comma sign to separate multiple categories, like [stc-subscribe category_in="news, article"]. 57 58 59 = Filter and hooks = 60 Following filters and hooks can be used for customizing the email message. 61 62 `<?php 63 // FILTERS 64 // Parameters: $value 65 add_filter( 'stc_message_length_sum_of_words', 'stc_message_length_sum_of_words', 10, 1 ); //set return value to a negative number to show the full content 66 67 68 // Parameters: $value, $post_id, $subscriber_post_id 69 add_filter( 'stc_message_title_html', 'my_stc_message_title_html', 10, 3 ); 70 add_filter( 'stc_message_link_to_post_html', 'my_stc_message_link_to_post_html', 10, 3 ); 71 add_filter( 'stc_message_unsubscribe_html', 'my_stc_message_unsubscribe_html', 10, 3 ); 72 73 // HOOKS 74 // Parameters: $post_id, $subscriber_post_id 75 add_action( 'stc_before_message', 'my_stc_before_message', 10, 2 ); 76 add_action( 'stc_before_message_title', 'my_stc_before_message_title', 10, 2 ); 77 add_action( 'stc_after_message_title', 'my_stc_after_message_title', 10, 2 ); 78 add_action( 'stc_before_message_content', 'my_stc_before_message_content', 10, 2 ); 79 add_action( 'stc_after_message_content', 'my_stc_after_message_content', 10, 2 ); 80 add_action( 'stc_after_message', 'my_stc_after_message', 10, 2 ); 81 82 83 /** 84 * Example for adding featured image to STC email 85 */ 86 function my_stc_after_message_title( $post_id ){ 87 echo get_the_post_thumbnail( $post_id, 'thumbnail' ); 88 } 89 add_action( 'stc_after_message_title', 'my_stc_after_message_title', 10, 2 ); 90 91 ?>` 92 93 58 94 = Optionally but recommended = 59 95 As Wordpress Cron is depending on that you have visits on your website you should set up a cron job on your server to hit http://yourdomain.com/wp-cron.php at a regular interval to make sure that WP Cron is running as expected. In current version of Subscribe to Category the WP Cron is running once every hour, that might be an option that is changeable in future versions. … … 68 104 69 105 == Changelog == 106 107 = 1.3 = 108 * Added hooks and filters to make the plugin extensible 109 * Added Lithuanian language thanks to Claudio 70 110 71 111 = 1.2.1 = -
subscribe-to-category/trunk/subscribe-to-category.php
r1205565 r1234449 4 4 Plugin URI: http://dcweb.nu 5 5 Description: Lets your visitor subscribe to posts for one or several categories. 6 Version: 1. 2.16 Version: 1.3 7 7 Author: Daniel Söderström 8 8 Author URI: http://dcweb.nu/ … … 18 18 define( 'STC_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); 19 19 define( 'STC_PLUGIN_PATH', dirname( __FILE__ ) ); 20 define( 'STC_DEV_MODE', false ); // set to true email is printed out on setting page and will not be sent. 20 21 21 22 require_once( 'classes/class-main.php' );
Note: See TracChangeset
for help on using the changeset viewer.