Skip to content

Instantly share code, notes, and snippets.

@joshjenkinsAR
joshjenkinsAR / hide-admin-menus.php
Created May 29, 2018 14:28
Hide various WordPress multisite admin menu items - much lighter than a bloated plugin. Hides unless user is super_admin.
//Custom admin hidden menu items
if ( !is_super_admin() ) {
add_action( 'admin_menu', 'custom_admin_menu' );
}
function custom_admin_menu() {
remove_menu_page('acf');
remove_menu_page('masterslider');
remove_menu_page('masterslider-setting');
remove_menu_page('genesis');
@joshjenkinsAR
joshjenkinsAR / transaction.php
Last active November 10, 2017 06:06
Save Authorize.net transaction id to gravity forms field after completed payment and include the new data in the Zapier feed
/***
* Add transaction ID to forms with this field after a payment is processed
***/
add_action( 'gform_post_payment_action', 'save_transaction_id', 10, 2);
function save_transaction_id( $entry, $action ) {
$id = rgar( $entry, 'id');
$trans_id = rgar( $action, 'transaction_id' );
$trans_form_id = rgar( $entry, 'form_id');
$trans_field_id = '';
@joshjenkinsAR
joshjenkinsAR / archive-email-file.gs
Created May 19, 2016 14:05
A Google App Script to copy a sheet to another folder, email if values are present, and clear the original file
function copyemailclear(){
var file = DriveApp.getFileById('Orignal File ID');
var destFolder = DriveApp.getFolderById("Destination File ID");
var todaylong = new Date();
var today = todaylong.toISOString();
var name= "new file name "+today; // Add a date string to the end of the file name
var new_url = DriveApp.getFileById(id).makeCopy(name, destFolder).getUrl();