Skip to content

Instantly share code, notes, and snippets.

@plugin-republic
Last active January 17, 2018 10:37
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/1c175669bee2fb236570ebe651433438 to your computer and use it in GitHub Desktop.
Save plugin-republic/1c175669bee2fb236570ebe651433438 to your computer and use it in GitHub Desktop.
<?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