BBP_User_Engagements_User::get_query( array $args = array(),  $context_key = '', string $meta_key = '', string $meta_type = 'post' )

Get the part of the query responsible for JOINing objects to relationships.


Description Description


Parameters Parameters

$args

(Optional)

Default value: array()

$meta_key

(Optional)

Default value: ''

$meta_type

(Optional)

Default value: 'post'


Top ↑

Return Return

(array)


Top ↑

Source Source

File: includes/common/engagements.php

	public function get_query( $args = array(), $context_key = '', $meta_key = '', $meta_type = 'post' ) {
		$user_id    = bbp_get_user_id( $args, true, true );
		$option_key = $this->get_user_option_key( $meta_key );
		$object_ids = $this->parse_comma_list( get_user_option( $option_key, $user_id ) );

		// Maybe trick WP_Query into ".ID IN (0)" to return no results
		if ( empty( $object_ids ) ) {
			$object_ids = array( 0 );
		}

		// Maybe include these post IDs
		$args = array(
			'post__in' => $object_ids
		);

		// Parse arguments
		return bbp_parse_args( $args, array(), $context_key );
	}

Top ↑

Changelog Changelog

Changelog
Version Description
2.6.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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