Skip to content

Instantly share code, notes, and snippets.

View mehul0810's full-sized avatar
👋
Hey there! Let’s Connect

Mehul Gohil mehul0810

👋
Hey there! Let’s Connect
View GitHub Profile
<?php
add_filter( 'nonce_life', function( $lifespan ) {
return 120;
}
@mehul0810
mehul0810 / mastercard-update-description.php
Last active September 6, 2020 16:51
Update description on payment page for Mastercard (MPGS) for Give
<?php
function mg_update_payment_description( $text, $donationId ) {
$donation_type = give_get_meta( $donationId, 'donation_type', true ); // `donation_type` is the custom field key added by the Form Field Manager.
return "{$text} - {$donation_type}";
}
add_filter( 'mgmcfg_update_form_description', 'mg_update_payment_description', 10, 2 );
@mehul0810
mehul0810 / simple-ticket-incrementor.php
Created July 23, 2020 09:39
Simple Ticket Incrementor - Supports Multi-Step Donation Forms
<?php
/**
* Plugin URI: https://givewp.com/
* Plugin Name: Custom GiveWP Simple Ticket Incrementer
* Description: A simple functionality plugin (not supported) to increment donation amounts based on a number input
* field. Ideal for simple ticket sales. This is provided as an example plugin, it is not officially supported by
* GiveWP.com in any way and we are not liable for how it impacts your site in any way.
* Version: 1.1.0
* Author: The impress.org team, dlocc
*
echo "Welcome to Create WordPress Site Wizard!"
echo -n "Enter Folder Name:"
read foldername
echo -n "Enter Site Name:"
read sitename
echo "Creating Site Folder"
mkdir ${foldername}
cd ${foldername}
<?php
function mg_update_remark( $remark, $formId ) {
// Do whatever you like to update the remark text.
$remark = 'This is my remark'; // This is just an example how to update remark text.
return $remark;
}
add_filter( 'mggi88_update_remark_text', 'mg_update_remark', 10, 2 );
<?php
function mg_update_product_description( $productDesc, $donationId ) {
// Do whatever you want to add using the Form Id or $_POST and update the product description and return it.
$purpose = give_get_meta( $donationId, 'purpose', true ); // `purpose` here is the name of the FFM field.
return $purpose;
}
add_filter( 'mggi88_update_product_description_text', 'mg_update_product_description', 10, 2 );
<?php
/**
* Plugin Name: My PaiementPro with GiveWP
*.Version: 1.0.0
* Author: Mehul Gohil
*/
/**
* Register payment method.
*
<?php
/**
* Pass custom field data to Stripe when payment is processed.
*
* Retrieves custom form field data from the $_POST variable and merges it into
* the array that is passed to Stripe when a payment is made. Custom field data
* can be found under Metadata in the Stripe payment details screen.
*
* @param array $charge_args Arguments passed to Stripe payment gateway.
*
<?php
function selfie_auction_disable_rocket_loader( $tag, $handle, $src ) {
if (
'jquery-ui-menu' === $handle ||
'jquery-ui-position' === $handle ||
'jquery-ui-core' === $handle ||
'jquery-ui-widget' === $handle ||
'jquery' === $handle
) {
$tag = str_replace( 'src=', 'data-cfasync="false" src=', $tag );
@mehul0810
mehul0810 / register-payment-method-for-give.php
Last active January 10, 2020 03:49
This Gist is used to register custom payment gateway for Give.
<?php
/**
* Register payment method.
*
* @since 1.0.0
*
* @param array $gateways List of registered gateways.
*
* @return array
*/