GitHub
GitHub integration class.
Bootstraps all GitHub sub-components.
Namespace: WebberZone\Knowledge_Base\Pro\GitHub
Since: 3.1.0
Source: includes/pro/github/class-github.php line 23
Methods
get_enabled_mappings() static
Return all non-disabled repository mappings with a valid owner and repo name.
Indices from the saved option are preserved so callers can round-trip a mapping back by index (used by the import/export wizard two-phase flows).
Since: 3.1.0
Line: 103
static public function get_enabled_mappings( bool $push_only = ..., bool $pat_required = ... ): array;
| Type | Name | Description |
|---|---|---|
bool |
$push_only |
When true, also requires enable_push to be set. |
bool |
$pat_required |
When true, skips mappings with no effective PAT (neither per-mapping nor global). |
Returns: array — Keyed by original settings index.
get_wizard_mappings() static
Return mappings eligible to appear in an admin wizard dropdown.
Always requires a usable PAT (per-mapping or global) and a non-disabled status. Pass true for $push_only on the export wizard.
Since: 3.1.0
Line: 152
static public function get_wizard_mappings( bool $push_only = ... ): array;
| Type | Name | Description |
|---|---|---|
bool |
$push_only |
When true, also requires enable_push to be set. |
Returns: array — Keyed by original settings index.
render_mapping_select() static
Render the Repository Mapping
Since: 3.1.0
Line: 165
static public function render_mapping_select( array $mappings, string $id ): void;
| Type | Name | Description |
|---|---|---|
array<int,array<string,mixed>> |
$mappings |
Wizard-eligible mappings from get_wizard_mappings(). |
string |
$id |
HTML id attribute for the |
Returns: void
select_mappings() static
Resolve a mapping selector to a subset of the provided mappings array.
Since: 3.1.0
Line: 190
static public function select_mappings( string $value, array $mappings ): array<int,array<string,mixed>>|\WP_Error;
| Type | Name | Description |
|---|---|---|
string |
$value |
‘all’ or a numeric index string. |
array<int,array<string,mixed>> |
$mappings |
Full enabled-mappings array. |
Returns: array<int,array<string,mixed>>|\WP_Error — Selected mappings, or WP_Error on bad input.
normalize_mapping() static
Normalize a repository mapping row to a flat array.
Settings-based rows are stored by the repeater sanitizer as: array( ‘row_id’ => ‘…’, ‘fields’ => array( ‘repo_owner’ => ‘…’, … ) )
This method ensures all downstream code can access fields directly (e.g. $mapping[‘repo_owner’]) regardless of how the row was stored.
Since: 3.1.0
Line: 218
static public function normalize_mapping( array $row ): array;
| Type | Name | Description |
|---|---|---|
array<string,mixed> |
$row |
Raw mapping row. |
Returns: array — Flat mapping array.
mapping_label() static
Get a human-readable label for a repository mapping.
Since: 3.1.0
Line: 246
static public function mapping_label( array $mapping ): string;
| Type | Name | Description |
|---|---|---|
array<string,mixed> |
$mapping |
Repository mapping. |
Returns: string — Mapping label.
get_post_terms_string() static
Get a comma-separated list of term names assigned to a post.
Since: 3.1.3
Line: 268
static public function get_post_terms_string( int $post_id, string $taxonomy ): string;
| Type | Name | Description |
|---|---|---|
int |
$post_id |
Post ID. |
string |
$taxonomy |
Taxonomy name. |
Returns: string — Comma-separated term names, or empty string.
__construct()
Constructor.
Since: 3.1.0
Line: 281
public function __construct( );