Plugin Directory

Changeset 1324298


Ignore:
Timestamp:
01/08/2016 11:06:18 PM (10 years ago)
Author:
dansod
Message:

added some new hooks

Location:
subscribe-to-category/trunk
Files:
3 edited

Legend:

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

    r1294734 r1324298  
    217217        return $this->notice = $notice;
    218218      }
    219    
    220 
     219     
     220      // hook right before deleting post
     221      do_action( 'stc_before_unsubscribe', $user_id );
     222     
    221223      $subscriber_email = get_the_title( $user_id );
    222224      wp_delete_post( $user_id );
     
    478480        if(!empty( $post_id )){
    479481            $post_id = wp_update_post( $post_data );
     482
     483        // hook after updating a subscriber
     484        do_action( 'stc_after_update_subscriber', $post_id, $data['categories'], $data['all_categories'] == true ? '1' : '0' );
    480485        }else{
    481486            $post_id = wp_insert_post( $post_data );
    482487        update_post_meta( $post_id, '_stc_hash', md5( $data['email'].time() ) );
     488       
     489        // hook after inserting a subscriber
     490        do_action( 'stc_after_insert_subscriber', $post_id, $data['categories'], $data['all_categories'] == true ? '1' : '0' );
    483491        }
    484492
  • subscribe-to-category/trunk/readme.txt

    r1294734 r1324298  
    33Tags: subscribe to post, subscribe to category, subscribe to news, subscribe
    44Requires at least: 3.9
    5 Tested up to: 4.3.1
    6 Stable tag: 1.6.0
     5Tested up to: 4.4.1
     6Stable tag: 1.7.0
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    8383add_action( 'stc_after_message', 'my_stc_after_message', 10, 2 );
    8484
     85// Parameters: $subscriber_post_id, $categories, bool $all_categories
     86add_action( 'stc_after_update_subscriber', 'my_stc_after_update_subscriber', 10, 3 );
     87add_action( 'stc_after_insert_subscriber', 'my_stc_after_insert_subscriber', 10, 3 );
     88
     89// Parameters: $subscriber_post_id,
     90add_action( 'stc_before_unsubscribe', 'my_stc_before_unsubscribe', 10, 1 ); // runs before deleting a subscriber from database
     91
    8592
    8693/**
     
    107114
    108115== Changelog ==
     116
     117= 1.7.0 =
     118* Added some new hooks: stc_after_update_subscriber, stc_after_insert_subscriber, stc_before_unsubscribe
    109119
    110120= 1.6.0 =
  • subscribe-to-category/trunk/subscribe-to-category.php

    r1294734 r1324298  
    44  Plugin URI: http://dcweb.nu
    55  Description: Lets your visitor subscribe to posts for one or several categories.
    6   Version: 1.6.0
     6  Version: 1.7.0
    77  Author: Daniel Söderström
    88  Author URI: http://dcweb.nu/
Note: See TracChangeset for help on using the changeset viewer.