Skip to content

Instantly share code, notes, and snippets.

Avatar

Anthony Brown anthonysbrown

  • Worcester, MA USA
View GitHub Profile
View adaptivepayments.php
<?php
function AdaptiveCall($bodyparams, $method, $payKey) {
try
{
$body_data = http_build_query($bodyparams, "", chr(38));
$url = trim("https://svcs.sandbox.paypal.com/AdaptivePayments/".$method."");
$params = array("http" => array(
View paypal mass pay.php
<?php
// code modified from source: https://cms.paypal.com/cms_content/US/en_US/files/developer/nvp_MassPay_php.txt
// documentation: https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/howto_api_masspay
// sample code: https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/library_code
// eMail subject to receivers
$vEmailSubject = 'Pagamento Paypal';
/** MassPay NVP example.
*
View functions.php
<?php
add_action('sp_cdm_email_send', 'do_something_after_email', 10,3);
function do_something_after_email($type,$file_id,$post){
if($type == 'sp_cu_admin_user_email'){
//do something here
}
View DoDirectPayment.php
<?php
// Include required library files.
global $wpdb,$trans_id,$last_postid,$payable_amount;
require_once(TEMPLATIC_PAYPAL_EXPRESS_CHECKOUT_DIR .'/includes/config.php');
require_once(TEMPLATIC_PAYPAL_EXPRESS_CHECKOUT_DIR .'/includes/paypal.class.php');
$post_title = get_post($last_postid);
$post_title = $post_title->post_title;
// Create PayPal object.
$PayPalConfig = array('Sandbox' => $sandbox, 'APIUsername' => $api_username, 'APIPassword' => $api_password, 'APISignature' => $api_signature);
View functions.php
<?php
add_action('funeralpress/admin/obit/content_tab', 'my_new_tab', 12, 2);
function my_new_tab($r, $obit_id){
echo ' <li><a href="http://linktourl">Tab Title</a></li>';
}
View gist:bec7f5f1b7dc3aff0b4e2d05e4d49f77
add_filter('wpfp_frontend_obit_menu', 'my_new_tab');
function my_new_tab($additional_menu_items){
$additional_menu_items .='<li><a href="http://yoururl" >Tab Name</a></li>';
return $additional_menu_items;
}
@anthonysbrown
anthonysbrown / functions.php
Created Jan 20, 2017
Smarty Document Manager - Remove Add File Bar
View functions.php
<?php
#this function removes the add file bar for non admin users
#place this in your themes function.php file
add_filter('sp_cu_below_search_nav', 'remove_cdm_bar');
function remove_cdm_bar($html){
if(current_user_can('manage_options') == false){
$html = '';
}
return $html;
@anthonysbrown
anthonysbrown / functions.php
Last active Feb 15, 2017
Change email headers from smarty document manager emails
View functions.php
<?php
add_filter('sp_cdm/mail/headers','my_custom_headers', 20,5);
function my_custom_headers($headers,$from,$to,$subject,$message){
$headers[] = "From: Test <example@example.com>\r\n";
return $headers;
@anthonysbrown
anthonysbrown / functions.php
Created Feb 16, 2017
Change the from address in SP Client document manager
View functions.php
<?php
add_filter('sp_cdm/mail/admin_email','cdm_admin_email', 20);
function cdm_admin_email($email){
$email = 'noreply@example.com';
return $email;
}
View functions.php
function funeralpress_custom_styles() {
wp_dequeue_style( 'wpfh-style' );
wp_dequeue_style( 'wpfh-cem-style' );
wp_enqueue_style( 'wpfh-style-custom-styles', get_stylesheet_directory_uri().'funeralpress.css', array('wpfh-style','wpfh-cem-style') );
}
add_action( 'wp_enqueue_scripts', 'funeralpress_custom_styles' );