Lunar Wiki
Data domain plugin for game documentation sites — Custom Post Type, taxonomies, metadata, and a public API consumed by Lunar Theme and (optionally) Lunar SEO.
by Irvan Noerfazri · github.com/irvangen09/lunar-wiki · website
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/irvangen09/lunar-wiki/archive/refs/heads/main.zipReadme
Lunar Wiki
Data domain plugin for game documentation sites built on WordPress — Custom Post Type, taxonomies, metadata, and a public API for game documentation content.
Lunar Wiki is part of the Lunar ecosystem, alongside Lunar Blocks (Gutenberg blocks), Lunar SEO (search engine optimization), and the Lunar theme (presentation). Lunar Wiki owns the data layer only — it registers no blocks and renders no frontend templates. Each product in the ecosystem can be used independently; Lunar Wiki has no hard dependency on any of the others.
Table of Contents
- Features
- Requirements
- Installation
- Data Structure
- Public API
- Optional Integrations
- Integration Contracts
- Contributing
- Changelog
- License
Features
- Custom Post Type
wiki_articlefor individual documentation entries. gametaxonomy, hierarchical (franchise → specific title), for organizing content by title.content_typetaxonomy (e.g. "Walkthrough", "Item Guide") for categorizing articles.wiki_fieldtaxonomy — a recognized-field dictionary. New fields (e.g. "Role", "Season") can be added freely through wp-admin, with no code changes required.- Infobox field data sync into post meta, driven by structured block data (no HTML parsing involved).
- Per-title secondary navigation menu and custom Game Tile (image + destination URL) stored as term meta.
- Optional per-article Update Notes field.
- Author Role and Author Social Links fields on the WordPress user profile screen.
- A public API (
includes/public-api.php) for themes and other plugins to read this data without depending on any internal class.
Requirements
- WordPress 6.5 or later
- PHP 8.0 or later
Installation
- Upload the plugin folder to
wp-content/plugins/lunar-wiki, or install the packaged zip through Plugins → Add New → Upload Plugin. - Activate Lunar Wiki from the Plugins screen.
- A Field submenu appears under Wiki Articles — this is where the
wiki_fieldterm dictionary is managed (it does not appear as a standard taxonomy panel by design; see Data Structure). - If Polylang is active, the
gameandcontent_typetaxonomies are automatically registered as translatable — no extra configuration needed.
Data Structure
| Item | Type | Notes |
|---|---|---|
wiki_article |
Custom Post Type | The core content type. |
game |
Taxonomy (hierarchical) | Franchise (parent) → specific title (child). |
content_type |
Taxonomy (flat) | Free-form categorization, e.g. "Walkthrough". |
wiki_field |
Taxonomy (flat, not bound to any post type) | Recognized-field dictionary for the Infobox block. Deliberately kept out of the standard Gutenberg taxonomy panel; managed via its own admin submenu. |
Post meta, term meta, and user meta keys are not meant to be read or written directly — always go through the Public API functions below, since the exact meta key computation can change internally without notice (it is not part of the stable contract; the function names are).
Public API
All public functions live in includes/public-api.php, are prefixed lunar_wiki_, and are documented inline with PHPDoc. They are grouped as follows:
- Structural identity —
lunar_wiki_get_post_type_slug(),lunar_wiki_get_taxonomy_slug_game(),lunar_wiki_get_taxonomy_slug_content_type(),lunar_wiki_get_taxonomy_slug_field(),lunar_wiki_is_wiki_article() - Fields & authors —
lunar_wiki_get_recognized_fields(),lunar_wiki_get_field_label(),lunar_wiki_get_field_meta_key(),lunar_wiki_get_author_role(),lunar_wiki_get_author_social_links() - Game menu & tile —
lunar_wiki_get_game_menu_meta_key(),lunar_wiki_get_game_tile_url_meta_key(),lunar_wiki_get_game_tile_image_meta_key() - Update notes —
lunar_wiki_get_update_notes_meta_key() - High-level query helpers —
lunar_wiki_query_wiki_articles(),lunar_wiki_get_content_type_terms()
The public API is additive-only: existing function signatures do not change without a formal deprecation process. New functions may be added at any time.
Usage examples
Check whether the current post is a Wiki Article, and query articles for a listing:
if ( function_exists( 'lunar_wiki_is_wiki_article' ) && lunar_wiki_is_wiki_article() ) {
// Render Wiki Article specific UI.
}
// For page-context checks (e.g. distinguishing an archive from a single
// article page), prefer is_singular() with the post type slug instead:
if ( function_exists( 'lunar_wiki_get_post_type_slug' ) ) {
$on_single_article = is_singular( lunar_wiki_get_post_type_slug() );
}
if ( function_exists( 'lunar_wiki_query_wiki_articles' ) ) {
$recent = lunar_wiki_query_wiki_articles( array(
'posts_per_page' => 6,
) );
while ( $recent->have_posts() ) {
$recent->the_post();
the_title();
}
wp_reset_postdata();
}
if ( function_exists( 'lunar_wiki_get_author_social_links' ) ) {
$links = lunar_wiki_get_author_social_links( get_the_author_meta( 'ID' ) );
foreach ( $links as $link ) {
printf(
'<a href="%s">%s</a>',
esc_url( $link['url'] ),
esc_html( $link['label'] )
);
}
}
Always guard calls with function_exists() if there is any chance Lunar Wiki might be inactive.
Optional Integrations
Lunar Wiki integrates with the following, all detected at runtime — none are required for Lunar Wiki's core data functionality to work:
- Lunar Blocks — supplies the
wiki_fieldtaxonomy as the data source for the Infobox block's field dropdown, and listens for saved Infobox data to sync into post meta. - Lunar SEO — registers
wiki_articlefor full title/meta/schema treatment. - Polylang — registers
gameandcontent_typeas translatable taxonomies.
Integration Contracts
Communication with Lunar Blocks and Lunar SEO happens exclusively through the documented extension points below — never through direct calls into either plugin's internal classes:
Contributing
Contributions are welcome. See CONTRIBUTING.md for coding standards, the pull request process, and how to report issues.
Changelog
See CHANGELOG.md, which follows the Keep a Changelog format.
License
GPL v2 or later. See LICENSE for the full text.