Description
Popup preview (?popup_preview=...&popup=ID) does not open the popup in v1.22.0.
Steps to Reproduce
- Create any popup in PUM
- Click "Preview" in the admin
- Page loads but popup does not open
Root Cause
Two issues found:
1. Missing client-side handler for admin_debug trigger
The server correctly injects an admin_debug trigger into the popup config when popup_preview is in the URL. However, PUM.triggers is an empty object — no JavaScript code registers a handler for the admin_debug trigger type. The deferred pumInitialized approach from the v1.22.0 fix cannot work if the trigger handler itself does not exist on the client.
2. popmake('open') does not add pum-open CSS class
Calling popmake('open') sets display: block but does not add the pum-open CSS class. This appears to be a regression in v1.22.0.
Environment
- PUM v1.22.0
- WordPress 6.9.4
- PHP 8.1
- Tested on clean setup: logged in as admin, no caching, correct preview hash
Workaround
add_action('wp_footer', function() {
if (!isset($_GET['popup_preview'])) return;
?>
<script>
window.addEventListener('load', function() {
setTimeout(function() {
jQuery('.pum').popmake('open');
}, 500);
});
</script>
<?php
});
Related
This was originally reported in #1181. The fix in v1.22.0 was confirmed as not working — see our comment there. Opening a separate issue for better visibility.
Description
Popup preview (
?popup_preview=...&popup=ID) does not open the popup in v1.22.0.Steps to Reproduce
Root Cause
Two issues found:
1. Missing client-side handler for
admin_debugtriggerThe server correctly injects an
admin_debugtrigger into the popup config whenpopup_previewis in the URL. However,PUM.triggersis an empty object — no JavaScript code registers a handler for theadmin_debugtrigger type. The deferredpumInitializedapproach from the v1.22.0 fix cannot work if the trigger handler itself does not exist on the client.2.
popmake('open')does not addpum-openCSS classCalling
popmake('open')setsdisplay: blockbut does not add thepum-openCSS class. This appears to be a regression in v1.22.0.Environment
Workaround
Related
This was originally reported in #1181. The fix in v1.22.0 was confirmed as not working — see our comment there. Opening a separate issue for better visibility.