-
Notifications
You must be signed in to change notification settings - Fork 0
Home
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\Newsnamespace to prevent naming conflicts, and you should see both "ChoctawNation" as a@packagetag and "News" as a@subpackagein the files' header comment blocks. - This plugin, like others, is initialized with the
Plugin_Loaderclass. - Registers 2 Image Sizes:
- choctaw-news-preview (1392x784)
- choctaw-news-single (2592x1458)
This plugin assumes the following are already loaded in a theme:
- Bootstrap
- ACF Pro
- Inits cpts (news & boilerplates) with prefixes (i.e.
choctaw-boilerplates). - Adds the News to default WordPress search query
- Inits templates (
archiveandsingle) 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.phpwhere "file-name" matches the files in the plugin'stemplatesfolder
- Files must be located at
- Each class calls its parent with
require_once - The
final class Plugin_Loader:- Calls a
parent::__construct()because it's grandparent,Post_Type_Builderrequires 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.
- Calls a