Skip to content

Instantly share code, notes, and snippets.

View m-e-h's full-sized avatar
😐
...

Marty Helmick m-e-h

😐
...
View GitHub Profile
@spivurno
spivurno / gist:4049312
Created November 10, 2012 00:55
Configure admin approval for new accounts
/**
* Configure Admin Approval for New Accounts
* http://gravitywiz.com/
*/
remove_filter('wpmu_signup_user_notification_email', array('GFUserSignups', 'modify_signup_user_notification_message'));
add_filter('wpmu_signup_user_notification_email', 'my_modify_signup_user_notification_message');
function my_modify_signup_user_notification_message() {
return false;
}
@willurd
willurd / web-servers.md
Last active December 14, 2024 08:29
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@spivurno
spivurno / gw-gravity-forms-advanced-merge-tags.php
Last active May 5, 2022 18:54
Gravity Wiz // Gravity Forms // Advanced Merge Tags
<?php
/**
* WARNING! THIS SNIPPET MAY BE OUTDATED.
* The latest version of this snippet can be found in the Gravity Wiz Snippet Library:
* https://github.com/gravitywiz/snippet-library/blob/master/gravity-forms/gw-advanced-merge-tags.php
*/
/**
* Gravity Wiz // Gravity Forms // Advanced Merge Tags
*
* Adds support for several advanced merge tags:
@justintadlock
justintadlock / register-post-type.php
Last active December 14, 2024 10:41
Help file when registering post types.
<?php
# Register custom post types on the 'init' hook.
add_action( 'init', 'my_register_post_types' );
/**
* Registers post types needed by the plugin.
*
* @since 1.0.0
* @access public
@robneu
robneu / disable-jetpack-modules.php
Last active April 25, 2016 20:27
Disable unwanted Jetpack Modules. The whitelist array will allow any modules you want to remain enabled to continue to function. If you don't want the module to activate, remove it from the whitelist.
<?php
add_filter( 'jetpack_get_available_modules', 'prefix_hide_jetpack_modules' );
/**
* Disable all non-whitelisted jetpack modules.
*
* As it's written, this will allow all of the currently available Jetpack
* modules to work display and be activated normally.
*
* If there's a module you'd like to disable, simply comment it out or remove it
* from the whitelist and it will no longer be available for activation.
@addyosmani
addyosmani / package.json
Last active October 2, 2024 05:38
npm run-scripts boilerplate
{
"name": "my-app",
"version": "1.0.0",
"description": "My test app",
"main": "src/js/index.js",
"scripts": {
"jshint:dist": "jshint src/js/*.js",
"jshint": "npm run jshint:dist",
"jscs": "jscs src/*.js",
"browserify": "browserify -s Validating -o ./dist/js/build.js ./lib/index.js",
@jchristopher
jchristopher / gist:f8bb12e2d0e60b22676e
Last active July 7, 2016 17:34
Create SearchWP database tables by hand
-- Create syntax for TABLE 'wp_swp_cf'
CREATE TABLE `wp_swp_cf` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`metakey` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
`term` int(20) unsigned NOT NULL,
`count` bigint(20) unsigned NOT NULL,
`post_id` bigint(20) unsigned NOT NULL,
PRIMARY KEY (`id`),
KEY `metakey` (`metakey`),
KEY `term` (`term`),
@eteubert
eteubert / wordpress-passwort-reset-unmultisite.php
Last active October 6, 2024 19:59
Multisite: Passwort Reset on Local Blog
<?php
/**
* Plugin Name: Multisite: Passwort Reset on Local Blog
* Plugin URI: https://gist.github.com/eteubert/293e07a49f56f300ddbb
* Description: By default, WordPress Multisite uses the main blog for passwort resets. This plugin enables users to stay in their blog during the whole reset process.
* Version: 1.0.0
* Author: Eric Teubert
* Author URI: http://ericteubert.de
* License: MIT
*/
@mgibbs189
mgibbs189 / 01_Query_Arguments.php
Last active August 27, 2023 10:11
FacetWP - show both a Google Map and a result listings
<?php
return array(
"post_type" => "park",
"post_status" => "publish",
"posts_per_page" => 100
);
@danielbachhuber
danielbachhuber / collection-filter.js
Last active June 17, 2024 17:40
Add a custom taxonomy dropdown filter to the WordPress Media Library
(function(){
/**
* Create a new MediaLibraryTaxonomyFilter we later will instantiate
*/
var MediaLibraryTaxonomyFilter = wp.media.view.AttachmentFilters.extend({
id: 'media-attachment-taxonomy-filter',
createFilters: function() {
var filters = {};
// Formats the 'terms' we've included via wp_localize_script()