Jeremiah Sturgill

code etc.

WordPress Plugin Foundation

The WordPress Plugin Foundation exposes WordPress APIs via a simple declarative YAML syntax. It also provides a solid, clear, consistent structure for any project that uses it.

jeremiahsturgill.com is powered in part by WPF. Here is the YAML that created the Project Post Type you are looking at right now:

- Slug: project
  Singular: project
  Plural: projects
  Capability Type: [project, projects]
  Supports: [title, editor, excerpt]
  Editor Roles: [super administrator, administrator]
  Labels:
    all_items: Projects
    menu_name: Projects
  Meta Boxes:
    - ID: project_info
      Title: Project Information
      Fields:
        - Name: live_url
          Title: Live URL
          HTML: <p class="tip"><em>Include http:// or https://.</em></p>
          Type: textbox
        - Name: repository_url
          Title: Repo URL
          Type: textbox
        - Name: documentation_url
          Title: Documentation URL
          Type: textbox
        - Name: download_url
          Title: Download URL
          Type: textbox
        - Name: languages
          Title: Languages Used
          Type: textbox
          Repeatable: true
          Repeat Button Text: add another language
        - Name: infrastructure
          Title: Libraries, CMSs, and other code bases used
          Type: textbox
          Repeatable: true
          Repeat Button Text: add another library
        - Name: image
          Type: image
          Title: Project Image

The Fields items get converted to data entry fields in the WordPress backend. Custom fields of all types are built-in to WPF: colors, dates, files, etc., and there is a simple system in place to create and use your own field types in the backend.

The YAML configuration files store easily in version control, can be edited by anyone with a text editor and a few minutes training, and expose far more than just the custom post types API.

  • PHP
  • CSS
  • HTML5
  • JavaScript
  • YAML
  • jQuery
  • jQuery UI
  • WordPress