Skip to content

Design notes

Steve Betts edited this page Aug 16, 2026 · 2 revisions

Some design notes to keep the method names straight.

public method prefix: dmbc_

  • render = returns a string representing a page
  • song list = a collection of songs
  • view = display the content of a page without the ability to edit or delete the page
  • edit = display a form that can be used to create/edit the page content

Folder organization:

A file in each directory should be named for the custom post type it operates on.

  • admin = the pages rendered into the admin framework
  • includes = the pages that can be rendered outside the admin framework
  • render = files that contain code to translate an object into a view

Example:

  • includes/render/song_list.php generates the HTML of the song_list pages
  • includes/admin/song_list.php creates/edits/deletes song lists
  • includes/song_list.php uses render methods to show the pages to normal users

Clone this wiki locally