webberzone.dev Recent

Link_Rewriter class Pro only

Link Rewriter class.

Namespace: WebberZone\Knowledge_Base\Pro\GitHub
Since: 3.1.0
Source: includes/github/class-link-rewriter.php line 21

Methods

__construct()

Constructor.

Since: 3.1.0
Line: 49

public function __construct( string $repo_owner, string $repo_name );
TypeNameDescription
string$repo_ownerRepository owner.
string$repo_nameRepository name.

rebuild_path_map()

Build and cache a map of repo path → post ID.

Queries all posts with _wzkb_github_repo matching this repo and stores a transient keyed ‘owner/repo:path’ => post_id for 24 hours.

Since: 3.1.0
Line: 73

public function rebuild_path_map(  ): void;

Returns: void

rewrite()

Rewrite relative .md links in HTML to WordPress post permalinks.

Since: 3.1.0
Line: 112

public function rewrite( string $html, string $current_file_path ): string;
TypeNameDescription
string$htmlConverted HTML content.
string$current_file_pathRepo-relative path of the file being imported.

Returns: string — HTML with links rewritten where possible.