public function getarchives_where( $where, $r ) {
		$this->get_archives_where_r = $r;
		if ( isset( $r['post_type'] ) ) {

			if ( ! in_array( $r['post_type'], CPTP_Util::get_post_types(), true ) ) {
				return $where;
			}

			$post_type = get_post_type_object( $r['post_type'] );
			if ( ! $post_type ) {
				return $where;
			}

			if ( ! $post_type->has_archive ) {
				return $where;
			}

			$where = str_replace( '\'post\'', '\'' . $r['post_type'] . '\'', $where );
		}

		if ( isset( $r['taxonomy'] ) && is_array( $r['taxonomy'] ) ) {
			global $wpdb;
			$where = $where . " AND $wpdb->term_taxonomy.taxonomy = '" . $r['taxonomy']['name'] . "' AND $wpdb->term_taxonomy.term_id = '" . $r['taxonomy']['termid'] . "'";
		}

		return $where;
	}