webberzone.dev Recent

BasePress_Importer class

BasePress_Importer

Imports content from the BasePress plugin.

CPT: knowledgebase | Taxonomy: knowledgebase_cat Term hierarchy: parent=0 → wzkb_product; parent>0 → wzkb_category Article URL: /{kb_slug}/{product}/{section}/{article}/

Namespace: WebberZone\Knowledge_Base\Admin\Importers
Since: 3.1.0
Source: includes/admin/importers/class-basepress-importer.php line 24 Extends: Base_Importer

Methods

get_label()

{@inheritDoc}

Line: 87

public function get_label(  ): string;

Returns: string

get_slug()

{@inheritDoc}

Line: 94

public function get_slug(  ): string;

Returns: string

get_source_settings()

{@inheritDoc}

Line: 109

public function get_source_settings(  ): array;

Returns: array

get_post_count()

{@inheritDoc}

Line: 141

public function get_post_count(  ): int;

Returns: int

get_term_count()

{@inheritDoc}

Line: 156

public function get_term_count(  ): int;

Returns: int

import_terms()

{@inheritDoc}

Two passes:

  1. parent=0 terms → wzkb_product
  2. child terms → wzkb_category with product_id term meta

Line: 174

public function import_terms(  ): array;

Returns: array

import_posts_batch()

{@inheritDoc}

Line: 307

public function import_posts_batch( int $offset, int $batch_size ): array;
TypeNameDescription
int$offsetPagination offset.
int$batch_sizeNumber of posts to process.

Returns: array

finalize_import()

{@inheritDoc}

  • Sets kb_slug to match the BasePress entry page path.
  • Replaces the entry page content with [knowledgebase] shortcode so it renders the KB at the original URL without clashing with CPT rewrites.
  • Sets article_permalink to preserve article URLs after deactivation.

Since: 3.1.0
Line: 386

public function finalize_import(  ): void;

Returns: void

get_before_import_notices()

{@inheritDoc}

Line: 438

public function get_before_import_notices(  ): array;

Returns: array

get_preview_data()

{@inheritDoc}

Extends the base preview with products, sections, ratings, entry page detail, and structured sections showing taxonomy, meta, and settings mappings.

Since: 3.1.0
Line: 452

public function get_preview_data(  ): array;

Returns: array