Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/shortlist-digital/agreable-poll-plugin/archive/refs/heads/master.zipOn Packagist as shortlist-digital/agreable-poll-plugin:
composer require shortlist-digital/agreable-poll-pluginNo built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.
Shortlist Media Wordpress Poll Plugin
Wordpress Plugin built for Croissant stack using Herbert plugin framework.
Dependencies
Timber
Advanced Custom Fields
Create custom post type
/app/customPostType.php
Plugin degines an widget using ACF available to articles
/widget-loader-acf.php
A Croissant theme (e.g. Troisieme) will traverse plugins directory for 'slm' prefixed sub directories which contain widget-loader-acf.php at their root. This ACF definition is added to list of widgets available in theme.
Add plugin view path to Timber's paths for rendering
/app/hooks/timberloaderpaths.php
Parent theme will include the plugin Twig templates and render using Timber (see lab-troisieme-2015/src/views/partials/widget-container.twig). Therefore we add our plugin paths to Timber's internal array of paths using this filter called by Timber: 'timber/loader/paths.
Fire plugin specific action whilst rendering (to enqueue styles/scripts within plugin)
/app/hooks/slmpluginenqueue.php
Just before rendering the plugin template, the parent theme calls Wordpress doaction('acf{{name}}enqueue'). e.g. (using Timber):
{% do action('slm'~widget.acffclayout~'enqueue', widget)