wpseek.com
A WordPress-centric search engine for devs and theme authors



_wp_random_content_sample_clause › WordPress Function

Since7.2.0
Deprecatedn/a
› _wp_random_content_sample_clause ( $post_ids )
Access:
  • private
Parameters:
  • (int[]) $post_ids Post IDs.
    Required: Yes
Returns:
  • (string) SQL clause.
Defined at:
Codex:

Retrieves the SQL clause limiting the random content query to random post IDs.



Source

function _wp_random_content_sample_clause( array $post_ids ): string {
	global $wpdb;

	return "{$wpdb->posts}.ID IN (" . implode( ',', array_map( 'intval', $post_ids ) ) . ')';
}