Skip to content

Instantly share code, notes, and snippets.

@badabingbreda
Last active December 22, 2016 09:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save badabingbreda/fece16228feece8646cd4d7298d4160f to your computer and use it in GitHub Desktop.
Save badabingbreda/fece16228feece8646cd4d7298d4160f to your computer and use it in GitHub Desktop.
ACF Template Builder - Using a custom attribute when displaying the ACF field
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