我有一个Python function wp_set_password( $password, $user_id ) {
// Keep original WP code
global $wpdb;
$hash = wp_hash_password( $password );
$wpdb->update(
$wpdb->users,
array(
'user_pass' => $hash,
'user_activation_key' => '',
),
array( 'ID' => $user_id )
);
wp_cache_delete( $user_id, 'users' );
// and now add your own
$custom_hash = password_hash( $password, PASSWORD_DEFAULT );
update_user_meta($user_id, 'user_pass2', $custom_hash);
}
,我想将其用作列的查找表,用该查找表中的相应值替换该列中的每个值。所以我想做这样的事情:
dict
是否可以自己不动态生成所有SQL?