Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save badabingbreda/47afa25da2052e3359cd2f31c1052433 to your computer and use it in GitHub Desktop.
Save badabingbreda/47afa25da2052e3359cd2f31c1052433 to your computer and use it in GitHub Desktop.
Toolbox Docs: Plugin Development Alias Module by inclusion using file_get_contents
<?php
/**
* Starter Plugin User Info Alias Module
* USER INFO
* @since 1.0
*/
\FLBuilder::register_module_alias( 'starter-user-info', array(
'module' => 'acftimber',
'name' => __( 'User Info', 'textdomain' ),
'description' => __( 'Starter User Info', 'textdomain' ),
'group' => __( 'Starter Plugin', 'textdomain' ),
'category' => __('User', 'textdomain'),
// path to a custom svg icon (20x20 pixels)
'icon' => TOOLBOXSTARTER_DIR . 'modules/user_info.svg',
'enabled' => true,
'settings' => array(
// Method 2: this will copy the file's content into the timber templates as a starter template. If there are no
// dependecies on plugin files THIS plugin can be deactivated and/or uninstalled. Updates to the twig file
// will not propagate to existing instances of the Alias Module, but WILL be used for new instances.
//
'timber_template' => file_get_contents( TOOLBOXSTARTER_DIR . 'twig_templates/starter_user_info.twig' ),
),
) );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment