johnshopkins/acf-hub-api

Advanced Custom field that enables users to select content from the Hub API

Installs: 1 085

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 4

Forks: 0

Open Issues: 0

Language:JavaScript

Type:wordpress-plugin

1.0.4 2023-09-08 14:59 UTC

This package is auto-updated.

Last update: 2024-04-08 16:10:40 UTC


README

Advanced Custom field that enables users to select content from the Hub API.

Installation via Composer

In your composer.json file, be sure to let Composer know where to install WordPress plugins:

{
  "extra": {
    "installer-paths": {
      "path/tp/plugins/{$name}/": [
        "type:wordpress-plugin"
      ]
    }
  }
}

Require the plugin:

composer require johnshopkins/acf-hub-api

In wp-config.php or your theme's functions file, define your Hub auhthentication:

const HUB_API_KEY = '{your_api_key}';
const HUB_API_VERSION = 1;

Activate the plugin in WordPress.

Field value

When getting the value of the field, you will receive an array with endpoint parts, like so:

[
  'collection' => string 'tags',
  'id' => int 384,
  'subcollection' => string 'articles'
]

It is up to your theme to query the API and fetch the results.