Skip to content

Instantly share code, notes, and snippets.

@regularguy01
regularguy01 / sendy.php
Last active August 8, 2021 09:09 — forked from Pross/sendy.php
Add to mu-plugins folder, auto add every new user to a sendy list. Works with default WordPress and Woocommerce registrations.
<?php
/*
Original code by Pross found here https://gist.github.com/Pross/3ff9f68fea20dcdc8845919dc51de90d
//-------------------------------------------------------------------------------------//
Version 1.0.0
bdacus01 2020 found here https://gist.github.com/bdacus01/84171d9454e7ab4152be2edc65855c21
Improvements to code: added api key, firstname, and customer filter list.
If new account doesn't have the first_name filled in pull it from the registration POST.
user_register does not write out to the database until after registration is complete.
This code is for WC Customers. We are assuming they bought products or created an account.
@Pross
Pross / sendy.php
Created April 26, 2016 19:14
Add to mu-plugins folder, auto add every new user to a sendy list. Works with default WordPress and Woocommerce registrations.
<?php
add_action( 'user_register', 'add_user_to_sendy_list' );
function add_user_to_sendy_list( $user_id ) {
$list = 'SENDY_LIST_ID';
$url = 'http://SENDY_INSTALL_URL/subscribe';
$user = get_userdata( $user_id );
$email = $user->data->user_email;
$name = $user->data->user_nicename;
@khaledsaikat
khaledsaikat / sub_category_dropdown.php
Last active January 30, 2018 05:12
Frontend AJAX Sub-Category Dropdown (Load sub-category dropdown based on parent category by ajax call)
<?php
/*
Plugin Name: Frontend AJAX Sub-Category Dropdown
Plugin URI: http://khaledsaikat.com
Description: Load sub-category dropdown based on parent category by ajax call
Version: 0.1
Author: Khaled Hossain
Author URI: http://khaledsaikat.com
*/