Started migrating the funds settings tab to the new framework. The legacy funds record is the WordPress option ‘dgx_donate_designated_funds’ consisting of an array with the key being the fund name and the value being either “HIDDEN” or “SHOW,” for whether the fund is to be shown on the front-end. While this is a workable approach, we can add a lot more capabilities by making funds (and probably donations and donors) into custom post types.
Started implementing funds as a custom post type, and so there’s now a Funds menu where users can add a new fund. This is managed in the admin-new/funds.php file. Created two filters that are called before the funds custom post types are instantiated:
- seamless_donations_funds_type_setup: passes the taxonomy array for setup
- seamless_donations_funds_setup: passes the custom post type array for setup
Added a metabox in the funds edit page to select whether the fund is hidden or shown. Right now, the metabox shows, but I haven’t yet added the elements that manage the option. Also mapped out how a pro extension might be added to Seamless Donations to give excerpts, full descriptions, featured image, and fund types, allowing the ability to create full pages describing funds, if the users so want.
IMPORTANT: It will be necessary to add a format conversion function so pre-4.0 Seamless Donation users convert from the options item approach to the custom post types data structure. I’ll have to add that as part of the setup or plugin initialization.