This file contains hidden or 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
| <label> | |
| <input type="checkbox" onclick="PUM.close(123); jQuery.pm_cookie('pum-123', true, '10 years', '/');" /> | |
| Never Show Again | |
| </label> |
This file contains hidden or 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
| function getPopupIDFromSlug(slug) { | |
| var popups = Object.values(pum_vars.popups); | |
| for(var i = 0; i < popups.length; i++) { | |
| if (popups[i].slug === slug) { | |
| return popups[i].id; | |
| } | |
| } | |
| return null; | |
| } |
This file contains hidden or 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
| (function ($) { | |
| var popupID = 123, | |
| hiddenFieldSelector = '#nf-field-1'; | |
| $(document).on('pumBeforeOpen', '#pum-'+popupID, function () { | |
| var trigger = $.fn.popmake.last_open_trigger[0], | |
| field = $(hiddenFieldSelector); | |
| if (trigger && "" !== trigger.href) { | |
| field.val(trigger.href); |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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() ) { |