Skip to content

Instantly share code, notes, and snippets.

View naomicbush's full-sized avatar

Naomi C. Bush naomicbush

View GitHub Profile
form[data-drip-embedded-form] {
background: #fff url(data:image/gif;base64,R0lGODlhAQADAIABAMzMzP///yH/C1hNUCBEYXRhWE1QPD94cGFja…wbGhkYFxYVFBMSERAPDg0MCwoJCAcGBQQDAgEAACH5BAEAAAEALAAAAAABAAMAAAICRFIAOw==) repeat-y center top;
font-family: "Helvetica Neue", Helvetica, Arial, Verdana, sans-serif;
line-height: 1.5em;
overflow: hidden;
color: #666;
font-size: 16px;
border-top: solid 20px #3071b0;
border-top-color: #3071b0;
border-bottom: solid 10px #3d3d3d;
@jtsternberg
jtsternberg / ajax-endpoint.js
Last active February 1, 2021 06:00
Proof of concept for avoiding admin-ajax for ajax callback requests. Also see Thomas Griffin's excellent post: https://thomasgriffin.io/a-creative-approach-to-efficient-and-scalable-wordpress-api-endpoints/ AND Josh Pollock's excellent post: http://torquemag.io/improved-wordpress-front-end-ajax-processing/
jQuery(document).ready(function($){
$('body').on( 'click', '.some-button', function(){
$.ajax( ajax_endpoint_data.api_url, {
type : 'POST',
dataType : 'json',
data : {
action: 'ajax_action',
some_data: 'some_value'
}
@markjaquith
markjaquith / gist:6225805
Last active February 21, 2024 23:56
WordPress multi-tenant directory structure sharing core files for opcode awesomeness, fast deployments, and low disk usage. With inspiration from @weskoop. "=>" indicates a symlink.
sites
|__ ms.dev
| |__ content
| |__ index.php
| |__ wp => ../../wordpress/stable
| |__ wp-config.php
|__ one.dev
| |__ content
| |__ index.php
| |__ wp => ../../wordpress/stable
@tomjn
tomjn / gist:6140909
Last active February 21, 2020 06:35
If you're thinking of using WP_Query, try using this iterator instead, cleaner boilerplate, auto-cleans up after itself
<?php
$pages = new query_loop( array(
'post_type' => 'page'
));
foreach( $pages as $id => $post ) {
the_title();
// etc...
}
@szbl
szbl / meta.php
Created July 4, 2013 02:59
Example view from faux MVC WordPress plugin example for CodePoet.com article.
<table class="form-table">
<tbody>
<tr>
<th>
<label for="szbl-person-email">
Email Address:
</label>
</th>
<td>
<input type="email" id="szbl-person-email" name="szbl_person_email" value="<?php
@szbl
szbl / my-plugin-snippet.php
Last active March 15, 2022 04:17
How I auto-include my library of "controllers" in a theme/plugin.
<?php
// include all PHP files in ./lib/ directory:
foreach ( glob( dirname( __FILE__ ) . '/lib/*.php' ) as $file )
include $file;
@pento
pento / commercial-client.php
Created July 2, 2013 12:29
Sample Commercial Plugin update server and client
<?php
/*
* Plugin Name: Commercial Client
* Plugin URI: http://pento.net/
* Description: A sample client plugin for showing updates for non-WordPress.org plugins
* Author: pento
* Version: 0.1
* Author URI: http://pento.net/
* License: GPL2+
*/
@trepmal
trepmal / easy-albums.php
Last active December 14, 2015 02:09
Put a group of galleries into an album, then put the album in a page.
<?php
// Better version over here:
// https://github.com/trepmal/Easy-Albums
//Plugin Name: Easy Albums
//Description: Put a group of galleries into an album, then put the album in a page.
/*
Quick release!
@thomasgriffin
thomasgriffin / gist:4953041
Created February 14, 2013 14:04
My gift to you this Valentine's Day. Rendering custom attachment fields in the new media manager via Backbone.
/**
* The code below renders additional custom attachment fields into the
* new media manager.
*
* I am assuming you are using your own custom media modal frame. By
* extending the default Attachment.Details subview, we can append our
* custom fields to the default fields listed.
*
* In the initialize function, we ensure that our changes are always up
* to date by "listening" to our model's change event and updating the
@markjaquith
markjaquith / plugin-deploy.sh
Created November 16, 2012 05:04 — forked from scribu/plugin-deploy.sh
Plugin deploy script
#!/bin/bash
# args
MSG=${1-'deploy from git'}
BRANCH=${2-'trunk'}
# paths
SRC_DIR=$(git rev-parse --show-toplevel)
DIR_NAME=$(basename $SRC_DIR)
DEST_DIR=~/svn/wp-plugins/$DIR_NAME/$BRANCH