| @@ -67,14 +67,13 @@ | ||
| 67 | 67 | $results['template_types'][] = $template_settings['type']; |
| 68 | 68 | |
| 69 | 69 | if ( $template_settings['type'] === 'archive' || $template_settings['type'] === 'product_archive' || $template_settings['type'] === 'course_archive' ) { |
| 70 | 70 | $page_id = $this->create_archive_page( $template_settings, $this->manifest['platform'] ); |
| 71 | - if ( $page_id && isset($template_settings['page_settings']['archive_page_id']) ) { | |
| 72 | - $archive_page_id = $template_settings['page_settings']['archive_page_id']; | |
| 73 | - $_extra_pages['archive_settings'][$archive_page_id] = [ | |
| 71 | + if ( $page_id ) { | |
| 72 | + $_extra_pages['archive_settings'] = [ | |
| 74 | 73 | 'old_id' => $id, |
| 75 | 74 | 'page_id' => $page_id, |
| 76 | - 'archive_id' => $archive_page_id | |
| 75 | + 'archive_id' => $import['id'] | |
| 77 | 76 | ]; |
| 78 | 77 | } |
| 79 | 78 | } |
| 80 | 79 | |
| @@ -168,13 +167,8 @@ | ||
| 168 | 167 | * @return false|int |
| 169 | 168 | */ |
| 170 | 169 | private function create_archive_page( $template_settings, $platform ) { |
| 171 | 170 | try { |
| 172 | - $archive_page_id = $template_settings['page_settings']['archive_page_id'] ?? null; | |
| 173 | - if($archive_page_id && !empty($this->manifest['content']['page'][$archive_page_id])){ | |
| 174 | - return false; | |
| 175 | - } | |
| 176 | - | |
| 177 | 171 | $type = $template_settings['type']; |
| 178 | 172 | |
| 179 | 173 | $archive_page = wp_insert_post( [ |
| 180 | 174 | 'post_title' => $template_settings['title'] ?? ucfirst( $type ) . ' - (by Templately)', |