Skip to content

Instantly share code, notes, and snippets.

@plugin-republic
Created January 17, 2018 10:39
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 plugin-republic/a4c066dd6c969782d2c3ae370505f09f to your computer and use it in GitHub Desktop.
Save plugin-republic/a4c066dd6c969782d2c3ae370505f09f to your computer and use it in GitHub Desktop.
<?php
/**
* Demo function to show wisdom_deactivate_existing_item hook
*
* @param $item_id Integer The ID of the newly created tracked-plugin post type
* @param $post_params Array All data received from new site
*/
function showcase_wisdom_deactivate_item( $item_id, $post_params ) {
update_option( 'my_test_deactivated_item', 'Item ID is ' . sanitize_text_field( $item_id ) );
if( isset( $post_params['email'] ) ) {
update_option( 'my_test_deactivated_item', 'Email address is ' . sanitize_email( $post_params['email'] ) );
}
}
add_action( 'wisdom_deactivate_existing_item', 'showcase_wisdom_deactivate_item', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment