Download the PHP package shortlist-digital/agreable-quiz-plugin without Composer
On this page you can find all versions of the php package shortlist-digital/agreable-quiz-plugin. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download shortlist-digital/agreable-quiz-plugin
More information about shortlist-digital/agreable-quiz-plugin
Files in shortlist-digital/agreable-quiz-plugin
Package agreable-quiz-plugin
Short Description Wordpress plugin for Shortlist Media.
License MIT
Informations about the package agreable-quiz-plugin
Shortlist Media Wordpress Quiz 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 containwidget-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/timber_loader_paths.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/slm_plugin_enqueue.php
Just before rendering the plugin template, the parent theme calls Wordpressdo_action('acf_{{name}}_enqueue')
. e.g. (using Timber):
{% do action('slm_'~widget.acf_fc_layout~'_enqueue', widget) %}
The hook name is constructed from the ACF Field Group 'name' inwidget-loader-acf.php
. e.g. 'acf_quiz_plugin_enqueue'
Configurable plugin options for Wordpress installation
app/panels.php
Adds Settings panel for installation specific configuration. Uses ACF definitions.
Using ACF to create panels in Post Type menu
Add Custom Fields to menu
Specify custom fields using register_field_group($options)
. Best to create in Worpdress Admin and use export function.
$options['location']
will be an array specifying where to display the Custom Fields:
Note: If acf_add_options_sub_page
is given 'menu_title' of 'Quiz Settings', the location 'value' is 'acf-options-quiz-settings' (as above).
Deploying to Packaginst
git tag
to see the latest tag version (pull first.
git tag 0.x.x
to bump the version
git push origin master --tags
to push to GitHub with your latest tag - Packagist will recieve a webhook and update accordingly