This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// add the timber template option to the wysiwyg field | |
add_filter( 'toolbox/helpers/settings/type=wysiwyg' , 'toolboxConnectors::timber_template' , 10, 2 ); | |
//add the processing of the timber template to the end (or not) of the wysiwyg output filter | |
add_filter( 'toolbox/helpers/get_acf_field/type=wysiwyg' , 'toolbox::timber_template', 20, 5 ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// add filter, make sure the priority is at the right position | |
add_filter( 'toolbox/helpers/get_acf_field/type=repeater' , 'do_var_dump' , 15 , 5 ); | |
// Use this function to dump out the value to determine what you might need | |
function do_var_dump( $string, $field_object , $value , $atts, $postid ) { | |
ob_start(); | |
var_dump( $string ); // $string | $field_object | $value | $atts | $postid | |
return ob_get_clean(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'toolbox/helpers/get_acf_field/type=checkbox' , 'return_checkbox' , 20, 5 ); | |
function return_checkbox( $string , $field_object , $value , $atts = null , $postid = null ) { | |
if (!$atts['display_as']) return $string; | |
$return = array(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'toolbox/helpers/get_acf_field/type=checkbox' , 'show_me_checkbox' , 20, 5 ); | |
function show_me_checkbox( $string , $field_object, $value, $atts, $postid ) { | |
ob_start(); | |
var_dump( $field_object ); | |
return ob_get_clean(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'toolbox/helpers/settings/type=wysiwyg' , 'more_wysiwyg_settings' , 10, 2 ); | |
function more_wysiwyg_settings( $settings ) { | |
return array_merge( $settings, array( | |
'highlight' => array( | |
'type' => 'text', | |
'label' => __('Highlight Text', 'textdomain'), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'toolbox/helpers/get_acf_field/type=wysiwyg' , 'highlight_amsterdam_glass', 10, 5 ); | |
function highlight_amsterdam_glass( $string, $field_object, $value, $atts, $postid ) { | |
$regex = '/((?i)\b' . 'amsterdam glass' . '\b)/m'; | |
return preg_replace( $regex , '<span style="background-color:##b2af01;color:#fff;padding-left:5px;padding-right:5px;">'.'$1'.'</span>', $string); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// simple example of a conditional filter | |
add_filter( 'conditional_filter_check_userloggedin' , 'my_check_userloggedin' ,10 ,2 ); | |
function my_check_userloggedin( $is_visible , $node ) { | |
return is_user_logged_in(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'toolbox_add_conditional_options' , 'add_some_new_conditional_feature', 10, 1 ); | |
function add_some_new_conditional_feature() { | |
toolboxExtender::add_conditional_option( | |
// filter name | |
'conditional_filter_check_parameter', | |
// option key and title | |
array('key'=> 'check_parameter' , 'title' => __('Check URL Parameter', 'textdomain') ), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Add to functions.php to mimic *whitelabel* on Pro license | |
* Please support Beaver Builder by buying the product at wpbeaverbuilder.com | |
*/ | |
class FLBuilderWhiteLabel { | |
public static function is_white_labeled() { | |
return true; |