Skip to content

Commit

Permalink
Update ocadu-illustration.php (#7)
Browse files Browse the repository at this point in the history
* Update ocadu-illustration.php

* fix
  • Loading branch information
garrying authored Apr 30, 2024
1 parent 51f30ca commit cf8129a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ocadu-illustration.php
Original file line number Diff line number Diff line change
Expand Up @@ -348,12 +348,13 @@ function set_default_term_for_new_post( $post_id, $post ) {
if ( 'illustrator' === $post->post_type ) {
$taxonomy = 'gradyear';
$term_args = array(
'taxonomy' => $taxonomy,
'order' => 'DESC',
'parent' => 0,
'number' => 1,
'hide_empty' => false,
);
$recent_term = get_terms( $taxonomy, $term_args );
$recent_term = get_terms( $term_args );
if ( ! empty( $recent_term ) && ! is_wp_error( $recent_term ) ) {
wp_set_object_terms( $post_id, $recent_term[0]->term_id, $taxonomy, true );
}
Expand Down

0 comments on commit cf8129a

Please sign in to comment.