Skip to content

Instantly share code, notes, and snippets.

View badabingbreda's full-sized avatar

Didou Schol badabingbreda

  • Breda, Netherlands
View GitHub Profile
@badabingbreda
badabingbreda / jquery.bbpaneloptions.js
Last active June 30, 2018 20:10
Jquery Plugin to extend the Beaver Builder Editor Sidepanel and Topbar
/*! BeaverBuilder Add Panel Option for jQuery v1.00
* http://www.badabing.nl/jquery-plugins/beaverbuilder-paneloptions/
* Do not remove any of this notice (you're welcome to use this code in commercial projects)
* Copyright (c) 2016 Didou Schol www.badabing.nl
* Licensed under the MIT license */
( function ( $ ) {
$.extend ({
bbAddPanel: function ( options ) {
// DEFAULT OPTIONS
@badabingbreda
badabingbreda / targetrowbg.beaverbuilder.php
Last active September 8, 2016 06:37
Shortcode for Beaver Builder to target a row and set it's background using a ACF value, using jQuery and CSS.
<?php
/**
* Target a row higher in the DOM using style-attr for temp-class
* @example shortcode: [targetrow field="backgroundurl" removemodule="true"]
* this will use the posts ACF backgroundurl as a value for the background-image,
* it will also remove the module in the DOM so that when used on a row without any HTML or editor module it will still be silent.
*
* @param $atts attributes, field is required;
* @return [type] [description]
@badabingbreda
badabingbreda / bbacf_add_custom_sc_attr.php
Created December 22, 2016 09:34
ACF Template Builder - Add a custom shortcode attribute
add_filter( 'bbacf/helpers/sc_attr/type=google_map' , 'add_color_sc_attribute' );
/**
* add the postid attribute to the default sc attr
* @param [type] $array [description]
* @return [type] [description]
*/
function add_color_sc_attribute( $array ) {
return array_merge(
$array,
@badabingbreda
badabingbreda / bbacf_use_custom_attr_google_map.php
Last active December 22, 2016 09:51
ACF Template Builder - Using a custom attribute when displaying the ACF field
add_filter( 'bbacf/helpers/get_acf_field/type=google_map' , 'add_red_border' , 11, 5 );
/**
* add a colored border, using the added sc attr color
* @param [type] $string [description]
* @param [type] $field_object [description]
* @param [type] $value [description]
* @param [type] $atts [description]
* @param [type] $postid [description]
*/
@badabingbreda
badabingbreda / gist:cc2c89005035ef02a47a7307221f736d
Last active December 22, 2016 12:31
ACF Template Builder - changing field-type output
remove_filter( 'bbacf/helpers/get_acf_field/type=checkbox' , 'bbacf_helpers::shortcode_acf_return_checkbox' ,10 );
add_filter( 'bbacf/helpers/get_acf_field/type=checkbox' , 'return_custom_acf_checkbox' , 11, 5 );
function return_custom_acf_checkbox ( $string , $field_object , $value , $atts = null , $postid = null ) {
// get the correct fieldname for version 4 or 5 of acf
$get_fo = bbacf_helpers::$fr[ bbacf_acf_version() ];
if ( $field_object[ 'type' ] == 'text' ) return $string . $value ;
@badabingbreda
badabingbreda / gist:7fd4b22e429f18ac1062cfc0da26f2f3
Created December 22, 2016 19:41
ACF Template Builder - Return custom field-type output
add_filter( 'bbacf/helpers/get_acf_field/type=font-awesome' , 'return_custom_acf_fontawesome' , 10, 5 );
/**
* return rotated font-awesome icon
* @param [type] $string [description]
* @param [type] $field_object [description]
* @param [type] $value [description]
* @param [type] $atts [description]
* @param [type] $postid [description]
* @return [type] [description]
@badabingbreda
badabingbreda / acf_field.php
Last active May 15, 2018 21:55
Shortcode to echo ACF field inline
<?php
/**
* function that will generate the shortcode's output
* @param array $atts
* @return string $output
*/
function func_div_myshortcode( $atts ) {
$atts = shortcode_atts(
array()
@badabingbreda
badabingbreda / row_blur.js
Last active February 3, 2022 20:34
Snippet of code to change the row background-image to a blurred out version (or other filter effect)
// rowblur.js for Beaver Builder rows
// (c) 2018 Didou Schol / BadabingBreda
// rowblur.js may be freely distributed under the MIT license.
//
// add 'blureffect' as a class to the row and set the background-type to 'image'
// copy the code below into the "Global Settings > Javascript" tab and the rest will follow
// blur effect is hidden on fl_builder page, and needs a reload after page is saved.
// When normally browsing the site loads normally.
(function($) {
@badabingbreda
badabingbreda / oxygenbuilder2_dynamic_shortcode.php
Last active April 16, 2018 16:32
Oxygenbuilder 2.0 getting my own shortcode data
<?php
// ATTENTION:
// first you will need to add 2 lines of code (only lines 9+10, the } else if () { ) to the current oxygen-dynamic-shortcode.php file in Oxygenbuilder 2.0-Alpha2/3
// it is located within the oxygen_vsb_dynamic_shortcode class-function
//
// if (method_exists($this, $handler)) {
// $output = call_user_func(array($this, $handler), $atts);
// } else if (class_exists('Dynamic_Shortcodes_' . $atts['data']) && in_array( 'Oxygen_VSB_Dynamic_Shortcodes', class_parents('Dynamic_Shortcodes_' . $atts['data']) ) ){
// $output = call_user_func( array( 'Dynamic_Shortcodes_' . $atts['data'] , 'output' ) , $atts );
@badabingbreda
badabingbreda / oxygenbuilder2_manage_edit_column_apply_to.php
Last active July 16, 2018 00:50
Oxygenbuilder2 Template overview Add Column "Apply To" and "In Use"
<?php
/**
* Add a apply_to and in_use column to Oxygenbuilder2.0's ct_templates overview.
* It will:
* - tell you the rules on the templates
* - show you if a re-usable is being used on a post/page/cpt so if not, you can safely delete it.
*/
add_filter('manage_edit-ct_template_columns', 'add_new_ct_template_columns');
/**