Skip to content

Instantly share code, notes, and snippets.

View jonnyvaughan's full-sized avatar

Jonny Vaughan jonnyvaughan

View GitHub Profile
@jonnyvaughan
jonnyvaughan / dploy.php
Created October 10, 2014 09:10
PHP webhook script for dploy.io --> Slack
<?php
/*
Use as a post deployment webhook in dploy.io to act as an intermediary between dploy.io and Slack.
Will take deployment notifications and post into a Slack channel. Setup an incoming webhook in Slack & note the token.
Customise & host this script somewhere then use in dploy.io server settings:
i.e. http://www.example.com/dploy.php?token=<slack_channel_token>
*/
@jonnyvaughan
jonnyvaughan / custom-search-acf-wordpress.php
Last active January 30, 2021 15:51 — forked from charleslouis/custom-search-acf-wordpress.php
Search filter to search on specified ACF fields and custom taxonomies.
<?php
/**
* [list_searcheable_acf list all the custom fields we want to include in our search query]
* @return [array] [list of custom fields]
*/
function list_searcheable_acf(){
$list_searcheable_acf = array("title", "sub_title", "excerpt_short", "excerpt_long", "xyz", "myACF");
return $list_searcheable_acf;
}
<?php
// ** MySQL settings - You can get this info from your web host ** //
// Totally Dev
if (preg_match('/totallydev.com/', $_SERVER['HTTP_HOST'])) {
/** The name of the database for WordPress */
define('DB_NAME', 'ycam_wordpress');
/** MySQL database username */
@jonnyvaughan
jonnyvaughan / um-conditional.js
Created February 14, 2018 14:28
Ultimate Member conditional field JS fix
jQuery(document).ready(function() {
var arr_fields = [];
var arr_field_keys = [];
var arr_all_conditions = []; //raw
var um_field_conditions = {}; // filtered
var um_field_default_values = {};
/**
<?php
class TD_Custom_Rewrites {
public function __construct() {
// set up rewrite tags
add_rewrite_tag('%query1%', '([^&]+)');
add_rewrite_tag('%query2%', '([^&]+)');
add_rewrite_tag('%query3%', '([^&]+)');