← All changes
|
includes/admin/importers/class-abstract-plugin-exporter.php
+19
-1
2.0.2
→
2.10.0
View file →
| @@ -152,8 +152,26 @@ | ||
| 152 | 152 | return []; |
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | /** |
| 156 | + * Records for a data type outside the fixed set above. | |
| 157 | + * | |
| 158 | + * Nothing to hand over by default. It exists so an exporter can gain a type | |
| 159 | + * (ThinkRank's own export lets Pro register its tables this way) without | |
| 160 | + * every subclass having to reimplement export_chunk()'s chunk writing and | |
| 161 | + * manifest bookkeeping. | |
| 162 | + * | |
| 163 | + * @since 2.2.0 | |
| 164 | + * | |
| 165 | + * @param string $type Data type | |
| 166 | + * @param int $page Page number (1-indexed) | |
| 167 | + * @return array Records | |
| 168 | + */ | |
| 169 | + protected function export_custom_type_page(string $type, int $page): array { | |
| 170 | + return []; | |
| 171 | + } | |
| 172 | + | |
| 173 | + /** | |
| 156 | 174 | * Capture the source plugin's Role Manager assignments: role slug => the |
| 157 | 175 | * capabilities that role holds whose name starts with $prefix. |
| 158 | 176 | * |
| 159 | 177 | * Shared by every exporter because role capabilities live on the roles |
| @@ -271,9 +289,9 @@ | ||
| 271 | 289 | case '404_logs': |
| 272 | 290 | $records = $this->export_404_logs_page($page); |
| 273 | 291 | break; |
| 274 | 292 | default: |
| 275 | - $records = []; | |
| 293 | + $records = $this->export_custom_type_page($type, $page); | |
| 276 | 294 | } |
| 277 | 295 | |
| 278 | 296 | $exported_count = count($records); |
| 279 | 297 | |