Skip to content

Add article versioning support via doc_version taxonomy#285

Draft
Copilot wants to merge 7 commits intodevelopfrom
copilot/add-article-versioning-support
Draft

Add article versioning support via doc_version taxonomy#285
Copilot wants to merge 7 commits intodevelopfrom
copilot/add-article-versioning-support

Conversation

Copy link
Contributor

Copilot AI commented Jan 22, 2026

Implements multi-version documentation support to maintain separate docs for different software releases, similar to Symfony and ReadTheDocs.

Implementation

Taxonomy System

  • New doc_version hierarchical taxonomy registered with REST API support
  • Added to docs post type taxonomies array

Version Selection UI

  • Dropdown selector in main content area (after breadcrumbs) and sidebar
  • Visibility conditional: only renders when ≥2 versions exist
  • URL-based version switching via ?version={slug} parameter
  • Responsive CSS with mobile breakpoint

Helper Functions (includes/functions.php)

wedocs_get_versions()              // Retrieve all versions
wedocs_get_doc_version($post_id)   // Get versions for specific doc
wedocs_get_current_version($post_id) // Get active version (respects URL param)
wedocs_version_selector($post_id)  // Render dropdown UI

Frontend Behavior

// Version switcher updates URL with version parameter
$('.wedocs-version-dropdown').on('change', function() {
  const versionSlug = $(this).find('option:selected').data('slug');
  window.location.href = new URL(baseUrl).searchParams.set('version', versionSlug);
});

Files Changed

  • includes/Post_Types.php - taxonomy registration
  • includes/functions.php - version utilities (123 lines)
  • templates/single-docs.php - main content selector
  • templates/docs-sidebar.php - sidebar selector
  • assets/build/frontend.css - dropdown styling (51 lines)
  • assets/js/frontend.js - switching logic (25 lines)
  • Version bumped to 2.1.19

Usage

Admins assign versions via taxonomy UI. Users see version dropdown on docs with multiple versions. Selection persists via URL parameter for bookmarking/sharing.

Original prompt

This section details on the original issue you should resolve

<issue_title>Feature request: Add support for multiple versions of the same article</issue_title>
<issue_description>Hi @tareq1988 !

Me again. I would like to ask you to consider adding another feature I think it would put your plugin in the next level: article versioning. When documenting, you have to update existing articles to adapt them to new features or new UI layouts, for instance, from you latest software version. But that doesn't mean previous information isn't correct for older versions of your software. That's why I think this is a great feature for you to add to your plugin.

Some examples would be:

Symfony's Documenation

image

Readthedocs.com [Check out lower left corner]

image

Thanks!</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 5 commits January 22, 2026 12:42
Co-authored-by: iftakharul-islam <88052038+iftakharul-islam@users.noreply.github.com>
Co-authored-by: iftakharul-islam <88052038+iftakharul-islam@users.noreply.github.com>
…checks, improve accessibility

Co-authored-by: iftakharul-islam <88052038+iftakharul-islam@users.noreply.github.com>
Co-authored-by: iftakharul-islam <88052038+iftakharul-islam@users.noreply.github.com>
Co-authored-by: iftakharul-islam <88052038+iftakharul-islam@users.noreply.github.com>
Copilot AI changed the title [WIP] Add support for multiple versions of the same article Add article versioning support via doc_version taxonomy Jan 22, 2026
Introduces functions and filters to ensure documentation content is shown only for the selected version. Adds `wedocs_filter_pages_by_version` and `wedocs_filter_query_by_version` to filter sidebar, child lists, shortcodes, and search results by version. Also adds helpers for version selector display and updates technical documentation with quick start and summary guides.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 23, 2026

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: Add support for multiple versions of the same article

2 participants