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
/**
* Plugin Name: My PaiementPro with GiveWP
*.Version: 1.0.0
* Author: Mehul Gohil
*/
/**
* Register payment method.
*
<?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
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 );
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}
@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
*
@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 );
<?php
add_filter( 'nonce_life', function( $lifespan ) {
return 120;
}
Array
(
[headers] => Requests_Utility_CaseInsensitiveDictionary Object
(
[data:protected] => Array
(
[server] => nginx
[date] => Sun, 31 Jan 2021 15:43:18 GMT
[content-type] => text/plain;charset=UTF-8
[content-length] => 639
@mehul0810
mehul0810 / add-custom-field-in-csv-givewp.php
Created May 13, 2021 10:29
For GiveWP users, you can easliy add custom field and its data to the donation history CSV export.
<?php
/**
* Add data to CSV column.
*
* @param array $columns List of CSV columns.
*
* @since 1.0.0
*
* @return array
*/
<?php
function custom_prefix_modify_currency_symbol( $symbol ) {
if( defined( 'ICL_LANGUAGE_CODE' ) && 'en' === ICL_LANGUAGE_CODE ) {
$symbol = 'AED';
}
return $symbol;
}
add_filter( 'give_currency_symbol', 'custom_prefix_modify_currency_symbol', 10 );