term user is not required
This commit is contained in:
parent
1cb7f118d6
commit
8e5f52872d
|
@ -77,7 +77,7 @@ class Terms extends Repository {
|
||||||
'description' => __( 'The term creator', 'tainacan' ),
|
'description' => __( 'The term creator', 'tainacan' ),
|
||||||
'on_error' => __( 'The user is empty or invalid', 'tainacan' ),
|
'on_error' => __( 'The user is empty or invalid', 'tainacan' ),
|
||||||
'default' => get_current_user_id(),
|
'default' => get_current_user_id(),
|
||||||
'validation' => v::numeric(),
|
//'validation' => v::numeric(),
|
||||||
],
|
],
|
||||||
'header_image_id' => [
|
'header_image_id' => [
|
||||||
'map' => 'termmeta',
|
'map' => 'termmeta',
|
||||||
|
@ -222,7 +222,6 @@ class Terms extends Repository {
|
||||||
|
|
||||||
foreach ( $terms as $term ) {
|
foreach ( $terms as $term ) {
|
||||||
$tainacan_term = new Entities\Term( $term );
|
$tainacan_term = new Entities\Term( $term );
|
||||||
$tainacan_term->set_user( get_term_meta( $tainacan_term->get_id(), 'user', true ) );
|
|
||||||
$return[] = $tainacan_term;
|
$return[] = $tainacan_term;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -230,8 +229,6 @@ class Terms extends Repository {
|
||||||
} elseif ( is_numeric( $args ) && ! empty( $cpt ) && ! is_array( $cpt ) ) { // if an id is passed taxonomy cannot be an array
|
} elseif ( is_numeric( $args ) && ! empty( $cpt ) && ! is_array( $cpt ) ) { // if an id is passed taxonomy cannot be an array
|
||||||
$wp_term = get_term_by( 'id', $args, $cpt );
|
$wp_term = get_term_by( 'id', $args, $cpt );
|
||||||
$tainacan_term = new Entities\Term( $wp_term );
|
$tainacan_term = new Entities\Term( $wp_term );
|
||||||
$tainacan_term->set_user( get_term_meta( $tainacan_term->get_id(), 'user', true ) );
|
|
||||||
|
|
||||||
return $tainacan_term;
|
return $tainacan_term;
|
||||||
} else {
|
} else {
|
||||||
return [];
|
return [];
|
||||||
|
|
Loading…
Reference in New Issue