Skip to content

Instantly share code, notes, and snippets.

@greenhornet79
Created July 26, 2023 16:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save greenhornet79/b27b7deb8a1f837b1911adbafc48409f to your computer and use it in GitHub Desktop.
Save greenhornet79/b27b7deb8a1f837b1911adbafc48409f to your computer and use it in GitHub Desktop.
restore a leaky paywall level
<?php
add_action ('admin_init', 'zeen_restore_level_by_id' );
function zeen_restore_level_by_id() {
$settings = get_leaky_paywall_settings();
$level_id = 1; // the id of the level you want to restore
$settings['levels'][$level_id]['deleted'] = 0; // this will "undelete" the level
update_leaky_paywall_settings( $settings );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment