Skip to content

Instantly share code, notes, and snippets.

View ramiabraham's full-sized avatar

Rami Abraham ramiabraham

View GitHub Profile
@ramiabraham
ramiabraham / affwp_v.sh
Last active August 23, 2016 20:41
Get AffiliateWP version
#!/bin/bash
# Plugin version checker.
#
# Requirements:
# - WP-CLI
__get_affwp_v() {
wp plugin list --name='affiliate-wp' --version --format=json --allow-root
}
@ramiabraham
ramiabraham / rcp_add_affwp_affiliate_at_rcp_sub.php
Last active May 11, 2022 04:16
Add AffiliateWP affiliate when RCP subscription occurs (requires specifying desired RCP action, and subscription).
<?php
function rcp_add_affwp_affiliate_at_rcp_sub() {
$user_info = get_userdata();
$user_id = $user_info->user_id;
$member = new RCP_Member( $user_id );
$subscription_id = $member->get_pending_subscription_id();
@ramiabraham
ramiabraham / blender_belt_sander.md
Last active August 18, 2016 01:01
How to make a belt sander using an electric blender
We couldn’t find that file to show.
$categories = get_categories( array(
'orderby' => 'name',
'parent' => 0,
'post_type' => 'orange_cats'
) );
echo 'Shows all taxonomies for the given post type:';
echo '<br />';
foreach ( $categories as $category ) {
<?php
/*
Plugin Name: Orange Cats 4U
Plugin URI: https://catfacts.com
Description: Orange cats. For you!
Version: 1.0
Author: Helena Bonham Carter
Author URI: https://dennys.com
Copyright: ok
Text Domain: orange-cats
@ramiabraham
ramiabraham / affwp-custom-store-credit-dashboard.php
Created August 11, 2016 01:05
Change the notice in the affiliate dashboard for store credit balances.
<?php
/**
* Plugin Name: AffiliateWP - Store Credit Custom Dashboard Notice
* Plugin URI: http://affiliatewp.com
* Description: Change the notice in the affiliate dashboard for store credit balances.
* Author: ramiabraham
* Author URI: http://affiliatewp.com
* Version: 1.0
*/
function affwp_custom_store_credit_dashboard_notice() {
<?php
/**
* Plugin Name: AffiliateWP - Email Affiliate When Referral Paid
* Plugin URI: http://affiliatewp.com
* Description: Sends an email to the affiliate when a referral has been paid
* Author: Andrew Munro
* Author URI: http://affiliatewp.com
* Version: 1.0
*/
@ramiabraham
ramiabraham / sysinfo.sh
Created July 27, 2016 15:15
Unix OS system config info command reference
# Lists the following:
# kernel name, network node hostname,
# kernel release, kernel version,
# machine hardware name, processor type,
# hardware platform, operating system
uname –a
# whether your system is 32-bit or 64-bit
uname -m
@ramiabraham
ramiabraham / affwp_custom_first_referral_only.php
Last active July 19, 2016 21:09
Give affiliates one single referral only.
<?php
/**
* Plugin Name: AffiliateWP - First Referral Commission Only
* Plugin URI: https://affiliatewp.com
* Description: Modify an affiliate's commission rate for their very first referral. All other subsequent referrals will be recorded at zero.
* Author: ramiabraham
* Author URI: https://affiliatewp.com
* Version: 1.0
*/