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/sc_attr/type=new_fieldtype' , 'toolbox::return_shortcode_attr_default' , 10, 1 ); |
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_timber_posts_data' , 'my_custom_data' ,10 ,1 ); | |
function my_custom_data( $data ) { | |
$data['mydata'] = array( | |
'firstname' => 'John', | |
'lastname' => 'Doe' | |
); |
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=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 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 | |
/** | |
* 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 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=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 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
{% for item in __field__ %} | |
<h3>{{item.title}}</h3> | |
<p>{{item.preview(100)}}</p> | |
{% endfor %} |
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 | |
/** | |
* pass in the query and make sure to return it at the end | |
*/ | |
function my_query_filter( $query ) { | |
if (isset($_GET['bedrooms']) && $_GET['bedrooms'] !== '') { | |
$query[ 'meta_query' ][0]['relation'] = 'AND'; | |
$query[ 'meta_query' ][0][] = array( | |
'key' => 'bedrooms', |
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 | |
class toolboxTwigExtend { | |
public static function init() { | |
add_filter( 'timber/twig', __CLASS__ . '::add_to_twig' ); | |
} | |
public static function add_to_twig( $twig ) { |
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
(function($) { | |
$(document).ready(function(){ | |
var $toc = $('#toc'), // toc id | |
appendthis = ''; // build the toc | |
$toc.html(''); // clear receiving <div id="toc"></div> | |
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_geo_detect', 10, 1 ); | |
function add_geo_detect() { | |
toolboxExtender::add_conditional_option( | |
// filter name | |
'geo_detect', | |
// option key and title | |
array('key'=> 'geo_check' , 'title' => __('Geo Check', 'textdomain') ), |