Skip to content

Instantly share code, notes, and snippets.

Avatar

Didou Schol badabingbreda

View GitHub Profile
@badabingbreda
badabingbreda / toolbox_docs_plugin_development_alias_module_example.tiwg
Created Oct 23, 2019
Toolbox Docs: Plugin Development Alias Module Example
View toolbox_docs_plugin_development_alias_module_example.tiwg
{% set userid = __node__.starter_user|default( function( 'get_current_user_id' ) ) %}
{% set userdata = User( userid ) %}
<div class="uk-tile uk-tile-muted uk-padding-small uk-grid-small" uk-grid>
<div class="uk-width-1-1 uk-width-1-3@s">
<img data-src="{{userdata.avatar}}" uk-img>
</div>
<div class="uk-width-1-1 uk-width-2-3@s">
<h3>{{userdata.user_nicename}}</h3>
<p>{{userdata.description?'About the author:<br>'~userdata.description:'no description given.'}}</p>
</div>
@badabingbreda
badabingbreda / toolbox_docs_plugin_development_alias_module_settings_form.twig
Last active Oct 23, 2019
Toolbox Docs: Plugin Development Alias Module Plugin initalization
View toolbox_docs_plugin_development_alias_module_settings_form.twig
<?php
/**
Plugin Name: Toolbox Starter Plugin
Plugin URI: https://www.toolboxstarterplugin.com/
Description: Starter Plugin for Toolbox, Using Timber
Version: 1.0
Author: Didou Schol
Text Domain: textdomain
Domain Path: /languages
@badabingbreda
badabingbreda / toolbox_docs_plugin_development_alias_module_settings_form.php
Last active Oct 23, 2019
Toolbox Docs: Plugin Development Alias Module Settings Form
View toolbox_docs_plugin_development_alias_module_settings_form.php
<?php
/**
* Callback used to return the users of this WP site
* @return array
*/
function starter_return_users() {
$select_options = array();
@badabingbreda
badabingbreda / toolbox_docs_plugin_development_alias_module_sep_twig.php
Last active Oct 23, 2019
Toolbox Docs: Plugin Development Alias Module by inclusion using file_get_contents
View toolbox_docs_plugin_development_alias_module_sep_twig.php
<?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' ),
@badabingbreda
badabingbreda / toolbox_docs_plugin_development_alias_module_sep_twig.php
Last active Oct 23, 2019
Toolbox Docs: Plugin Development Alias Module by inclusion as a seperate twig template
View toolbox_docs_plugin_development_alias_module_sep_twig.php
<?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' ),
View Uikit 3.0 walker wordpress menu
<?php
/**
* Class Name: your_themename_top_menu
* Description: A custom WordPress nav walker class to implement UIkit menu markup
*/
class your_themename_top_menu extends Walker_Nav_Menu {
/**
* @see Walker::start_lvl()
* @since 3.0.0
@badabingbreda
badabingbreda / toolbox_example_dynamic_group_filter_js.js
Created Apr 5, 2019
Toolbox Example: Dynamic Group Filter JS
View toolbox_example_dynamic_group_filter_js.js
jQuery( '.chooser' ).on( 'click' , function( event ) {
var $this = jQuery(this);
var term = $this.data('term');
if ( $this.hasClass( 'uk-button-primary' ) ) {
var $unterm = jQuery( '.shadow[data-term="' + term + '"]' );
UIkit.filter('[uk-filter="target: .js-filter"]', { target: ".js-filter" } ).apply( $unterm );
} else {
UIkit.filter('[uk-filter="target: .js-filter"]', { target: ".js-filter" } ).apply( $this );
}
@badabingbreda
badabingbreda / toolbox_example_dynamic_group_filter_twig.twig
Last active Apr 5, 2019
Toolbox Example: Dynamic Group Filter Twig
View toolbox_example_dynamic_group_filter_twig.twig
{% macro getterms( taxonomy ) %}
{% set terms = function( 'get_terms' , { 'taxonomy': taxonomy , 'hide_empty' : true } ) %}
{% for item in terms %}
{% if item.slug != 'uncategorized' %}
<div>
<ul class="uk-subnav uk-subnav-pill" uk-margin>
<li class="filterbutton" uk-filter-control="filter: [data-{{item.slug}}='true']; group: {{item.slug}}">
<a href="#">{{item.name}}</a>
</li>
</ul>
@badabingbreda
badabingbreda / toolbox_example_adding_relationship_settings.php
Created Apr 5, 2019
Toolbox Example: Adding Relationship settings to Toolbox Field Module and Connector
View toolbox_example_adding_relationship_settings.php
<?php
add_filter( 'toolbox/helpers/settings/type=relationship' , 'my_relationship_settings' , 10, 2 );
function my_relationship_settings( $settings , $type = '' ) {
return array_merge($settings , array(
'relationship_subfield' => array(
'type' => 'text',
@badabingbreda
badabingbreda / cookie-connector-ajax.php
Created Jan 17, 2019
Cookie Connector Cookie Script
View cookie-connector-ajax.php
You can’t perform that action at this time.