Fixing method name
This commit is contained in:
parent
877fd32939
commit
066842bed2
|
@ -67,8 +67,8 @@ class Taxonomy extends Entity {
|
|||
|
||||
|
||||
$tax_cpts = [];
|
||||
if (is_array($this->fetch())){
|
||||
foreach ($this->fetch() as $tax_col){
|
||||
if (is_array($this->get_collections())){
|
||||
foreach ($this->get_collections() as $tax_col){
|
||||
$tax_cpts[] = $tax_col->get_db_identifier();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,31 +7,6 @@ defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
|
|||
|
||||
trait Entity_Collections_Relation {
|
||||
|
||||
public function fetch_ids() {
|
||||
return $this->get_mapped_property('collections_ids');
|
||||
}
|
||||
|
||||
public function fetch() {
|
||||
if (isset($this->collection) && !empty($this->collection) && is_array($this->collection)){
|
||||
return $this->collection;
|
||||
}
|
||||
|
||||
if (is_array($this->fetch_ids()) && !empty(is_array($this->fetch_ids()))) {
|
||||
|
||||
global $Tainacan_Collections;
|
||||
$collections = [];
|
||||
|
||||
foreach ($this->fetch_ids() as $col_id) {
|
||||
$collections[] = $Tainacan_Collections->fetch($col_id);
|
||||
}
|
||||
|
||||
return $collections;
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
public function get_collections_ids() {
|
||||
return $this->get_mapped_property('collections_ids');
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue