Forked from louisreingold/gist:1ef75e6b3623c5c66e4443dc762bfd52
Created
April 28, 2018 12:03
-
-
Save kendichev/ec829e8b3a531abd50ecf9e29d42a6b7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_action( 'pmxi_saved_post', 'post_saved', 10, 1 ); | |
| function post_saved( $id ) { | |
| global $wpdb; | |
| $pass = get_user_meta( $id, 'xfer_user_pass', true ); | |
| $table = $wpdb->prefix . 'users'; | |
| $wpdb->query( $wpdb->prepare( | |
| " | |
| UPDATE `" . $table . "` | |
| SET `user_pass` = %s | |
| WHERE `ID` = %d | |
| ", | |
| $pass, | |
| $id | |
| ) ); | |
| delete_user_meta( $id, 'xfer_user_pass' ); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment