Skip to content

Instantly share code, notes, and snippets.

View danieliser's full-sized avatar

Daniel L. Iser danieliser

View GitHub Profile
@danieliser
danieliser / plugin-privacy-user-data-exporter.php
Last active May 17, 2018 03:42
Add support to your plugin or theme for WordPress Personal Data Exporter (GDPR Compliancy).
<?php
/**
* Register exporter for Plugin user data.
*
* @see https://github.com/allendav/wp-privacy-requests/blob/master/EXPORT.md
*
* @param $exporters
*
* @return array
@danieliser
danieliser / non-integrated-ajax-form-success.js
Last active December 3, 2020 06:15
Add support for non integrated form plugins inside Popup Maker. Methods for AJAX & Non-AJAX forms available.
/**
* If your forms process submissions via ajax/javascript this is the method you will need to use.
*
* The following function will handle everything on the Popup Maker side.
* You just need to get your form plugin to call this function when succesffully submitted with the popup ID field.
*
* Example usages. Read below to learn how to complete the full solution for your form plugin.
*
* Mileage will vary as every form & plugin does this in a different way.
* You will need to find out how to do something on successful submission.
@danieliser
danieliser / custom-mass-link-trigger.js
Last active May 27, 2021 19:59
Add a mass click trigger to many links and insert that links url into the popup forms field, then on submission redirect to specific url.
@danieliser
danieliser / console.js
Created December 6, 2017 21:26
Paste this in your console on the attendees page of a WordCamp site to export a CSV of attendees for filtering and use in determining who you need to follow up with.
function JSONToCSVConvertor(JSONData, ReportTitle, ShowLabel) {
//If JSONData is not an object then JSON.parse will parse the JSON string in an Object
var arrData = typeof JSONData != 'object' ? JSON.parse(JSONData) : JSONData;
var CSV = '';
//Set Report title in first row or line
CSV += ReportTitle + '\r\n\n';
@danieliser
danieliser / review-api-report-queries.sql
Created December 3, 2017 17:53
Several queries used to pull review tracking data.
/**
* Returns count of unique site/user combinations.
*/
SELECT count(DISTINCT(uuid)) FROM `pmapi_pum_reviews`
/**
* Get count of each reason.
* Use Having to limit these results or pivot the table.
*/
SELECT `reason`, COUNT(*) FROM `pmapi_pum_reviews` GROUP BY `reason`
@danieliser
danieliser / scan-popup-content-for-dependencies.php
Last active November 26, 2017 06:33
Scan popup maker content to load content dependencies
<?php
// Copy below this line to your php file.
// ----------------------------------------------------------------------------
add_action( 'popmake_preload_popup', 'pum_14_force_preload_content_scan' );
function pum_14_force_preload_content_scan( $popup_id ) {
$popup = get_post( $popup_id );
do_shortcode( $popup->post_content );
}
@danieliser
danieliser / custom.js
Created August 14, 2017 19:49
Override the popup close method with one that doesn't fade out.
jQuery(document).ready(function () {
setTimeout(function () {
jQuery.fn.popmake.close = function (callback) {
return this.each(function () {
var $popup = PUM.getPopup(this),
$container = $popup.popmake('getContainer'),
$close = $popup.popmake('getClose').add($('.popmake-close', $popup).not($popup.popmake('getClose')));
$popup.trigger('pumBeforeClose');
@danieliser
danieliser / functions.php
Created August 10, 2017 06:54
Add custom fields to the Popup Maker MailChimp Integration Forms.
<?php
// Only copy below this line.
// -------------------------------------------------------------
/**
* Register a custom attribute or more. This is useful to limit where your custom fields appear.
*/
add_filter( 'pum_sub_form_shortcode_defaults', 'custom_pum_mc_shortcode_atts' );
@danieliser
danieliser / Set Cookie on Form Submit and Close
Last active February 1, 2023 03:44 — forked from rgadon107/Set Cookie on Form Submit and Close
Custom function to pass in a jQuery script to set a cookie via manual JS during 'on_click' trigger event and on form close.