Skip to content

Instantly share code, notes, and snippets.

davekiss / gist:2639184ac066c53416b23c5a66f42d1e
Created Feb 2, 2019
EDD Weekly Domain Report via Email
View gist:2639184ac066c53416b23c5a66f42d1e
* Add a weekly email report that summarizes which domains that
* your products are being used on.
add_filter( 'cron_schedules', function( $schedules ) {
$schedules['weekly'] = array(
'interval' => 604800,
'display' => __('Once Weekly')
ramiabraham / gethooks
Last active Jul 14, 2019
Copy all actions and filters in a plugin and save to a file.
View gethooks
# Prints all hooks in a dir to a .log file.
# Permissions issues:
# run: chmod +x gethooks
# gist:
# Easy usage:
johnbillion /
Last active Oct 9, 2021
WordPress Emails

WordPress Emails

This document lists all the situations where WordPress sends an email, along with how to filter or disable each email.

This documentation has moved here:

spivurno / gw-gravity-forms-exclude-forms-form-list.php
Last active Dec 14, 2017
Gravity Wiz // Gravity Forms // Exclude Forms from Form List
View gw-gravity-forms-exclude-forms-form-list.php
* Gravity Wiz // Gravity Forms // Exclude Forms from Form List
add_filter( 'query', function( $query ) {
if( rgget( 'page' ) != 'gf_edit_forms' ) {
return $query;
jchristopher / gist:53d98d2a21ffad14e440
Created Jun 22, 2015
Programmatically implement SearchWP synonyms (you do not need the Term Synonyms extension)
View gist:53d98d2a21ffad14e440
add_filter( 'searchwp_term_in', 'my_find_synonyms', 10, 2 );
add_filter( 'searchwp_and_logic', '__return_false' );
function my_find_synonyms( $term, $engine ) {
global $searchwp;
if( ! class_exists( 'SearchWP' ) || version_compare( $searchwp->version, '2.0.3', '<' ) ) {
return $term;
rogerlos / searchwp_results_substitute_post_for_attachment.php
Created Nov 11, 2014
Wordpress SearchWP: Substitute Post for Attachment in Search Results
View searchwp_results_substitute_post_for_attachment.php
* This function will see if a PDF or other "attachment" post-type returned by SearchWP
* is present in a custom field in a regular post, and will return that post instead. Note
* this will only process documents which are referenced via the "attachment" post type.
* For example, you may have a product specification PDF and would like it in the search
* results, but would rather people got to it by visiting the product page itself.
Rarst / append.php
Last active Apr 27, 2016
My xhprof/uprofiler setup, tweaked for WordPress and more easily profiling segments.
View append.php
use Rarst\Profiler\Handler;
global $wp;
if ( Handler::$profiling && empty( $wp ) ) {
danielbachhuber / gist:8af274e2b7f21c8c3bb6
Created Jul 3, 2014
Post-style permalinks for your custom post types
View gist:8af274e2b7f21c8c3bb6
* Post-style permalinks for your custom post types
* e.g. %year%/%monthnum%/%day%/%postname%
function dbx_get_post_types() {
return array(
// replace with your custom post types
jchristopher / gist:10730056
Created Apr 15, 2014
Throttle the SearchWP indexer
View gist:10730056
// pause the indexer for 1s in between passes
function my_searchwp_indexer_throttle() {
return 1;
add_filter( 'searchwp_indexer_throttle', 'my_searchwp_indexer_throttle' );
mattbanks /
Created Mar 14, 2014
Scaffold a new WordPress development site in Alfred, utilizing WP-CLI. Use this script to run as a Terminal Script. Customize for your theme needs, plugin needs, etc.
# Create directory for new site
cd ~/Sites
mkdir {query}
cd {query}
# Download latest version of WordPress
wp core download
# Setup wp-config file with WP_DEBUG enabled
wp core config --dbname={query} --dbuser=root --dbpass=root --dbprefix={query}wp_ --extra-php <<PHP