Skip to content

Commit

Permalink
fix bug with presentations import
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Abraham <[email protected]>
  • Loading branch information
cjyabraham committed Jun 13, 2024
1 parent 55a9feb commit c12157b
Showing 1 changed file with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,16 @@
if ( is_array( $pres['presenters'] ) ) {
$p = array();
foreach ( $pres['presenters'] as $presenter ) {
$t = term_exists( $presenter['github'], 'lf-presenter' );
if ( ! $t ) {
$args = array(
'slug' => $presenter['github'],
);
$t = wp_insert_term( $presenter['name'], 'lf-presenter', $args );
if ( array_key_exists( 'github', $presenter ) ) {
$t = term_exists( $presenter['github'], 'lf-presenter' );
if ( ! $t ) {
$args = array(
'slug' => $presenter['github'],
);
$t = wp_insert_term( $presenter['name'], 'lf-presenter', $args );
}
$p[] = $t['term_id'];
}
$p[] = $t['term_id'];
}
wp_set_post_terms( $newid, $p, 'lf-presenter' );
}
Expand Down

0 comments on commit c12157b

Please sign in to comment.