OpenWebconcept / plugin-openagenda-base

This plugin adds Events and Locations to WordPress which can be retrieved via the OpenAgenda REST API.
European Union Public License 1.2
0 stars 0 forks source link
agenda

OpenAgenda Plugin

This plugin adds Events and Locations to WordPress which can be retrieved via the OpenAgenda REST API.

Requirements

OpenAgenda

In order to make the OpenAgenda Plugin work, you will need to have a WordPress installation with at least the following installed (and activated):

On this WordPress installation you will have to enable pretty permalinks (Settings > Permalinks > Select any of the options that is not plain).

There are two possible setups for the OpenAgenda, this can be:

  1. On the WordPress installation of an existing website.
  2. On a completely new WordPress installation.

In all scenarios the OpenAgenda needs to have the following installed (and activated):

With this installed you can use the OpenAgenda Base plugin in your WordPress website.

If you chose for option 2 (new WordPress installation), you will probably need to install a WordPress theme. Since the OpenAgenda plugin is a REST API, it can be used in any WordPress theme.

Installation

Manual installation

  1. Upload the openagenda-base folder to the /wp-content/plugins/ directory.
  2. Activate the OpenAgenda Base Plugin through the 'Plugins' menu in WordPress.

Composer installation

  1. composer source git@github.com:OpenWebconcept/plugin-openagenda-base.git
  2. composer require acato/openagenda-base
  3. cd /wp-content/plugins/openagenda-base
  4. composer install
  5. Activate the OpenAgenda Base Plugin through the 'Plugins' menu in WordPress.

Development

Coding Standards

Please remember, we use the WordPress PHP Coding Standards for this plugin! (https://make.wordpress.org/core/handbook/best-practices/coding-standards/php/) To check if your changes are compatible with these standards:

N.B. the composer install command will also install a git hook, preventing you from committing code that isn't compatible with the coding standards.

Translations

wp i18n make-pot . languages/openagenda-base.pot --exclude="node_modules/,vendor/" --domain="openagenda-base"
cd languages && wp i18n make-json openagenda-base-nl_NL.po --no-purge

Event and Location Custom Post Types

This plugin adds two custom post types to WordPress:

REST API Endpoints

This plugin adds the following REST API GET-endpoints:

This plugin adds the following REST API POST-endpoint:

The POST-endpoint is used to create new items in the OpenAgenda. The endpoint is protected by Basic Authentication with Application Passwords. The user needs to have the capability edit_posts to be able to use this endpoint.

In the plugin settings located at Settings > OpenAgenda Settings you can set the user that is allocated to items created with this POST-endpoint.

Further documentation about using the REST API can be found in the OpenAgenda API documentation.

Event dates

In the event post type you can set the date(s) for an event with the following date types:

In both cases after saving the event, the date(s) within the range of the pattern will be generated for the first year and saved as post meta for the event. All generated dates are included in the REST API response.

Cron jobs

This plugin uses two cron jobs:

Make sure that the WordPress cron is running on your server. If you have disabled the cron via define('DISABLE_WP_CRON', true); in the wp-config.php then make sure you trigger the cron jobs with a server cron job. If you are not sure, you can use the plugin WP Crontrol to check if the cron jobs are running.

Event Taxonomies

For the event post type you can create your own taxonomies, located at Events > Create Taxonomies. These taxonomies are included in the REST API response. When a taxonomy has terms attached to it, the taxonomy can't be deleted.

Integration with plugins

This plugin is compatible with the following open source projects: