Helping Organisations get organised!

Changelog

  • 1.17.0: Vouchers can now be drafted and revised through lh-mcp-general-abilities’ create-post and update-post: the voucher post type is added to their writable post types through the lh_mcp_general_abilities_return_writable_post_types filter. Those abilities still only touch draft, pending and auto-draft posts, so an active or archived voucher must be set to Draft before it can be edited this way, and nothing written there can activate a voucher.
  • 1.16.3: Internal: the plugin class is no longer wrapped in a class_exists() check, which on this server can see the class as already defined and silently skip loading the whole plugin; the check stays only for the bundled wp-statuses library, which other plugins may also bundle. Adds plugin_version(), read from the Version header, and drops the closing PHP tag. No change in behaviour. lh-tasks #149858.
  • 1.16.2: The first printed voucher now starts as high on its page as every later copy. The single voucher template’s main group no longer has the theme’s top padding on paper, which only ever applied to the first page and pushed the first copy down. lh-tasks #149858.
  • 1.16.1: Fixes vouchers printing with blank or near-empty pages between copies. Each copy’s content now carries the entry-content and is-layout-flow classes, as core’s Post Content block gives post content, so left- and right-aligned blocks (such as a QR code image) float beside the text again instead of stacking below it; stacked, a copy designed to fill one page ran just over it on paper, and its last lines spilled onto a page of their own. Copies are also no longer kept from splitting across pages, which pushed a copy that did not fit onto the next page and left a blank page behind it; each copy still starts on a new page. lh-tasks #149858.
  • 1.16.0: Vouchers now have their own single-voucher block template, registered by the plugin, so they print correctly on block and hybrid themes without the theme carrying a voucher template. The new Voucher Copies block (lh-voucher-post-type/voucher-copies) prints the voucher’s featured image and content once for each copy set on the voucher (at least once), with no title, followed by a single Edit link for users who can edit it; a Voucher Number block or lh_voucher_number shortcode in the content counts up from copy to copy as before. When printed, each copy starts on a new page and is kept on one page; these print styles are inline and load only on pages showing the block. The Edit link carries the no-print class, and everything else about printing (such as leaving out the site header and footer) is left to the theme. The template places the block between the theme’s header and footer parts, and a theme’s own single-voucher template or a user-edited copy still takes precedence. The copy count, print styles and template markup are filterable ({namespace}_return_voucher_copies, {namespace}_return_print_css, {namespace}_return_template_content). Part of the LH 2015 block-template migration; lh-tasks #149858.
  • 1.15.0: Vouchers are now numbered correctly (Voucher 1 of 10, 2 of 10 and so on) on pages that use a block template. The number only counted up once the page body had opened, but a block template renders its content before that, so every voucher there would have shown the same number. Numbering now counts in the page body as a block template renders it, as well as after the body opens in classic and PHP templates as before; content run for the page head still does not use up numbers. Applies to both the Voucher Number block and the lh_voucher_number shortcode. Lh-tasks #149801.

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