This file contains 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 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'); | |
/** |
This file contains 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
/*! 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 |
This file contains 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/sc_attr/type=image' , 'add_image_class_attr' , 10 ,1 ); | |
// add a custom attribute named 'myclass' | |
function add_image_class_attr( $attr ) { | |
$attr['myclass'] = ''; | |
return $attr; | |
} |
This file contains 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/sc_attr/type=new_fieldtype', 'my_own_attr_defaults' , 10 , 1 ); | |
function my_own_attr_defaults ( $attr = array() ) { | |
$new_attr = array( | |
'field' => '', | |
'format' => null, | |
'allowempty' => 'false', | |
'postid' => 0, |
This file contains 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/sc_attr/type=new_fieldtype' , 'toolbox::return_shortcode_attr_default' , 10, 1 ); |
This file contains 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_timber_posts_data' , 'my_custom_data' ,10 ,1 ); | |
function my_custom_data( $data ) { | |
$data['mydata'] = array( | |
'firstname' => 'John', | |
'lastname' => 'Doe' | |
); |
This file contains 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=text', 'my_text_codefield_filter', 10, 5 ); | |
/** | |
* Your custom filter for a text-field with the name 'codefield' | |
*/ | |
public static function my_text_codefield_filter( $string , $field_object , $value , $atts = null , $postid = null ) { | |
// check if the requested fieldname is 'codefield' and the type of the field_object is 'text' | |
// if so, append and prepend the string by <code></code> |
This file contains 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 | |
/** | |
* Default return function for a text or unknown fieldtype | |
*/ | |
public static function acf_return_text( $string , $field_object , $value , $atts = null , $postid = null ) { | |
if ( is_array( $value ) ) return $string; | |
return $string . $value; | |
} |
This file contains 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=youtubepicker' , 'toolboxConnectors::settings_text', 10, 2 ); | |
add_filter( 'toolbox/helpers/sc_attr/type=youtubepicker' , 'toolbox::return_shortcode_attr_default' , 10, 1 ); | |
// add_filter( 'toolbox/helpers/get_acf_field/type=youtubepicker' , 'toolbox::post_object_to_array' , 20, 5 ); | |
add_filter( 'toolbox/helpers/get_acf_field/type=youtubepicker' , 'display_youtubepicker' , 10, 5 ); | |
/** |
This file contains 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
{% for item in __field__ %} | |
<h3>{{item.title}}</h3> | |
<p>{{item.preview(100)}}</p> | |
{% endfor %} |