Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?php
/**
* Demo function to show wisdom_create_new_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_new_item( $item_id, $post_params ) {
update_option( 'my_test_new_item', 'New item ID is ' . sanitize_text_field( $item_id ) );
if( isset( $post_params['email'] ) ) {
update_option( 'my_test_new_email', 'New email address is ' . sanitize_email( $post_params['email'] ) );
}
}
add_action( 'wisdom_create_new_item', 'showcase_wisdom_new_item', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment