WP Manifestindependent plugin directory
manifest / integrations / divdata-help

Div Data Docs API

Exposes API for DivData help api

★ 0stars
v0.0.1latest · 1 year ago

Install

Download source zip No release zip yet

This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/ucsc/divdata-help/archive/refs/heads/main.zip
No built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.

This WordPress plugin exposes DivData Help Docs via a custom REST API endpoint, allowing frontend applications to query posts based on the role and route metadata.


🔧 What It Does

  • Registers a custom REST API endpoint:

    GET /wp-json/divdata/v1/posts?role=admin&route=people
  • Returns published posts of the custom post type divdata-help-doc that match the specified:

    • role (custom field)
    • route (custom field)
  • Designed for use with Vue components or other frontend tools that dynamically render help content.


📁 Getting Started (Local Dev Setup)

  1. Clone the UCSC WordPress Dev environment:

    git clone https://github.com/ucsc/wp-dev.ucsc.git
    cd wp-dev.ucsc
  2. Start the local WordPress instance and navigate to:

    public/wp-content/plugins/
  3. Clone this plugin into the plugins/ directory:

    git clone https://github.com/ucsc/divdata-help.git  div-data-docs-api
  4. In the WordPress admin dashboard (http://localhost/wp-admin):

    • Go to Plugins
    • Activate Div Data Docs API

📝 Setup Requirements

To use this plugin, you must:

  • Register a custom post type called DivData Help Doc (divdata-help-doc)
    You can do this using ACF’s Post Types feature or manually via code.

  • Add two custom fields to this post type:

    • role (e.g., admin, student, etc.)
    • route (e.g., people, courses, etc.)

These fields can be created using ACF Field Groups.

Make sure your posts are:

  • Published
  • Assigned a valid role and route value

📥 Example Request

GET /wp-json/divdata/v1/posts?role=admin&route=people

Response:

[
  {
    "id": 22,
    "title": "How to manage people",
    "content": "<p>Help article content here</p>",
    "role": "admin",
    "route": "people"
  }
]

📌 Notes

  • The post type should not be exposed to the default REST API (show_in_rest should be false).
  • This plugin does not include frontend rendering; it is purely an API backend for frontend apps.
  • There is no authentication layer. Only published content is returned.

🧑‍💻 Author

Sammy Slug
UCSC Web Team

Releases

1 release.

Tag
Published
v0.0.1 latest
May 12, 2025 1 year ago

These releases are tags only. The author does not attach a packaged zip, so there are no download counts to report.