How to put an array in wp user query

This sounds like a job for the wp_parse_id_list() function. It will return an array of unique IDs, sanitized with the absint() function: $csv = bp_get_following_ids(); if( 0 !== $csv ) ) { $uids = wp_parse_id_list( $csv ); $user_query = new WP_User_Query( [ ‘include’ => $uids ] ); } where we assume that bp_get_following_ids() returns a … Read more

wp_generate_attachment_metadata for non-images files

wp_generate_metatadata() should create metadata for image, video, and audio file types. There is and if/elseif conditional in the source that limits the function to those three. However, the last line is: return apply_filters( ‘wp_generate_attachment_metadata’, $metadata, $attachment_id ); So you could use the wp_generate_attachment_metadata filter to generate the metadata you want. There are plenty of answers … Read more

Array is not working in Filter?

You cannot define something outside a function and then simply try to use it inside the function without calling it into the function. This is basic PHP and how functions work in general. You need to pass that specific something to the function or define that something inside the function or use a method to … Read more

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