bp_core_get_all_posts_for_user( int $user_id )

Fetch every post that is authored by the given user for the current blog.


Description Description

No longer used in BuddyPress.


Top ↑

Parameters Parameters

$user_id

(int) (Required) ID of the user being queried.


Top ↑

Return Return

(array) Post IDs.


Source Source

File: bp-members/bp-members-functions.php

function bp_core_get_all_posts_for_user( $user_id = 0 ) {
	global $wpdb;

	if ( empty( $user_id ) ) {
		$user_id = bp_displayed_user_id();
	}

	return apply_filters( 'bp_core_get_all_posts_for_user', $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM {$wpdb->posts} WHERE post_author = %d AND post_status = 'publish' AND post_type = 'post'", $user_id ) ) );
}


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.