Duty Day Calendar — Documentation

Everything you need to get the plugin installed, configured, and running a real duty-day roster.

Installation

Duty Day Calendar is a standard WordPress plugin. Install it the way you install anything else:

  1. Upload the duty-day-calendar folder to wp-content/plugins/ (or install the zip through Plugins → Add New → Upload Plugin).
  2. Activate Duty Day Calendar from the Plugins screen.
  3. On activation the plugin registers three post types (courts, attorneys, duty-days), two custom roles, and seeds default settings.

Requires WordPress 6.0+ and PHP 8.0+.

Initial setup

Once activated, open Duty Day Calendar → Settings and walk the four tabs in order:

  1. General — set your organization name.
  2. Calendar Settings — set the current and review date windows.
  3. Login Button — wire up the front-end login/logout button to a menu and page.
  4. Welcome Email — configure the templated email new attorneys receive on registration.
Screenshot needed Settings page showing the four-tab navigation (General / Calendar Settings / Login Button / Welcome Email).

Organization name

This single setting rebrands the plugin for your bar association. It appears in:

  • The admin page headings (“{Organization} Calendar System”).
  • The welcome email subject, from name, and body.
  • The PDF calendar author and creator metadata.
  • The footer of the HTML welcome email.

If left blank, the plugin falls back to the site title from Settings → General → Site Title.

Change it any time — existing posts, duty days, and attorney records are unaffected.

Roles & permissions

There are three user roles in a typical install:

RoleWhat they can do
Administrator
(standard WordPress)
Full access: plugin settings, user registration, all courts / attorneys / duty days, all calendar views, PDF email. Typically the program director.
Staff Attorney
(added by plugin)
View and manage all attorneys and duty days; view all calendars. Cannot access plugin settings. Day-to-day admin.
Attorney
(added by plugin)
View their own personal calendar and assignments; accept or decline duty days while the review window is open; view court calendars and directories.

Both plugin-added roles are registered as first-class WordPress roles with per-post-type capabilities (edit_attorney, edit_duty_day, etc.), so role-aware plugins and your own code can check capabilities normally.

Courts

Every duty day is assigned to a court. Add each court on your circuit under Courts → Add New.

Court Information (contact details)

  • Address, City, State (dropdown), ZIP
  • Phone, TTY, Email

Settings for Available Slots (rota sizing)

The court-level rota is defined by the number of duty-day slots you make available per weekday:

  • Monday – Friday — a whole number for each day (e.g. Monday = 3 means three duty-day slots on every Monday).
  • Extra slots — use the Add Extra Slot button to add one-off slots for specific dates (busy sessions, holiday make-ups, etc.) on top of the weekday defaults.

The admin schedule is built to fill those slots; any slot that isn’t filled appears on the Court Calendar as an Open (red) day.

Screenshot needed Court edit screen showing the Court Information and Settings for Available Slots meta boxes (the weekday number inputs + Add Extra Slot button).

Courts are exposed through the REST API (show_in_rest = true) if you want to query them from a theme, block, or external tool.

Attorneys

Each attorney in your program is stored as an attorneys post. Contact fields on the Attorney Information meta box:

  • Address, City, State, ZIP
  • Phone, Fax, Cell
  • BBO No. — the attorney’s Board of Bar Overseers number (the identity key)
  • Email

The BBO ↔ WordPress user linkage

The attorney’s BBO number is the bridge between the Attorney post and their WordPress user account. It’s stored in the bbo_no meta field and used as the user_login (WordPress username). When an attorney logs in, the plugin looks up their attorney record by that BBO number and shows them their assignments.

Both records must exist and match. If you create the Attorney post and the WordPress user separately, the BBO number on the Attorney (in bbo_no) must be identical to the WordPress user’s username. Use the registration form (below) and you’ll never have to think about this.

Two ways to create an attorney

  1. Via the registration form (recommended). Place [ddc_register_form] on an admin-gated page. One submission creates both the WordPress user and the Attorney post, with matching BBO numbers and the welcome email sent automatically.
  2. Manually, from the admin. Add the WordPress user under Users → Add New with the BBO# as the username, then add the Attorney post under Attorneys → Add New with the same BBO# in the BBO No. field.
Screenshot needed Attorney edit screen showing the Attorney Information meta box (all contact fields, BBO No. highlighted).

Duty days

A duty day is a single attorney-at-court-on-a-date record. It ties three things together:

Meta fieldWhat it stores
belongs_court_idPost ID of the court
belongs_attorney_idPost ID of the attorney (0 if unassigned)
dateUnix timestamp for the duty day
statusNumeric 1–7 (see below)

Status values

ValueLabelMeaning
1OpenUnassigned slot — nobody on it yet
2WaitingAssigned, awaiting attorney’s response
3AcceptedAttorney has confirmed they’ll cover it
4DeclinedAttorney declined — admin needs to reassign
5HolidayCourt closed / no duty day
6CPCSCPCS staff day (not bar-advocate covered)
7YADYouth Advocacy Division day

Status colors on the Court Calendar

  • Green — Accepted
  • Yellow — Waiting for acceptance
  • Red — Open (unassigned)
  • Gray — Holiday, CPCS, or YAD

Calendar settings

Under Settings → Calendar Settings you control two independent date ranges:

Current calendar dates

This is the published, in-force schedule every front-end calendar and list view reads from. Set the start and end dates of what should be visible as “the current rota” and click Update Calendar.

Review calendar dates

This is the range of dates a newly-built schedule is open for attorney response. Set its start and end dates, then use the Open / Close button described in the next section.

Screenshot needed Settings → Calendar Settings tab showing both date-range forms and the Open / Close Calendar button.

Open / close review

The Open / Close button on the Calendar Settings tab is the switch that lets attorneys act on their assignments.

To open the review window

  1. Go to Duty Day Calendar → Settings → Calendar Settings.
  2. Confirm the review-calendar date range is correct.
  3. If the button reads Open Calendar, click it. Status flips to Open.

While open, every attorney sees an Awaiting Acceptance section on their [ddc_attorney_calendar] page and can Accept or Decline each assignment.

To close the review window

  1. Same screen as above.
  2. If the button reads Close Calendar, click it. Status flips to Closed.

Responses lock, the Awaiting Acceptance section disappears, and the schedule becomes read-only for everyone except admins and staff attorneys.

Typical lifecycle: admin assigns → opens review → attorneys accept / decline → admin reassigns any declines → admin closes review → PDFs go out to each court.

Managing duty days

There are two workflows for creating and editing duty days, and admins use both:

From the admin dashboard

  1. Go to Duty Days → Add New.
  2. Enter a title (convention is “Court – Date”).
  3. In the Settings for Duty Days meta box: set the date and pick a status.
  4. In the Assignments meta box: pick the court, then (if ready) pick the attorney.
  5. Click Publish or Update.

From a calendar view (faster for building a whole month)

  1. Open the Court Calendar or Full Calendar page.
  2. Click any open slot (or an existing assignment to edit).
  3. The same form pops up with the court and date pre-filled.
  4. Pick the attorney and status. Save.

The popup form is exactly what the [ddc_duty_day_form] shortcode renders.

Screenshot needed Duty Day edit screen showing both meta boxes (Settings for Duty Days with the 7 status radios, Assignments with court + attorney dropdowns).

Welcome email

When a new attorney registers, the plugin sends a templated HTML welcome email. Configure everything under Settings → Welcome Email.

SettingWhat it does
EnabledMaster toggle for the whole email.
From nameSender name. Defaults to your organization name.
From emailSender address. Defaults to the WordPress admin email.
SubjectEmail subject line. Defaults to “Welcome to {Organization}”.
LogoURL of a logo image shown at the top of the HTML email.
BodyWordPress visual editor. Uses the merge fields below.

Merge fields

TokenReplaced with
{first_name}Attorney’s first name
{last_name}Attorney’s last name
{username}Their WordPress username (= BBO#)
{password}The password generated or set at registration. Only rendered in the initial welcome email.
{email}Their email address
{login_url}URL of the login page (from the Login Button settings)
Screenshot needed Settings → Welcome Email tab with the HTML editor and the merge-fields reference visible.

Login button configuration

The plugin can drop a Login / Logout button into any registered menu location. Configure it under Settings → Login Button.

  • Menu location — pick any theme menu location. The button appends itself to that menu.
  • Login page — the page containing [ddc_login_form].
  • Password reset page — the page containing [ddc_password_reset_request_form].
  • Login text / Logout text — the visible labels (default: “Login” / “Logout”).

Password-reset admin

Admins and staff attorneys can force attorneys to change their password before they use the site again — useful for offboarding, suspected credential leaks, or a mandated rotation.

Individual

  1. Go to Users → select an attorney → Edit.
  2. Scroll to the Password Reset Options section.
  3. Tick Force Password Reset.
  4. Click Update User.

Bulk

  1. Go to Users.
  2. Tick the checkboxes for all affected attorneys.
  3. In the Bulk Actions dropdown, pick Force Password Reset and click Apply.
  4. A confirmation message shows how many users were flagged.

On the flagged attorney’s next login they see an undismissable popup that routes them through [ddc_password_reset_form] before they can continue.

Screenshot needed Two screenshots: (1) a user-edit screen with the Force Password Reset checkbox; (2) the Users list with the Bulk Actions dropdown open on Force Password Reset.

PDF calendar export

PDF export is an admin-only feature for sending each court its own copy of the published schedule. From any court calendar, Email PDF generates a landscape-A4 PDF of that month and sends it as an attachment to the address you enter — typically the court clerk.

The PDF is rendered by the bundled TCPDF library: no external service, no API key, no outbound HTTP. The author and creator metadata is set to your organization name so the recipient can tell where the schedule came from.

The file is saved temporarily in wp-content/uploads/court-calendars/ while the email is being assembled and deleted immediately after it’s sent.

What Staff Attorneys can do

Staff Attorney is the day-to-day administrative role. They have the full management toolset except plugin settings:

  • View and edit every attorney record. Add, update contact info, reassign duty days.
  • Create and edit duty days the same way administrators do — from Duty Days → Add New or by clicking a slot on any calendar.
  • View all three calendar types (Attorney / Court / Full) and switch between attorneys or courts using the dropdowns.
  • Email PDF schedules to the courts.

They cannot reach the Settings pages, so the organization name, welcome email template, and calendar-window open/close are reserved for Administrators.

Logging in (attorneys)

  1. Navigate to your login page, or click the Login button if it’s wired into a menu.
  2. Username: your BBO# (not your email).
  3. Password: the one you chose at registration, or the one in your welcome email if this is your first login.
  4. Click Login.

If you’ve forgotten your password, use the Lost Password link on the login form.

Your calendar

Once logged in, go to the page that contains [ddc_attorney_calendar]. You’ll see up to two sections:

  • Current Days — every duty day within the published calendar period that you’ve accepted.
  • Awaiting Acceptance — duty days assigned to you that still need your response. This section only appears while the admin has the review calendar open.

You can view your calendar at any time. Accept/decline controls appear only during the review window.

Accept or decline assignments

When the admin has opened the review calendar:

  1. Go to your attorney calendar.
  2. In the Awaiting Acceptance section, pick Accept or Decline next to each duty day.
  3. Click Submit at the bottom.

Accepted days move into your Current Days once the admin closes the review. Declined days go back into the admin queue for reassignment.

Screenshot needed Attorney calendar page showing a filled Current Days section and an Awaiting Acceptance section with Accept / Decline controls.

Changing your password

While logged in:

  1. Go to the page with [ddc_password_reset_form] (usually the “Change Password” page).
  2. Enter your current password.
  3. Enter and confirm your new password.
  4. Click Change Password. You stay logged in.

Forced password reset

If an administrator has flagged your account for a mandatory password reset, on your next login you’ll see a popup notification. It can’t be dismissed — click Change Password and go through the reset form. Once your new password is saved you can continue using the site normally.

Attorney Calendar (reference)

Shortcode: [ddc_attorney_calendar].

The attorney-scoped view. By default it shows the logged-in attorney’s own assignments. Admins and staff attorneys see a dropdown to switch to any other attorney.

  • Current Days — accepted duty days within the current calendar period.
  • Awaiting Acceptance — only visible while the review window is open.

Court Calendar (reference)

Shortcode: [ddc_court_calendar].

Monthly grid scoped to one court. Pick the court from the dropdown, navigate between months using the previous/next controls. Every slot shows its status color:

  • Green — Accepted
  • Yellow — Waiting
  • Red — Open
  • Gray — Holiday, CPCS, YAD

Admins and staff attorneys can click any slot to create or edit its duty day directly from this view.

Screenshot needed Court Calendar page showing a full month with a mix of green / yellow / red / gray slots and the court + month controls.

Full Calendar (reference)

Shortcode: [ddc_full_calendar].

Weekly grid showing every court and every assignment in one view. Pick a week from the dropdown or use the navigation buttons. Admins and staff attorneys can click assignments to edit them in place; regular attorneys see it as read-only.

Shortcodes reference

All front-end output is rendered through shortcodes so you can drop them into any page, post, or block.

ShortcodeWhat it renders
[ddc_attorney_calendar]Attorney view. The schedule scoped to the logged-in attorney. Shows Current Days plus an Awaiting Acceptance section while the review window is open.
[ddc_court_calendar]Monthly calendar scoped to a specific court, with color-coded status markers. Clickable by admins / staff attorneys.
[ddc_full_calendar]Weekly calendar across all courts and attorneys — the comprehensive overview.
[ddc_attorney_directory]Searchable directory of all attorneys.
[ddc_court_directory]Searchable directory of all courts.
[ddc_duty_day_form]Admin-only. Create / edit form for a duty-day record; also triggered by clicking a slot on the Court or Full calendars.
[ddc_login_form]Front-end login form. BBO# as the username.
[ddc_register_form]Admin-only. Registration form that creates a WordPress user and a linked Attorney post in one submission.
[ddc_password_reset_request_form]Lost-password request form.
[ddc_password_reset_form]Password-change form (for logged-in users and for reset-link targets).
[container width="800" align="center"]...[/container]Layout helper: wraps its contents in a centered div of configurable width. Kept unprefixed for backward compatibility with legacy pages.

Legacy tags are also registered as [nba_*] aliases pointing at the same callbacks, so any existing page content continues to render.

Troubleshooting

Login issues

  • Make sure you’re using your BBO# as the username, not your email.
  • Use the Lost Password link on the login form if you need to reset.
  • If you’re locked out entirely, ask an administrator — they can reset your password or force-flag you for a fresh reset.

Calendar doesn’t render on a page

  • Verify you’re logged in — every calendar shortcode requires a signed-in user.
  • Check that the page has the correct shortcode and no typos (e.g. [ddc_attorney_calendar], not [dcc_attorney_calendar]).
  • Confirm your role has access; an Attorney role can’t see the Full Calendar editing controls.

Can’t accept or decline a duty day

  • The review calendar must be Open — when closed, the Awaiting Acceptance section is hidden entirely.
  • The duty day must be assigned to you.
  • If both are true and nothing happens on submit, ask the admin to check that your Attorney post’s BBO number matches your WordPress username exactly.

Status not updating after submit

  • Make sure you clicked Submit after ticking the responses.
  • Refresh the page — caching layers can serve a stale view.

Forced-reset popup won’t go away

That’s by design. An admin has flagged your account for a mandatory reset; you must complete the password change before you can use the site. Once you’ve saved a new password it disappears.