Skip to content

Instantly share code, notes, and snippets.

@tessak22
tessak22 / functions.php
Created March 12, 2019 12:06
Hero Gutenberg Block using Advanced Custom Fields 5.8 Pro
/**
* Register hero block
*/
add_action('acf/init', 'hero');
function hero() {
// check function exists
if( function_exists('acf_register_block') ) {
// register a hero block
<?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
@ipokkel
ipokkel / pmpro-restrict-all-cpt-posts.php
Last active April 7, 2025 08:51
Restrict all posts for a custom post type (CPT) automatically with PMPro but allow administrators access to the CPT #cpt #pmpro-cpt
<?php
/**
* This recipe restricts all content of a Custom Post Type (CPT)
* to members only.
*
* This recipe assumes your CPT name is "recipes".
* You should replace this with your CPT name for the filter name
* and the $my_cpt variable's value in the hook name on line 71,
* e.g. pmpro_has_membership_access_filter_cpt-name,
* and 74, e.g. $my_cpt = 'cpt-name'.
@christianwach
christianwach / suppress-admin-notices.php
Last active February 11, 2025 12:27
A WordPress plugin that suppresses nagging admin notices from various plugins.
<?php
/**
* Plugin Name: Suppress Admin Notices
* Plugin URI: https://gist.github.com/christianwach/c30d2972d1807ad9a04dff1db971b7cd
* Description: Stop that damn nagging!
* Version: 1.0.2
* Author: Christian Wach
* Author URI: https://haystack.co.uk
*
* @package CMW_Suppress_Admin_Notices
@christianwach
christianwach / bp-hide-name-field.php
Last active February 10, 2025 08:33
Hides the default Name field on BuddyPress Registration form and Profile Edit screens.
<?php
/**
* Plugin Name: BP Hide Name Field
* Description: Hides the default Name field on BuddyPress Registration form and Profile Edit screens.
* Plugin URI: https://gist.github.com/christianwach/06d878edc277ce1ca8a7e59a82052744
* Version: 1.1
* Author: Christian Wach
* Author URI: https://github.com/christianwach
*/
@christianwach
christianwach / acfe-latest-acf-fix.php
Last active November 7, 2024 15:22
Temporary fix for AJAX selectors in ACF 6.3.10
<?php
/**
* ACFE Fix AJAX selectors
*
* Plugin Name: ACFE Fix AJAX selectors
* Description: Fixes AJAX selectors with ACF 6.3.10. Do not deacticate or delete.
* Plugin URI: https://haystack.co.uk
* Version: 1.0.0
* Author: Christian Wach
* Author URI: https://haystack.co.uk