Hi @pipoulito
Thank you for your reply.
We found the same concern in our Facebook group.
The user created a custom code that allows setting the trigger Time Delay/Auto Open as the default trigger.
Here’s the code:
add_action('save_post', 'handle_pum_creation');
function handle_pum_creation($post_id) {
$post = get_post( $post_id );
if( $post !== null && $post->post_status == 'publish' && $post->post_type == 'popup') {
$popup_settings = get_post_meta( $post_id, 'popup_settings' );
$popup_settings = $popup_settings[0];
if(isset($popup_settings['triggers']) && empty($popup_settings['triggers'])){
$popup_settings['triggers'][0] = [
'type' => 'auto_open',
'settings' => [
'delay' => 500,
'cookie_name' => [
0 => 'pum-'.$post_id
]
]
];
}
if(isset($popup_settings['cookies']) && empty($popup_settings['cookies'])){
$popup_settings['cookies'][0] = [
'event' => 'on_popup_close',
'settings' => [
'name' => 'pum-'.$post_id,
'time' => '1 month',
'session' => false,
'path' => '1',
'key' => ''
]
];
}
update_post_meta($post_id, 'popup_settings', $popup_settings);
}
}
Reference link.
Kindly try the code and update it according to your needs.
Let us know how that goes. Thank you!