Skip to content

Instantly share code, notes, and snippets.

View mahircoding's full-sized avatar
🏠
Working from home

MahirCoding mahircoding

🏠
Working from home
  • surakarta Indonesia
  • 13:27 (UTC +07:00)
View GitHub Profile
<?php
function pw_edd_send_email_on_pending( $payment_id, $payment_data ) {
// grab the gateway so we can only send on email for specific gateways
$gateway = isset( $_POST['edd-gateway'] ) ? $_POST['edd-gateway'] : '';
// TODO: replace "bacs" with your gateway ID
if( $gateway != 'bacs' )
return;
@pippinsplugins
pippinsplugins / gist:9557012
Created March 14, 2014 21:10
Send an email anytime a payment is recurring through EDD Recurring Payments
<?php
function pw_edd_recurring_payment_received_notice( $payment, $parent_id, $amount, $txn_id, $unique_key ) {
$user_id = edd_get_payment_user_id( $parent_id );
$email = edd_get_payment_user_email( $parent_id );
$user_data = get_userdata( $user_id );
$subject = 'Payment Received';
$message = "Hello $usera_data->display_name, your payment for $amount has been received. Thanks!";
@amdrew
amdrew / gist:40fcef36a7842d80f66c
Last active July 13, 2023 00:30
EDD 2.0 - Show discount field by default
<?php
/**
* Unhook default EDD discount field
*/
remove_action( 'edd_checkout_form_top', 'edd_discount_field', -1 );
/**
* Add our own callback for the discount field, keeping the same CSS as before
*/
@wpweb101
wpweb101 / replace_cur.php
Last active July 28, 2021 17:21
replace edd currency symbol with points
<?php
if( class_exists( 'Easy_Digital_Downloads' ) ) {
$currency = edd_get_currency(); // get edd base currency
add_filter( 'edd_' . strtolower( $currency ) . '_currency_filter_before', 'edd_cur_change_before_format', 10, 3 );
add_filter( 'edd_' . strtolower( $currency ) . '_currency_filter_after', 'edd_cur_change_after_format', 10, 3 );
function edd_cur_change_before_format($formatted, $currency, $price) {
@ashleyfae
ashleyfae / edd-auto-apply-discount-code.php
Created August 30, 2016 12:13
Automatically applies an EDD discount code if certain cart conditions are met.
<?php
/**
* Plugin Name: EDD - Discounts for Subscribers
* Plugin URI: https://www.nosegraze.com/apply-edd-discount-code-cart-contents
* Description: Automatically applies an EDD discount code if certain cart conditions are met.
* Version: 1.0
* Author: Nose Graze
* Author URI: https://www.nosegraze.com
* License: GPL2
*
@andrewlimaza
andrewlimaza / honeypot-example.php
Last active July 17, 2024 07:03
Simple honeypot for an HTML form using PHP
<?php
//check if form was sent
if($_POST){
$to = 'some@email.com';
$subject = 'Testing HoneyPot';
$header = "From: $name <$name>";
$name = $_POST['name'];
@lmcneel
lmcneel / remove-node-modules.md
Last active July 9, 2024 19:06
How to remove node_modules after they have been added to a repo

How to remove node_modules

Create a .gitignore file

  1. Check for an existing .gitignore file in the project directory
ls -a
@bmarshall511
bmarshall511 / template-functions.php
Last active June 29, 2023 10:23
Locate a WordPress plugin template.
<?php
/**
* Locate template.
*
* Locate the called template.
* Search Order:
* 1. /themes/theme/templates/$template_name
* 2. /themes/theme/$template_name
* 3. /plugins/plugin/templates/$template_name.
*
<?php
/*
This script will allow you to send a custom email from anywhere within wordpress
but using the woocommerce template so that your emails look the same.
Created by craig@123marbella.com on 27th of July 2017
Put the script below into a function or anywhere you want to send a custom email
*/
@abdurrahmanekr
abdurrahmanekr / gist:2747d704edec93a06e454eba2653e0df
Last active July 11, 2024 06:09
WhatsApp original chat background image

WhatsApp original chat background image

WhatsApp original darkmoda background image