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 | |
| /** | |
| * Popup Maker Position Fix | |
| * | |
| * Adjusts the position of a specific popup after it opens. | |
| * | |
| * Useful when a theme or other pluging messes up the popup's default positioning. | |
| * | |
| * Usage: Add this code to your theme's functions.php or a custom plugin. | |
| * - Update the popup ID (10349) to match your 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 | |
| /** | |
| * Requirements | |
| * | |
| * 1. Initial Display | |
| * - Given I am a non-logged-in visitor | |
| * - When I spend (e.g.,) 5 cumulative minutes on the site (across page views) | |
| * - Then the popup appears | |
| * 2. Repetition After Close | |
| * - Given the popup has been displayed and I close it |
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 | |
| /** | |
| * Make Popup Maker's Enabled column sortable | |
| */ | |
| // Add 'enabled' to sortable columns | |
| add_filter( 'manage_edit-popup_sortable_columns', function( $columns ) { | |
| $columns['enabled'] = 'enabled'; | |
| return $columns; | |
| }, 20 ); |
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 | |
| /** | |
| * Stop (pause) and audio file when you close its popup. | |
| */ | |
| function stop_audio_on_close() { ?> | |
| <script type="text/javascript"> | |
| jQuery(document).ready(function ($) { | |
| // Change this to your popup ID. | |
| const POPUP_ID = '#pum-855'; |
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 // Ignore this first line when copying to your child theme's functions.php file. | |
| /** | |
| * Dynamically display a WooCommerce product inside a Popup Maker popup. | |
| * | |
| * Pass in the product ID using the classes attribute for the popup_trigger | |
| * shortcode. See usage notes below. | |
| */ | |
| function rc_ajax_demo_js() { ?> | |
| <script type="text/javascript"> |
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 | |
| /** | |
| * Close a popup when you submit a Fluent Forms Conversational Form inside that popup. | |
| * | |
| * Watches for a specific element (".ff_conv_app_4 .text-success") being added to the DOM. | |
| * When detected, waits 2 seconds and then closes Popup Maker popup #441 if available. | |
| * | |
| * @since 1.0.0 | |
| * | |
| * @return void |
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 | |
| /** | |
| * PHP to get popup IDs from ACF and render them in a data attribute. | |
| * | |
| * This code should be placed in your theme's header.php, footer.php, | |
| * or a specific template file, usually within the <body> but **before** | |
| * the JS code that uses the popup IDs. | |
| * | |
| * This code example creates a <div> to store the popup IDs just before | |
| * the popup's HTML. It does that because the hook's priority is set to 10. |
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
| /** | |
| * Install custom JS to the footer of your WP posts and pages. | |
| * | |
| * This SAMPLE code adds a JavaScript function to detect Google Pixel phones. | |
| * It uses the WordPress wp_footer action hook to safely inject the script. | |
| * | |
| * Installation: | |
| * 1. Create a child theme if you don't have one | |
| * 2. Add this code to your child theme's functions.php file | |
| * 3. Or use the Code Snippets plugin for easier management |
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 // Ignore this first line when copying to your child theme's functions.php file. | |
| // Test utility | |
| add_action('admin_notices', function() { | |
| // Only show on popup edit screen after saving. | |
| if (!isset($_GET['post']) || get_post_type($_GET['post']) !== 'popup') { | |
| return; | |
| } | |
| // Display the last saved time from a transient. |
NewerOlder