Changeset 1205558
- Timestamp:
- 07/24/2015 08:52:58 AM (11 years ago)
- Location:
- subscribe-to-category/trunk
- Files:
-
- 4 added
- 2 deleted
- 2 edited
-
classes/class-subscribe.php (modified) (6 diffs)
-
languages/stc_textdomain-it_IT.mo (added)
-
languages/stc_textdomain-it_IT.po (added)
-
languages/stc_textdomain-ru.mo (deleted)
-
languages/stc_textdomain-ru.po (deleted)
-
languages/stc_textdomain-ru_RU.mo (added)
-
languages/stc_textdomain-ru_RU.po (added)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
subscribe-to-category/trunk/classes/class-subscribe.php
r1061089 r1205558 246 246 return false; 247 247 248 // only trigger this from admin 249 if( !isset( $_POST['post_type'] ) ) 250 return false; 251 248 252 // exit if not post type post 249 if( $_POST['post_type'] != 'post' )253 if( isset( $_POST['post_type'] ) && $_POST['post_type'] != 'post' ) 250 254 return false; 251 255 … … 255 259 256 260 // if our current user can't edit this post, bail 257 if( !current_user_can( 'edit_post' ) )261 if( !current_user_can( 'edit_post', $post_id ) ) 258 262 return false; 259 263 … … 503 507 504 508 // only trigger this from admin 505 if( $_POST['post_type'] != 'stc' ) 509 if( !isset( $_POST['post_type'] ) ) 510 return false; 511 512 if( isset( $_POST['post_type'] ) && $_POST['post_type'] != 'stc' ) 506 513 return false; 507 514 … … 511 518 512 519 // if our current user can't edit this post, bail 513 if( !current_user_can( 'edit_post' ) )520 if( !current_user_can( 'edit_post', $post_id ) ) 514 521 return false; 515 522 … … 517 524 $categories = get_categories( array('hide_empty' => false )); 518 525 $sum_of_categories = count( $categories ); 519 $sum_of_post_categories = count( $_POST['post_category'] ) - 1; // wp sets a dummy item in post_category, therefore -1 520 526 527 if(isset( $_POST['post_category'] ) ) 528 $sum_of_post_categories = count( $_POST['post_category'] ) - 1; // wp sets a dummy item in post_category, therefore -1 521 529 522 530 // sanitize input 523 $email = sanitize_email( $_POST['post_title'] ); 531 if(isset( $_POST['post_title'] ) ) 532 $email = sanitize_email( $_POST['post_title'] ); 524 533 525 534 // is email valid 535 $post_id_match = ''; 526 536 if(! is_email( $email ) ){ 527 537 set_transient( 'error', __( 'You need to enter a valid email address', STC_TEXTDOMAIN ) ); // set error if not valid … … 939 949 940 950 // sleep 2 seconds once every 25 email to prevent blacklisting 941 if( $i == $ sleep_flag ){951 if( $i == $this->sleep_flag ){ 942 952 sleep(2); // sleep for two seconds, then proceed 943 953 $i = 1; // reset loop counter -
subscribe-to-category/trunk/readme.txt
r1119136 r1205558 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. 16 Stable tag: 1.2. 05 Tested up to: 4.2.3 6 Stable tag: 1.2.1 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 34 34 * English 35 35 * French 36 * Italian 36 37 * Russian 37 38 * Spanish … … 68 69 == Changelog == 69 70 71 = 1.2.1 = 72 * Fixed some undefined variables that might have caused some errors for some environments 73 * Renamed language files for russian language to correct syntax 74 * Added Italian language thanks to Claudio 75 70 76 = 1.2.0 = 71 77 * Possibillity to re-send a post on update that has already been sent. This option needs to be activated in the settings for the plugin.
Note: See TracChangeset
for help on using the changeset viewer.