Skip to content

Instantly share code, notes, and snippets.

View christianwach's full-sized avatar
Thinking time

Christian Wach christianwach

Thinking time
View GitHub Profile
<?php
/**
* Define CiviCRM Multisite Domain constants and settings.
*
* When a WordPress site is accessed, CiviCRM needs to know a number of settings
* that enable Multisite Domain functionality. Define that data here.
*
* Once the Domain has been created (e.g. via the form on the "Domains" tab of
* the CiviCRM Admin Utilities network settings page) add the corresponding data
@christianwach
christianwach / fix-json-uploads.php
Created January 9, 2020 14:11
Populate file info for JSON files so that they can be uploaded to WordPress.
<?php
/**
* Populate file info for JSON files.
*
* @see https://core.trac.wordpress.org/ticket/45633
*
* @param array $info The existing file data array.
* @param string $file Full path to the file.
* @param string $filename The name of the file.
@christianwach
christianwach / civicrm-remove-kam.php
Last active March 13, 2019 16:16
Removes the CiviCRM 5.12.x menu from the front-end in WordPress
<?php /*
--------------------------------------------------------------------------------
Plugin Name: CiviCRM Remove KAM
Description: Removes CiviCRM's menu on the front-end.
Author: Christian Wach
Version: 0.1
Author URI: http://haystack.co.uk
Depends: CiviCRM
--------------------------------------------------------------------------------
*/
@christianwach
christianwach / civicrm-admin-body-classes.php
Last active August 2, 2018 08:55
Adds classes to body element when viewing CiviCRM in WordPress admin.
<?php
add_filter( 'admin_body_class', 'my_admin_body_classes' );
/**
* Adds classes to body element when viewing CiviCRM in WordPress admin.
*
* This allows selectors to be written for CiviCRM admin pages.
*
* @param str $classes The existing admin body classes.
<?php /*
--------------------------------------------------------------------------------
Plugin Name: BuddyPress Biography Sync
Description: Keeps a BuddyPress xProfile field in sync with the WordPress user description field.
Author: Christian Wach
Version: 0.1
Author URI: http://haystack.co.uk
--------------------------------------------------------------------------------
*/
@christianwach
christianwach / mailchimp-bp-reg-options.php
Last active June 22, 2017 12:01
Delay list subscription in MailChimp for WordPress when registration is moderated by BP Registration Options
<?php
/**
* Delay MailChimp subscription when registration is moderated.
*
* Only users who have requested to be signed up to the list will be passed
* to this callback, so store that fact in usermeta for later processing.
*
* @param bool $delay False delays subscription, true does not
* @param int $user_id The user ID to subscribe
/**
* Clone of wp_debug_backtrace_summary()
*
* Return a comma-separated string of functions that have been called to get
* to the current point in code.
*
* @see https://core.trac.wordpress.org/ticket/19589
*
* @param string $ignore_class Optional. A class to ignore all function calls within - useful
* when you want to just give info about the callee. Default null.
@christianwach
christianwach / civicrm-paypal-cc-screen.php
Last active February 29, 2016 15:22
Make Paypal default to the Credit Card screen instead of the Paypal login screen
<?php /*
--------------------------------------------------------------------------------
Plugin Name: CiviCRM Paypal Credit Card Screen
Plugin URI: http://haystack.co.uk
Description: Makes Paypal default to the Credit Card screen instead of the Paypal login screen
Author: Christian Wach
Version: 0.1
Author URI: http://haystack.co.uk
Depends: CiviCRM
--------------------------------------------------------------------------------
@christianwach
christianwach / suppress-log-warnings.php
Last active February 1, 2024 15:18 — forked from r-a-y/warnings.php
A WordPress plugin that suppresses warnings created by various plugins and themes in WordPress.
<?php
/**
* Plugin Name: Suppress Log Warnings
* Plugin URI: https://gist.github.com/christianwach/7d2bb481f9efe185f2b8
* Description: Suppresses annoying warnings generated by various plugins.
* Version: 1.0
*
* Put this plugin in /wp-content/mu-plugins/
*
* @package CMW_Suppress_Log_Warnings
<?php /*
--------------------------------------------------------------------------------
Plugin Name: BPGEN WPBE Compatibility
Plugin URI: https://gist.github.com/christianwach/c7a77ffd52f9ec2b21d9
Description: Ensures that BP Group Email Notifications digests are sent using WP Better Emails template.
Author: Christian Wach
Version: 0.1
Author URI: http://haystack.co.uk
--------------------------------------------------------------------------------
*/