Last active
June 18, 2018 18:53
-
-
Save badabingbreda/d40930faaedd712e02392aba2fefa2ca to your computer and use it in GitHub Desktop.
Toolbox Example - Adding your own set of SC Attribute Defaults
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', 'my_own_attr_defaults' , 10 , 1 ); | |
function my_own_attr_defaults ( $attr = array() ) { | |
$new_attr = array( | |
'field' => '', | |
'format' => null, | |
'allowempty' => 'false', | |
'postid' => 0, | |
'nodeid' => null, // beaver builder node id | |
'twigtemplate' => false, | |
); | |
return array_merge ( $attr , $new_attr ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment