Emberly Popups
Emberly Popups is a simple PHP function that generates ARIA‑compliant modal popups. Great for newsletters, surveys, announcements, or any call‑to‑action:
- Auto‑open after a configurable delay
- Cookie‑ or session‑based “show once” control
- Repeat interval (milliseconds) between popups
- Shortcode support inside popup content
- Adjustable width and padding
- Accessible markup with proper ARIA roles
Usage
PHP 8+ (named arguments)
“`php
emberly_popup(
title : ‘Welcome!’,
content : ‘
Thanks for visiting our site. Don’t miss our latest offers!
‘, Thanks for visiting our site. Don't miss our latest offers!
id : ‘welcome-popup’,
width : ’50rem’,
padding : ‘3rem’,
echo : true,
output_shortcodes: true,
auto_open : true,
delay : 2000,
show_once : false,
persistence_method: ‘session’,
show_interval_ms : 1800000 // 30 minutes
);
PHP 7 & earlier (ordered arguments)
```php
emberly_popup(
'', // $title
'
'category-survey-popup', // $id
'50rem', // $width
'3rem', // $padding
true, // $echo
true, // $output_shortcodes
true, // $auto_open
2000, // $delay
false, // $show_once
'session', // $persistence_method
1800000 // $show_interval_ms
);
Manual triggers
Anywhere in your markup, add:
html
Open Welcome Popup
The em-popup-trigger-id value must match the $id you set in emberly_popup().
Parameters
Parameter
Type
Default
Description
title
string
”
Popup heading text.
content
string
”
HTML for the popup’s body.
id
string
”
Unique popup identifier (required for cookies/sessions & triggers).
width
string
’60rem’
CSS max-width for the popup container.
padding
string
‘3rem’
Inner padding inside the popup.
echo
bool
true
Echo the markup immediately (false to return as string).
output_shortcodes
bool
false
Process WordPress shortcodes in content.
auto_open
bool
false
Automatically open after delay ms.
delay
int
0
Milliseconds to wait before auto-open.
show_once
bool
false
If true, shows only once per session/cookie period.
persistence_method
string
‘cookie’
Where to store “shown” flag: ‘cookie’ or ‘session’.
show_interval_ms
int
0
Minimum interval (ms) before showing again. 0 disables repeats.
debug
bool
false
Log internal events to browser console (load, open, cookies, scroll lock).
Debugging
Add debug: true (PHP 8+) or append true as the 13th argument (PHP 7) to enable console logging:
`php
// PHP 8+ example
emberly_popup(
title : ‘Debug Popup’,
content: ‘
Debugging is on!
‘,
id : ‘debug-popup’,
debug : true
);
`
| Domain | Exposures | Headers | Last Checked |
|---|---|---|---|
| h*m*r.com | F | 2026-06-16 10:39:22 | |
| m*c*m*-*t*l*i*w*r*s.org (WP 6.9.4) | F | 2026-06-10 07:42:12 | |
| m*d*r*h*d*o*e*.com (WP 6.8.1) | F | 2026-05-29 17:11:10 | |
| c*t*o*f*i*t.com | F | 2026-05-26 11:08:48 | |
| t*r*u*i*e*y*r*g*n.com (WP 6.8.1) | F | 2026-05-23 13:48:14 | |
| t*y*a*p*.com | F | 2026-05-21 17:01:58 | |
| t*y*h*m*r.com | F | 2026-05-21 10:59:18 | |
| m*d*r*e*e*t*o*.com (WP 6.8.1) | F | 2026-05-18 20:26:43 | |
| s*c*e*h*a*t*c*d*m*g*.org (WP 6.9.4) | F | 2026-05-16 18:42:24 | |
| s*g*.org (WP 6.9.4) | F | 2026-05-16 18:42:24 |