https://github.com/generoi/popups-extended
Wordpress plugin extending popups.
https://github.com/generoi/popups-extended
Last synced: 24 days ago
JSON representation
Wordpress plugin extending popups.
- Host: GitHub
- URL: https://github.com/generoi/popups-extended
- Owner: generoi
- Created: 2017-05-21T21:05:19.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2025-04-25T15:22:19.000Z (about 1 year ago)
- Last Synced: 2025-12-26T06:16:10.649Z (6 months ago)
- Language: PHP
- Homepage:
- Size: 575 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# popups-extended
> A Wordpress plugin that extends [popups](https://wordpress.org/plugins/popups/) primarily with Timber support, but also minor feature additions.
## Features
- Foundation reveal HTML by default.
- Easily overridable php or twig templates.
- [`wp-genero-analytics`](https://github.com/generoi/wp-genero-analytics) integration for conversions.
- TinyMCE buttons for conversion buttons (tracked through `wp-genero-analytics`).
- Exit intent trigger using [Bounceback](https://github.com/AMKohn/bounceback).
- AJAX based Gravityforms get automatic integration while redirected forms have to be tracked through URL parameters.
- Popup background image option.
## Overriding the `popup.php` template
The default template can be overridden in your theme using any of the following template suggestions:
popups/popup--.twig
popups/popup-.php
popups/popup.twig
popups/popup.php
## API Filters
#### Templates
```php
// Filter the Popup content
add_filter('spu/popup/content', function ($content, $post) {
}, 10, 2);
// Filter the popup template suggestions.
add_filter('spu_template_hierarchy', function ($templates) {
foreach ($templates as $idx => $template) {
$templates[$idx] = str_replace('popups/', '', $template);
}
return $templates;
}, 10, 2);
// Filter the resolved template path.
add_filter('spu_template', function ($template) {
});
// Filter the template to be included if available
add_filter('spu_template_include', function ($template) {
});
```
#### Popup options
```php
// Filter the popup types
add_filter('popups-extended/types', function ($types) {
$types['popup'] = __('Popup');
$types['slidein'] = __('Slide-in');
return $types;
});
// Filter the themes.
add_filter('popups-extended/themes', function ($themes) {
$themes['primary'] = __('Primary');
return $themes;
});
// Filter the popup sizes.
add_filter('popups-extended/sizes', function ($sizes) {
unset($sizes['tiny']);
return $sizes;
});
// Filter the popup positions.
add_filter('popups-extended/positions', function ($positions) {
$positions['left'] = __('Left');
return $positions;
});
```