wpseek.com
WordPress开发者和主题制作者的搜索引擎



_wp_random_content_sample_clause › WordPress Function

Since7.2.0
已弃用n/a
› _wp_random_content_sample_clause ( $post_ids )
访问:
  • private
参数:
  • (int[]) $post_ids Post IDs.
    Required: Yes
返回:
  • (string) SQL clause.
定义在:
文档:

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



源码

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

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