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 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
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 message generated to email confirmation
*
* @param $message
* @param $content
* @param $details
* @param $close
* @param $id
<?php
add_filter(
/**
* Filter the autoresponder content
* this can be used to add custom shortcodes
*
* @param $msg
* @param $id
* @param $payment
*
global $wpdb;
$querystr = "
SELECT $wpdb->posts.ID
FROM $wpdb->posts
WHERE
$wpdb->posts.post_status = 'publish'
AND $wpdb->posts.post_type = 'post
AND ABS(DATEDIFF(CONCAT('2000',SUBSTRING($wpdb->posts.post_date_gmt,5)), CONCAT('2000',SUBSTRING(NOW(),5))))< 16
";
$ids = $wpdb->get_results($querystr, ARRAY_N);
<?php
echo '<a href="?go">Download</a>';
if (isset($_GET['go'])) {
header('Content-Type: text/html; charset=utf-8');
header('Content-Disposition: attachment; filename="out.pdf"');
echo file_get_contents("out.pdf");
}
<?php
/*
Plugin Name: Allow Editor to Manage Options
Plugin URI: https://fullworks.net/
Description: Allow Editor manage_otption capabaility
Author: Alan
*/
add_action( 'init', function () {
$role = get_role( 'editor' );
@alanef
alanef / gist:463e413a1808c07c608b5b11f430e2c3
Last active April 28, 2020 15:43
Styling Calendar list images
/*
* change the image size in cal-list
*/
.wfea-calendar-list .fc-list-item-title div.cal-list-link-wrap div.cal-list-img-wrap img.cal-list {
height: 5em;
}
/*
* go a step further and align everything in the middle
*/
.wfea-calendar-list .fc-list-item td {
@alanef
alanef / functions.php
Last active February 14, 2020 17:50
Change the calendar styles
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//* use the filter wfea_cal_options for the list view
//* the following example removes the event time
//* changes background to black
//* sets the pop up to youtube style
//* see full list of options here
@alanef
alanef / style.css
Last active February 1, 2021 22:28
/* ---- Style the calendar header ---- */
/* fix for somethemes that add margin to the end of all tables */
.wfea-calendar table {
margin-bottom: 0;
}
/* add color to the top row */
.wfea .fc-toolbar.fc-header-toolbar {
color: #fff;
background: #0c3a5b;