Code placement: https://prnt.sc/z3LWrxjZqPhW if( get_post_status($old_id)){ $new_accordion_id = wp_insert_post( array( 'post_title' => isset( $accordion['title'] ) ? $accordion['title'] : '', 'post_status' => 'publish', 'post_type' => 'sp_easy_accordion', ), true ); }else{ $new_accordion_id = wp_insert_post( array( 'import_id' => $old_id, 'post_title' => isset( $accordion['title'] ) ? $accordion['title'] : '', 'post_status' => 'publish', 'post_type' => 'sp_easy_accordion', ), true ); };
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter