Skip to content

Instantly share code, notes, and snippets.

View polevaultweb's full-sized avatar

Iain Poulson polevaultweb

View GitHub Profile
add_filter( 'igp_template_caption_no_tags', 'my_igp_template_caption_no_tags' );
function my_igp_template_caption_no_tags( $caption ) {
$caption_parts = explode( '&&', $caption );
return $caption[0];
}
add_filter( 'igp_template_caption', 'my_igp_template_caption' );
@polevaultweb
polevaultweb / wpos3-oembed-library.php
Last active February 19, 2016 14:46
oEmbed Library Addon for WP Offload S3
<?php
/*
Plugin Name: WP Offload S3 - oEmbed Library Addon
*/
/**
* OEmbed in Library
* https://wordpress.org/plugins/oembed-in-library/
*/
function wpos3_oembed_lib_init() {
@polevaultweb
polevaultweb / nf_fu_dir_tweak.php
Last active April 2, 2016 09:30
WordPress Plugin to change Ninja Forms File Upload directory
<?php
/**
* Plugin Name: Ninja Forms File Uploads Directory Tweak
* Plugin URI: http://polevaultweb.com
* Description: Tweaks plugin
* Version: 1.0
* Author: polevaultweb
* Author URI: http://polevaultweb.com
*/
@polevaultweb
polevaultweb / igp_image_filename.php
Last active April 11, 2016 10:16
Using the `igp_image_filename` filter in Instagrate Pro
<?php
add_filter( 'igp_image_filename', 'my_igp_image_filename', 10, 4 );
function my_igp_image_filename( $file_name, $file, $post_name, $postid ) {
$file_name_parts = explode( '.', $file_name );
$ext = array_pop( $file_name_parts );
$file_name = 'my-prefix-' . implode( '.', $file_name_parts ) . '-'. date( 'Y-m-d' ) . '.' . $ext;
return $file_name;
<?php
/*
Plugin Name: DBI Connection Fix
Author: Delicious Brains
Author URI: http://deliciousbrains.com
*/
function dbi_connection( $transports, $args, $url ) {
if ( false !== strpos( $url, 'deliciousbrains.com' ) ) {
// Use streams as cURL results in connection refused
return array( 'streams', 'curl' );
@polevaultweb
polevaultweb / ig_captions.php
Last active June 29, 2016 09:04
Line break delimited captions for Intagrate
<?php
add_filter( 'igp_template_caption', 'my_igp_template_caption' );
function my_igp_template_caption( $caption ) {
$parts = explode( "\n\n", $caption );
return $parts[0];
}
add_filter( 'igp_template_caption_no_tags', 'my_igp_template_caption_no_tags' );
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:CreateBucket",
"s3:DeleteObject",
"s3:Put*",
"s3:Get*",
<?php
add_filter( 'wpmdb_preserved_options', 'mm_wpmdb_preserved_options' );
function mm_wpmdb_preserved_options( $options ) {
$options[] = 'itsec_local_file_list';
return $options;
}
@polevaultweb
polevaultweb / make_igp_post_type_public.php
Created August 4, 2016 14:40
Make the Intagrate post type public
<?php
add_filter( 'register_post_type_args', 'my_register_post_type_args', 10, 2 );
function my_register_post_type_args( $args, $post_type ) {
if ( 'instagrate_pro' !== $post_type ) {
return $args;
}
$args['public'] = true;
@polevaultweb
polevaultweb / automated-acceptance-testing-with-codeception.md
Created August 16, 2016 15:01
Automated Acceptance Testing with Codeception

One of the biggest drains on our development team is manually performing acceptance tests for each release of our WordPress plugins. It's time consuming and expensive, in terms of both man hours and time taken away from actual product development. Manual testing like this just doesn't scale.

So what's the solution? Hire a tester or a testing team? Still not scalable. This talk covers how it is possible to automate 99% of manual tests with the testing framework Codeception, and how we are integrating