Skip to content

Instantly share code, notes, and snippets.

View alanef's full-sized avatar

Alan Fuller alanef

View GitHub Profile
<?php
add_filter( /**
*
* Filter the message generated to email confirmation
*
* @param $message
* @param $content
* @param $details
* @param $close
* @param $id
<?php
add_filter( /**
*
* Filter the decision to send a confirmation or not
*
* @param $bool
*
* @return bool overrides any logic if set to true, if set to false then standard rules apply
*/
'qem_registration_always_confirm',
<?php
add_filter( /**
*
* Filter the decision to send an admin confirmation or not
*
* @param $bool
*
* @return bool overrides any logic if set to true, if set to false then standard rules apply
*/
'qem_registration_always_confirm_admin',
<?php
/*
Plugin Name: Test Shortcode
Plugin URI: https://fullworks.net
Description: Test Shortcode Gutenberg content
Version: 1.0
Author: alan
Author URI: https://fullworks.net
License: GPL2
@alanef
alanef / Plugin
Last active December 23, 2020 11:00
<?php
/*
Plugin Name: Custom code
Plugin URI: https://fullworks.net/
Description: Custom code
Version: 1.0
Author: Alan
Author URI: https://fullworks.net/
License: GPL2
*/
@alanef
alanef / ex.php
Last active November 22, 2020 16:13
Example
/* before doing this check if $_GET['event_id'] is set e.g.
if ( ! isset($_GET['event_id']) {
// return or do error stuff
}
*/
$event_id=sanitize_text_field($_GET['event_id']);
$event_id=wp_unslash($event_Id);
$date = get_post_meta($event_id, '_mdjm_event_date', true );
@alanef
alanef / audio html
Created November 26, 2020 18:39
HTML 5 Audio
<audio id="myRing">
<source src="/path/to/ringring.mp3">
</audio>
<a onclick="document.getElementById('myRing').play()"><img src="https://myphone.png"></a>
const find = require('local-devices');
const fetch = require('node-fetch');
let heatpumpIPs = [];
const getHeatpumps = () => find().then( async devices => {
for ( let i = 0; i < devices.length; i++) {
try {
let response = await fetch('http://' + devices[i].ip + '/common/basic_info')
let isHeatpump = await response.ok
<?php
/*
* Plugin Name: Clean media files in trash
*
* Plugin URI: https://fullworks.net/products/the-webinar-toolkit/
* Description: add define('EMPTY_MEDIA_TRASH_DAYS', 7); to wp-config.php
* Version: 1.0
* Author: Fullworks
* Author URI: https://fullworks.net/
* Licence: GPL 2 or later
#!/bin/bash -xv
echo "Deploy to WordPress SVN"
pattern="*.zip"
files=( $pattern )
[ "${files[0]}" == "*.zip" ] && { echo "Error: No zip file found"; exit 1; }
echo "Plugin zip file found ${files[0]}"
search="-free"
rootdir=${files[0]%$search*}
echo $rootdir
dir='workdir'