Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save danieliser/3c2402450799af9e84d59a16c7a86d57 to your computer and use it in GitHub Desktop.
Save danieliser/3c2402450799af9e84d59a16c7a86d57 to your computer and use it in GitHub Desktop.
<?php
add_action( 'init', 'my_custom_function' );
function my_custom_function () {
$popups = get_posts( array( 'post_type' => 'popup' ) );
foreach( $popups as $popup ) {
$popup = pum_get_popup( $popup->ID );
// Do stuff with $popup.
$popup->update_setting( 'position_top', 10 ); // Set to 10px from top position.
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment