Skip to content
KJ Roelke edited this page Apr 15, 2024 · 5 revisions

Welcome to the news-plugin wiki!

A simple, lightly opinionated WordPress Plugin for Choctaw News Post Types.

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

  • This plugin uses 2 CPTs, News and Boilerplates, to handle news posts, alongside ACF Pro and Bootstrap.
  • This plugin uses the ChoctawNation\News namespace to prevent naming conflicts, and you should see both "ChoctawNation" as a @package tag and "News" as a @subpackage in the files' header comment blocks.
  • This plugin, like others, is initialized with the Plugin_Loader class.
  • Registers 2 Image Sizes:
    • choctaw-news-preview (1392x784)
    • choctaw-news-single (2592x1458)

Dependencies

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

  • Bootstrap
  • ACF Pro

The Post Types

  • Inits cpts (news & boilerplates) with prefixes (i.e. choctaw-boilerplates).
  • Adds the News 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.

Clone this wiki locally