wpseek.com
Uma área de pesquisa sobre o WordPress para devs e autores do tema



wp_random_content_post_limits › WordPress Function

Desde7.2.0
Obsoleton/a
› wp_random_content_post_limits ( $limits, $query )
Parâmetros: (2)
  • (string) $limits The LIMIT clause of the query.
    Required: Yes
  • (WP_Query) $query The WP_Query instance.
    Required: Yes
Retorna:
  • (string) The LIMIT clause of the query.
Definido em:
Codex:

Removes the limit of the random content query.

The random content query is limited to random post IDs, one of which is selected once the query has run, see Ver página de detalhe para wp_random_content_posts_pre_query »

" href="https://pt.wpseek.com/function/%5Cwp_random_content_posts_pre_query/">wp_random_content_posts_pre_query
. Added to the Ver página de detalhe para 'post_limits'} filter by {@see WP::handle_random »

" href="https://pt.wpseek.com/function/%26%23039%3Bpost_limits%26%23039%3B%7D+filter+by+%7B%40see+%5CWP%3A%3Ahandle_random/">'post_limits'} filter by {@see WP::handle_random
while the random content query runs. Enforcing the limit in SQL prevents {@see 'pre_get_posts'} callbacks setting the number of posts, offset or page on archives from affecting the selection.


Fonte

function wp_random_content_post_limits( $limits, WP_Query $query ): string {
	if ( wp_is_random_content_query( $query ) ) {
		return '';
	}

	return (string) $limits;
}