You appear to be a bot. Output may be restricted
Description
Copy oik options for alt= to user=This function is used during the initial setup of oik-user Some options that don't (yet) apply to the user may get copied but we don't consider this to be a problem. There is no checking that the user options are not already set. So this function can override the user's settings.
Usage
oiku_copy_settings_to_user( $alt, $user_id );
Parameters
- $alt
- ( string ) required – source options
- $user_id
- ( integer ) required – user ID
Returns
voidSource
File name: oik-user/admin/oik-user.phpLines:
1 to 31 of 31
function oiku_copy_settings_to_user( $alt, $user_id ) { p( "Copying settings from alt=$alt to user=$user_id" ); $sets = array ( "bw_options" , "bw_options1" , "bw_options2" ); $set = $sets[$alt]; $new_options = get_option( $set ); $options = bw_get_user_meta( $user_id ); /** * Deal with the fields that get stored separately as "User contact" fields * by extracting them from the $new_options structure */ $new_options['twitter'] = oiku_simplify_social( $new_options, 'twitter' ); oiku_set_user_contact_user_meta( $user_id, $new_options, "twitter" ); oiku_set_user_contact_user_meta( $user_id, $new_options, "facebook" ); oiku_set_user_contact_user_meta( $user_id, $new_options, "linkedin" ); oiku_set_user_contact_user_meta( $user_id, $new_options, "googleplus" ); oiku_set_user_contact_user_meta( $user_id, $new_options, "youtube" ); oiku_set_user_contact_user_meta( $user_id, $new_options, "flickr" ); oiku_set_user_contact_user_meta( $user_id, $new_options, "picasa" ); oiku_set_user_contact_user_meta( $user_id, $new_options, "skype" ); bw_update_user_meta( $user_id, "bw_options", $new_options, $options ); // p( "Options copied. See "Users" to verify/update values ); }View on GitHub