WP Manifestindependent plugin directory
manifest / developer / city-of-phila

City of Phila Code Sample

Code Sample

by pbrocks (Paul Barthmaier) · github.com/pbrocks/city-of-phila

★ 0stars
0forks

Install

No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:

wp plugin install https://github.com/pbrocks/city-of-phila/archive/refs/heads/master.zip

What you’ll be creating

Often, we need to accommodate requests from users for a new field, or new section in the WordPress admin interface, with a corresponding rendering on the front-end.

Your task is to create a set of fields in the WordPress admin that allows a user to add the following to the posts post type in WordPress:

  • A date field to select the “release date” of the post
  • A set of repeatable text fields for:
    • Contact name
    • Contact email address
    • Contact phone number

These fields should be rendered on the front-end under the post title (see the highlighted area of the next slide for an example). You can modify the WordPress default Twenty Nineteen (or Twenty Twenty) theme.

Frontend-Render

Requirements

Use the Meta Box plugin to make the fields in the admin. You can use fieldset text for the fields that need to be repeatable.

  • The user should be able to create any number of contact fields.
  • The contact name should be a link to a website.
  • The release date should be formatted like the following: June 29, 2019
  • If the release date or a piece of content isn’t entered, the field should not appear on the front-end.