wpseek.com
Un motore di ricerca WordPress per sviluppatori e autori di temi



is_random › WordPress Function

Da7.2.0
Deprecaton/a
› is_random ( Nessun parametro )
Vedi:
Ritorna:
  • (bool) Whether the query is for random content.
Definito a:
Codex:

Determines whether the query is for random content.

True for a blog home, archive or search request that includes the random query variable, for example example.com/random/ or example.com/random/category/news/.


Sorgenti

function is_random(): bool {
	global $wp_query;

	if ( ! isset( $wp_query ) ) {
		_doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '7.2.0' );
		return false;
	}

	return $wp_query->is_random();
}