You need to pass author__in
as an array but that isn’t what you doing with this: ( array( 'author__in' => array( $followed ) ) )
. You are creating an odd set of nested arrays. WP_Query
isn’t going to know what to do with it. A much simplified version should work:
$followed = $wpdb->get_col("
SELECT user_id1
FROM wp_um_followers
WHERE user_id2 = 1"
);
$get_these_posts = array(
'post_type' => 'stream',
'post_status' => 'publish',
'posts_per_page' => '10',
'paged' => $paged,
'author__in' => $followed
);
Notice I used get_col()
. That will return a simple array of IDs.
Related Posts:
- Unserializeing multiple column values that are stored in one database results variable
- How to sort results from a custom database table
- WP database error for comments_popup_link()
- Any possible way to make $wpdb->get_results() return anything else than array?
- Accessing the database from a plugin outside of action hooks
- Create WP_Query to search for posts by their categories or their parent/child categories
- SQL error with custom query
- getting the values of hidden inputs to use them in a php mysql query
- How to query a staging database?
- How to make a parent page for author.php?
- Check if values exists DB
- How to print array of specific item
- save array of objects with update_option
- Sorting list of sites from multisite network using wp_get_sites
- How to store the_title() into a variable to reutrn the value, not just echo it
- wpdb::prepare was called incorrectly
- Inserting choice in database table
- How To Make Connection To WordPress Data Base In A Plugin?
- the_author_posts_link css class
- Has anyone tried putting PHP ActiveRecord on WordPress?
- How do I get the author’s page url from their ID?
- How to update single value in multi dimensional Post Meta?
- How to track a users progress through pages by inserting data into WordPress Database?
- Missing Author Information
- my function doesn’t return my post from today
- Display related products with custom output
- How do I dynamically generate args for wp_query?
- How to migrate the posts from an old custom legacy blog to a new WordPress website?
- #1062 – Duplicate entry ‘1’ for key ‘PRIMARY’
- How to create and work with custom data / tables (i.e., for arbitrary data)?
- Multiple choice in a custom taxonomy
- Parsing php string in jquery [closed]
- Prevent Data Resubmission On Page refresh
- Working with query_posts ( arrays and query strings)
- SQL QUERY – Select a value directly from the database
- Get stock by custom meta field on all Woocommerce variable products
- Transferring working local PHP site to wordpress – with database (MySQL)
- How to properly loop through these external URLs to get them into the sitemap using this hook
- Call global variable array() in woocommerce child/template
- Getting id of poll from WP database
- WordPress not reflecting changed of the database
- How can I save unique user data on my site? [closed]
- Using custom tables for old posts
- Alter required message using comment form api
- Odd / Even posts add class minus first post
- Advanced Custom Fields – display label and value only if value entered
- unable to use ‘new WP_Query’ in AJAX call
- wp_force_remove_style’ not found
- How can I import an excel column into wordpress database?
- How to array only one key from another array
- How to add div blocks after certain set of post
- Execute a function every hour in the background
- Create page with custom php script and fetched data
- Why is an array created in a function hooked to customize register populated when customizer is loaded but not when the front-end is loaded?
- Creating Database Table vs. Adding MetaData to Post & User
- WordPress and MySQL: trying to print data using PHP from user_meta custom field data
- Most commented posts by time period (last 12h, last 24h and etc)
- WordPress loop by meta key that is an array? and how loop multiple arrays
- PHP -> SQL Query with Summing
- Set default Database Storage Engine when creating tables with plugins?
- Comapare get_user_meta value
- How can get all users by current user meta?
- Echo array value
- Query pulling a single post per month
- Unserialize Custom Field & Save as Multiple Rows in WordPress Database
- Advanced Query posts
- How can I check that the acf field value is not a duplicate when adding a post?
- Sending simple variable on single page to WP JSON
- My Custom Post Type AJAX Query is Returning no posts – why?
- wp_update_post gives 500 internal error
- why not selecting multiple rows of same standard_id using SQL query from database?
- Show the subcategory name based on current product
- How to filter specific element of an array in wordpress/php?
- wp-login.php?redirect_to=https problem
- Send email to users when they get new followers
- Remove item from post_meta array via AJAX
- Fatal error when using array_diff() function inside of wp_update_nav_menu hook?
- Query doesn’t display text data with apostrophes
- PHP array to jQuery array ” Uncaught SyntaxError: Unexpected token < "
- Display a single row from nested array of custom field data
- Echo multiple tasks if a common function exists
- Accessing external database: ERR_INCOMPLETE_CHUNKED_ENCODING
- AJAX Not Working With WordPress Database properly
- Reformat data within a nested array
- How to find the function which is outputting Array
- How to enqueue assets only on queried pages, excluding the page being queried?
- Create Customization Controls from Array
- Manipulate database of WordPress site with my own scripts
- Problems with plugin that fetches data from database with ajax
- !in_array doesnt recognize category
- Using class id from array for query
- When I use rewind_post() it shows menu items in my loop
- How to pass username into form that sends data to database
- PHP Use Declared array Variable inside already Declared Array
- wp_query on search results page showing all results every time
- Insert into db with foreach problem
- Can WordPress support Website (19GB database) Should I move Our WordPress Website to a custom one using Laravel or any other PHP framework?
- How to initialise WP_Query on the basis of a specific meta_value and continue iterating rest?
- Three different queries on same page
- Can’t insert into a database wordpress