Last active
December 22, 2016 09:51
-
-
Save badabingbreda/fece16228feece8646cd4d7298d4160f to your computer and use it in GitHub Desktop.
ACF Template Builder - Using a custom attribute when displaying the ACF field
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
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] | |
*/ | |
function add_red_border ( $string , $field_object , $value , $atts , $postid ) { | |
if ( $atts[ 'color' ] !== null ) return '<div style="border:2px solid '.$atts[ 'color' ].'">' . $string . '</div>'; | |
return $string; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment