'closed', 'ping_status' => 'closed', 'post_content' => '', 'post_status' => 'publish', 'post_title' => 'seedprod', 'post_type' => $cpt, 'post_name' => $slug, 'meta_input' => array( '_seedprod_page' => true, '_seedprod_page_uuid' => wp_generate_uuid4(), ), ), true ); // update post because wp screws our json settings global $wpdb; $tablename = $wpdb->prefix . 'posts'; $r = $wpdb->update( $tablename, array( 'post_content_filtered' => json_encode( $csp4_template ), ), array( 'ID' => $id ), array( '%s', ), array( '%d' ) ); if ( $type == 'cs' ) { update_option( 'seedprod_coming_soon_page_id', $id ); } if ( $type == 'mm' ) { update_option( 'seedprod_maintenance_mode_page_id', $id ); } // do we need to show it? update_option( 'seedprod_csp4_imported', true ); update_option( 'seedprod_show_csp4', true ); // flush rewrite rules flush_rewrite_rules(); } update_option( 'seedprod_migration_run_once', true ); } } catch ( Exception $e ) { return $e; } }