Skip to content

Instantly share code, notes, and snippets.

@atwellpub
atwellpub / functions.php
Last active August 29, 2015 14:23
Hack fix for rev slider + landing pages + richer WordPress theme.
/* ------------------------------------------------------------------------ */
/* INBOUND NOW
/* ------------------------------------------------------------------------ */
add_action('wp_footer' , 'inbound_rev_customizations');
function inbound_rev_customizations() {
global $post;
if (!isset($post) || $post->post_type != 'landing-pages') {
return;
}
@atwellpub
atwellpub / deploy.sh
Created June 24, 2015 17:27
Shell script to deploy a new tag to both git and svn
#! /bin/bash
# A modification of Dean Clatworthy's deploy script as found here: https://github.com/deanc/wordpress-plugin-git-svn
# The difference is that this script lives in the plugin's git repo & doesn't require an existing SVN repo.
#Instructions
# Update 'NEWVERSION1' with correct version number
#1. run below command in terminal
# cd /Users/davidgregorywells/Dropbox/Sites/Local-Dev/wp-content/plugins/landing-pages
#2. then run below command in terminal
# ./deploy.sh
@atwellpub
atwellpub / functions.php
Last active August 29, 2015 14:21
remove specific parts of new lead notification email
<?php
/**
* unsets POST fields from form submission email notification
*/
add_filter( 'inbound-email-post-params' , 'inbound_modify_lead_notification_fields' );
function inbound_modify_lead_notification_fields( $fields ) {
unset($fields['inbound_form_name']);
unset($fields['inbound_form_lists']);
@atwellpub
atwellpub / bootstrap.php
Created May 19, 2015 00:31
draft bootstrap.php
<?php
/**
* Bootstrap the plugin unit testing environment.
*
* Edit 'active_plugins' setting below to point to your main plugin file.
*
* @package wordpress-plugin-tests
*/
// Activates this plugin in WordPress so it can be tested.
@atwellpub
atwellpub / phpunit.xml
Created May 19, 2015 00:30
failing phpunit.xml
<phpunit bootstrap="./bootstrap.php" backupGlobals="false" colors="true">
<testsuites>
<!-- Default test suite to run all tests -->
<testsuite>
<directory prefix="test." suffix=".php">wordpress-default/wp-content/plugins/cta/tests/phpunit/</directory>
</testsuite>
<!-- Default test suite to run all tests -->
<testsuite>
<directory prefix="test." suffix=".php">wordpress-default/wp-content/plugins/landing-pages/tests/phpunit/</directory>
@atwellpub
atwellpub / .js
Last active August 29, 2015 14:20
* watch cta's shared folder for changes and mirror it to /_inbound-pro/core/shared * watch cta's analytics source files and compile changes locally * launch the node server. sudo gulp start
var gulp = require('gulp'),
karma = require('gulp-karma'),
jshint = require('gulp-jshint'),
stylish = require('jshint-stylish'),
header = require('gulp-header'),
concat = require('gulp-concat'),
uglify = require('gulp-uglify'),
plumber = require('gulp-plumber'),
clean = require('gulp-clean'),
@atwellpub
atwellpub / function.php
Last active August 29, 2015 14:19
change csv export delimiter
<?php
/* changes delimiter to semicolon */
add_filter('leads_csv_delimiter' , function() {
return ';';
});
@atwellpub
atwellpub / functions-download.php
Created April 19, 2015 16:13
Builds a dataset of downloads and extensions
<?php
class DownloadsDataSetBuilder {
static $downloads;
public function __construct() {
self::get_downloads();
self::include_post_meta();
self::print_results();
@atwellpub
atwellpub / inbound-customization.php
Last active August 29, 2015 14:17
This document shows an example plugin that will extend Inbound Forms to be able to add a lead to a custom taxonomy on form submission. It also shows how to create a custom field type that provides a dropdown of available taxonomy terms.
<?php
/*
Plugin Name: Inbound Now - Customizations (Do not disable)
Plugin URI: http://www.inboundnow.com/
Description: Helps add leads to custom taxonomies
Author: Hudson Atwell
Version: 1.0.0
Author URI: http://www.twitter.com/atwellpub
Text Domain: inbound-pro
Domain Path: /lang/
@atwellpub
atwellpub / module.click-tracking.php
Created March 20, 2015 20:05
Customer support effort for click tracking
<?php
add_action('wp_footer', 'lp_click_callback');
function lp_click_callback() {
global $post;
if (!isset($post)) {
return;
}