Skip to content

Instantly share code, notes, and snippets.

@bappi-d-great
Created February 4, 2015 09:53
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bappi-d-great/5b15dedaac081840c62b to your computer and use it in GitHub Desktop.
Save bappi-d-great/5b15dedaac081840c62b to your computer and use it in GitHub Desktop.
User Registration to Subscription (wpmu)
<?php
/*
Plugin Name: User Registration to Subscription (wpmu)
Plugin URI: http://bappi-d-great.com
Description: This plugin allows your users to auto subscribe when registered
Author: WPMU DEV
Version: 1.0.1
Author URI: http://bappi-d-great.com
*/
if( class_exists( 'Incsub_Subscribe_By_Email' ) ){
add_action( 'user_register', 'user_register_cb', 10, 1 );
function user_register_cb( $user_id ) {
$user_info = get_userdata( $user_id );
Incsub_Subscribe_By_Email::subscribe_user( $user_info->user_email, 'Manual Subscription', 'User Registration', false, array() );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment