original_string: 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;
  	}
code: 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;
  	}
code_tokens: 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 ; }
docstring: Get archive where.
  
  @param string $where SQL where.
  @param array  $r Argument in wp_get_archives.
  
  @return mixed|string
docstring_tokens: Get archive where .