Need help getting a certain value out of a multi dimensional array

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; } } } var_dump($options); This should dump all the options that maybe are in there. … Read more

Trying to get custom post type attachment images to function in indexed array

Managed to find a solution that display the array correctly: $attachments = get_children( array( ‘post_parent’ => get_the_ID(), ‘post_type’ => ‘attachment’, ‘numberposts’ => -1, ‘post_status’ => ‘inherit’, ‘post_mime_type’ => ‘image’, ‘order’ => ‘ASC’, ‘orderby’ => ‘menu_order ASC’ ) ); $imgArray = array(); $counter = 0; foreach ( $attachments as $attachment_id => $attachment ) { $imgArray[$counter] = … Read more

List users of specific role instead of removing them with specific role

To fetch users from a specific role, you can use the role parameter of the get_users function. Each role has a specific ID; for WordPress’ native roles, these are administrator, editor, author, contributor and subscriber. In your case, you would want to fetch only subscriber users: $allUsers = get_users( array( ‘orderby’ => ‘post_count’, ‘order’ => … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)