Skip to content
KJ Roelke edited this page Mar 25, 2024 · 2 revisions

Welcome to the cno-plugin-events wiki!

Based (loosely) off The Events Calendar, but without all the bells & whistles bloat.

Here's a quick overview of what's going on:

  • This plugin uses 1 CPT, Events, to handle event posts, alongside ACF Pro and Bootstrap.
  • Registers 2 Image sizes: choctaw-events-preview and choctaw-events-single
  • It gives you the "Add to Calendar" JS logic for free!
  • Comes with a JSON file for adding "Venues" taxonomy and ACF classes to the Event (not installed by default).
  • This plugin uses the ChoctawNation\Events namespace to prevent naming conflicts, and you should see both "ChoctawNation" as a @package tag and "Events" as a @subpackage in the files' header comment blocks.
  • This plugin, like others, is initialized with the Plugin_Loader class.

Image Sizes:

Both image sizes are registered as 2x, 16:9 sizes.

  • choctaw-events-preview registers 1392x784
  • choctaw-events-single registers 2592x1458

Dependencies

This plugin assumes the following are already loaded in a theme:

  • Bootstrap
  • ACF (Pro)

The Post Types

  • Inits cpt (events) with prefix (choctaw-events).
  • Adds the Events to default WordPress search query
  • Inits templates (archive and single) with a template part for the post preview.
  • Templates can be overriden in theme folder.
    • Files must be located at theme/templates/choctaw-file-name.php where "file-name" matches the files in the plugin's templates folder

The Plugin Logic/Loader Classes (an overview)

  • Each class calls its parent with require_once
  • The final class Plugin_Loader:
    • Calls a parent::__construct() because it's grandparent, Post_Type_Builder requires it.
      • The grandparent class checks if ACF is installed and throws an error if its not (and also kills PHP).
    • Calls all filters and action callback functions, even though they may be defined in a (grand)parent class.