Helping Organisations get organised!

Admin interfaces

Poll Settings metabox

  • Allow multiple (_lh_polls_allow_multiple) – single vs multi-select voting; gates change-vote (single-choice only).
  • Closed – voting disabled, results still shown (_lh_polls_voting_closed) – manual toggle read by poll_is_open(). Independent of post_status, which continues to govern visibility per the platform’s normal rules. No scheduling exists yet – opening/closing is always a deliberate admin action.
  • Required voters – paste one email per line; resolved to users via get_user_by(’email’, …) on save. Unmatched addresses are reported via admin notice and not saved.
  • Reminder email template – select a published bp-email post (managed under Emails if BuddyPress active). Supports tokens {{poll.title}}, {{poll.url}}, {{recipient.name}}.

Options metabox

Add/edit/delete options; add one at a time via New option field, saved on Update Post. Options with existing votes cannot be deleted (shown as ‘Has votes’). A poll needs at least two options before it can be published – attempting to publish with fewer forces status back to draft with an admin notice.

Votes metabox

Per-option vote breakdown: voter name (linked to BuddyPress profile if active, else WP user edit screen), comment text, date, delete link. Includes a Required Voters section (count voted/not-voted, linked names, Send reminder button when a template is set) and an Add Vote Manually form (option/user/comment, writes via LH_Polls_Comments::insert_vote()). Gated to edit_post capability for the poll.

Front-end voting UI

Rendered by LH_Polls_Embed::render_poll_markup(), shared between the embed (iframe/oEmbed) view and the standalone singular view. Voting is a plain HTML form POST to the poll’s own permalink (no AJAX), handled by LH_Polls_Voting::handle_form_post() on template_redirect, redirecting back with a ?lh_poll_msg feedback parameter. Single-choice polls show a Change vote option to users who’ve already voted. Users with edit_post capability see an Edit poll link beneath the vote total.

Embedding

Via the Poll block: pick an existing poll or create a new draft poll inline (auto-selected). The block renders server-side via oEmbed against the poll’s own permalink with ?embed=true, producing a zero-theme-dependency iframe document. A draft poll shows ‘(Draft)’ in the editor and ‘This poll is not yet published.’ on the front end, with an Edit poll link for users who can edit it.

If you like this plugin please consider making a donation to further development