Tag Info

New answers tagged

0

Ok I got it working. Not sure what I had wrong first time around but I just copied the first function and replaced order with user. Also included the code to display the field in user profile for reference. function save_passport_to_user_meta( $user_id, $posted ){ // don't forget appropriate sanitization if you are using a different field type ...


0

You can simply update the usermeta just after or before update_post_meta in your code as follows if(is_user_logged_in()){ $user_id = get_current_user_id(); //will work only if the user is logged in (to make sure user login, you can disable guest checkout from WooCommerce settings) update_user_meta( $user_id, '_passport_field', ...


2

There is no tax_query parameter for the WP_User_Query class. Since you've tagged the question with user-meta I can only assume you store the ID (or even the term name itself?) of a particular shop-category term as a user meta entry. In this case you would need something like this: // The 'WP_User_Query' arguments array $args = array( 'role' ...


0

wp_kses_post if you want to allow certain HTML in your textarea/wp editor (safest, as @Bordoni said). esc_textarea is what you might looking for.


0

You can use WP user query. Assuming that your meta_key is authmeta you can use the following code to find the users with meta key authmeta and value of your $var variable. $user_query = new WP_User_Query( array( 'meta_key' => 'authmeta', 'meta_value' => $var ) );


0

Try var_dump(get_user_meta($user->ID, 'wpcf-team-experience-member-type'), true). The third parameter for get_user_meta (called $single) specifies whether to return a single value (true) or an array (false). The default is false.


0

The reason you get the "First" Array is that you don't use the "single" option of the get_user_meta function. Try this: $arr = get_user_meta($user->ID, 'wpcf-team-experience-member-type',true); $options = array(); if(is_array($arr)){ foreach($arr as $key => $value){ foreach($value as $arrvalue){ $options[] = $arrvalue; ...


0

The array is just contain another array that contains the array where the 'student' is located. You can use array_keys() to return all the keys or a subset of the keys of the array and access the string 'student' with integer keys instead of an int-string-int [0]["wpcf-fields-checkboxes-option-f4fe375f6cad3c44eff97e6e6f16deb2-1"][0], like this: $arr = ...


0

You can use this filter: wpmu_blogs_columns More info: https://developer.wordpress.org/reference/hooks/wpmu_blogs_columns/



Top 50 recent answers are included