acf_pro::posts_wherepublicACF 6.2

Filters the $where clause allowing for custom WP_Query args.

Method of the class: acf_pro{}

No Hooks.

Returns

String.

Usage

$acf_pro = new acf_pro();
$acf_pro->posts_where( $where, $wp_query );
$where(string) (required)
The WHERE clause.
$wp_query(WP_Query) (required)
The query object.

Changelog

Since 6.2 Introduced.

acf_pro::posts_where() code ACF 6.8.8

public function posts_where( $where, $wp_query ) {
	global $wpdb;

	$options_page_key = $wp_query->get( 'acf_ui_options_page_key' );

	// Add custom "acf_options_page_key" arg.
	if ( $options_page_key ) {
		$where .= $wpdb->prepare( " AND {$wpdb->posts}.post_name = %s", $options_page_key );
	}

	return $where;
}