Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.