This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var was_closed = false; | |
jQuery(window).on('scroll', function () { | |
var footer = jQuery('#footer'), | |
footer_is_visible = footer.offset().top - jQuery(window).scrollTop() < footer.height(), | |
popup = PUM.getPopup(123), | |
popup_is_open = popup.hasClass('pum-active'); | |
if (popup_is_open && footer_is_visible) { | |
PUM.close(123); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery('#pum-123') | |
.on('pumAfterOpen', function () { | |
jQuery('#some-button-id').addClass('popup-is-open'); | |
}) | |
.on('pumAfterClose', function () { | |
jQuery('#some-button-id').removeClass('popup-is-open'); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/****************************************************************************** | |
* @Copyright (c) 2018, Code Atlantic * | |
******************************************************************************/ | |
if ( ! defined( 'ABSPATH' ) ) { | |
exit; | |
} | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'init', 'my_custom_function' ); | |
function my_custom_function () { | |
$popups = get_posts( array( 'post_type' => 'popup' ) ); | |
foreach( $popups as $popup ) { | |
$popup = pum_get_popup( $popup->ID ); | |
// Do stuff with $popup. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Return the default suggested privacy policy content. | |
* | |
* @return string The default policy content. | |
*/ | |
function plugin_get_default_privacy_content() { | |
return | |
'<h2>' . __( 'What personal data we collect and why we collect it' ) . '</h2>' . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Register eraser for Plugin user data. | |
* | |
* @param array $erasers | |
* | |
* @return array | |
*/ | |
function plugin_register_erasers( $erasers = array() ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Register exporter for Plugin user data. | |
* | |
* @see https://github.com/allendav/wp-privacy-requests/blob/master/EXPORT.md | |
* | |
* @param $exporters | |
* | |
* @return array |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Customize the click selector (.pdf-link). Elements targeted by this script should not be set up as normal click triggers. | |
// This effectively acts as the click trigger. | |
jQuery(document).on('click', '.pdf-link', function (e) { | |
var popupID = 123, // Popup ID # | |
linkFieldName = 'link_field_name_attr', // Form field name="" value. | |
// Stop editing below this line. | |
// --------------------------------------- | |
$popup = PUM.getPopup(popupID), // Change this to your popup ID. | |
$i |