shortlist-digital / agreable-promo-plugin
Wordpress plugin for Shortlist Media.
Installs: 2 842
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 11
Forks: 1
Open Issues: 1
Type:wordpress-plugin
pkg:composer/shortlist-digital/agreable-promo-plugin
Requires
- behat/behat: ~2.5
 - facebook/webdriver: ~1.0
 - getherbert/framework: ~0.9
 - jarednova/mesh: 0.4
 
- dev-master
 - 4.0.3
 - 4.0.2
 - 4.0.1
 - 4.0.0
 - 3.0.1
 - 3.0.0
 - 2.1.0
 - 2.0.1
 - 2.0.0
 - 1.4.0
 - 1.3.2
 - 1.3.1
 - 1.3.0
 - 1.2.10
 - 1.2.9
 - 1.2.8
 - 1.2.7
 - 1.2.6
 - 1.2.5
 - 1.2.4
 - 1.2.3
 - 1.2.2
 - 1.2.0
 - 1.1.9
 - 1.1.8
 - 1.1.7
 - 1.1.6
 - 1.1.5
 - 1.1.4
 - 1.1.3
 - 1.1.2
 - 1.1.1
 - 1.1.0
 - 1.0.2
 - 1.0.1
 - 1.0.0
 - 0.6.6
 - 0.6.5
 - 0.6.4
 - 0.6.3
 - 0.6.2
 - 0.6.1
 - 0.6.0
 - 0.5.2
 - 0.5.1
 - 0.5.0
 - 0.4.0
 - 0.3.9
 - 0.3.8
 - 0.3.7
 - 0.3.6
 - 0.3.5
 - 0.3.4
 - 0.3.3
 - 0.3.2
 - 0.2.5
 - 0.2.4
 - 0.2.3
 - 0.2.2
 - 0.2.1
 - 0.2.0
 - 0.1.13
 - 0.1.12
 - 0.1.11
 - 0.1.10
 - 0.1.9
 - 0.1.8
 - 0.1.7
 - 0.1.6
 - 0.1.5
 - 0.1.4
 - 0.1.3
 - 0.1.2
 - 0.1.1
 - 0.1.0
 - dev-develop
 - dev-greenkeeper/initial
 - dev-promo-hook
 - dev-timings-safari-parsing-fix
 - dev-post-type-update
 - dev-permission-roles
 - dev-update-widgets-key
 - dev-calais-update
 - dev-bug-fixes
 - dev-promos-on-partnerships
 - dev-chrome-svg-rendering-issue
 - dev-hotfix-category-page-update
 - dev-add-time-to-post-amend
 - dev-add-time-to-post
 - dev-vouchers
 - dev-babel-v6
 - dev-webpack-random-port
 - dev-redux-hot-rewrite
 - dev-counts-in-promo-list
 - dev-admin-changes
 
This package is not auto-updated.
Last update: 2025-10-26 00:14:24 UTC
README
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.phpat 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_promo_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
acf_add_options_sub_page(array(
  'page_title'  => 'Promo Style Settings',
  'menu_title'  => 'Promo Settings',
  'parent_slug' => 'edit.php?post_type=promo',
));
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:
array (
  array (
    array (
      'param' => 'options_page',
      'operator' => '==',
      'value' => 'acf-options-promo-settings',
    ),
  ),
),
Note: If acf_add_options_sub_page is given 'menu_title' of 'Promo Settings', the location 'value' is 'acf-options-promo-settings' (as above).
Deploy to packagist
Check the current latest tag
git fetch && git tag
Bump the version appropriately and tag
git tag x.x.x
Push to Github. Packagist will receive a hook and update the file
git push origin master --tags