Skip to content

Instantly share code, notes, and snippets.

@alpha1
alpha1 / gist:9421107
Last active August 29, 2015 13:57
Test of filters and adding 'input' in field group for @Alpha's pull request for Co-author's Plus
<?php
if(!function_exists('cap_add_email_privacy_field')){
function cap_add_email_privacy_field( $fields_to_return, $groups ) {
//echo '<pre>';
//print_r($fields_to_return);
//echo '</pre>';
if ( in_array( 'all', $groups ) || in_array( 'contact-info', $groups ) ) {
$fields_to_return['email_privacy'] = array(
'group' => 'contact-info',
@alpha1
alpha1 / gist:4219044
Created December 5, 2012 20:09
Change how PHPlist displays [LISTS]
// Confirm email
// admin/subscriberlib2.php
// LINE 236:
# subscribe to the lists
$lists = '<ul>';
if (isset($_POST['list']) && is_array($_POST["list"])) {
while(list($key,$val)= each($_POST["list"])) {
if ($val == "signup") {
$key = sprintf('%d',$key);
@alpha1
alpha1 / Escape and Evade
Created June 6, 2012 19:32
Escaping function
<?php
function escapeAndEvade($input, $required, $datatype, $removed, $allowed, $whitespace ){
if($input != NULL){
switch($allowed){
case "formatting":
$allowed = "<h1><h2><h3><h4><h5<h6><br><b><i><strong><em><del><cite><code><pre><s><blockquote><ins><p><q>";
break;
case "none":
$allowed = "";
break;