Function Reference: _cleanup_query_vars

Summary

This function has not been documented yet.

Source Code

function _cleanup_query_vars() {
	// clean out globals to stop them polluting wp and wp_query
	foreach ( $GLOBALS['wp']->public_query_vars as $v )
		unset( $GLOBALS[$v] );

	foreach ( $GLOBALS['wp']->private_query_vars as $v )
		unset( $GLOBALS[$v] );

	foreach ( get_taxonomies( array() , 'objects' ) as $t ) {
		if ( $t->public && ! empty( $t->query_var ) )
			$GLOBALS['wp']->add_query_var( $t->query_var );
	}

	foreach ( get_post_types( array() , 'objects' ) as $t ) {
		if ( is_post_type_viewable( $t ) && ! empty( $t->query_var ) )
			$GLOBALS['wp']->add_query_var( $t->query_var );
	}
}