Plugin Directory

Changeset 1205558


Ignore:
Timestamp:
07/24/2015 08:52:58 AM (11 years ago)
Author:
dansod
Message:

Some minor changes like undefined variables fix, added italian language

Location:
subscribe-to-category/trunk
Files:
4 added
2 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • subscribe-to-category/trunk/classes/class-subscribe.php

    r1061089 r1205558  
    246246        return false;
    247247
     248      // only trigger this from admin
     249      if( !isset( $_POST['post_type'] ) )
     250        return false;
     251
    248252      // exit if not post type post
    249       if( $_POST['post_type'] != 'post' )
     253      if( isset( $_POST['post_type'] ) && $_POST['post_type'] != 'post' )
    250254        return false;
    251255
     
    255259
    256260      // 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 ) )
    258262        return false; 
    259263
     
    503507
    504508      // 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' )
    506513        return false;
    507514
     
    511518
    512519      // 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 ) )
    514521        return false; 
    515522
     
    517524      $categories = get_categories( array('hide_empty' => false ));
    518525      $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
    521529
    522530      // sanitize input
    523       $email = sanitize_email( $_POST['post_title'] );
     531      if(isset( $_POST['post_title'] ) )
     532        $email = sanitize_email( $_POST['post_title'] );
    524533
    525534      // is email valid
     535      $post_id_match = '';
    526536      if(! is_email( $email ) ){
    527537        set_transient( 'error', __( 'You need to enter a valid email address', STC_TEXTDOMAIN ) ); // set error if not valid
     
    939949
    940950        // sleep 2 seconds once every 25 email to prevent blacklisting
    941         if( $i == $sleep_flag ){
     951        if( $i == $this->sleep_flag ){
    942952          sleep(2); // sleep for two seconds, then proceed
    943953          $i = 1; // reset loop counter
  • subscribe-to-category/trunk/readme.txt

    r1119136 r1205558  
    33Tags: subscribe to post, subscribe to category, subscribe to news, subscribe
    44Requires at least: 3.9
    5 Tested up to: 4.1
    6 Stable tag: 1.2.0
     5Tested up to: 4.2.3
     6Stable tag: 1.2.1
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    3434* English
    3535* French
     36* Italian
    3637* Russian
    3738* Spanish
     
    6869== Changelog ==
    6970
     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
    7076= 1.2.0 =
    7177* 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.