Wrap two or more blocks in a single link
-
A few months back, you showed me the meta_field_block_get_block_content filter. Wich I love. I recently implemeted the following
if ( ('att-email' === $field_name ) && ($content != '')) { return '<a href="mailto:'.$content.'" title="Email"><i class="fa fa-envelope" aria-hidden="true"></i></a>'; }
But now I want to wrap name meta fields in a link. Is there a good way to do this? I can fudge it with multiple filters, but that does not seem like the RIGHT way to do it.
e.g. I have First, Middle, and Last names as separate fields, but would like it to be like this
return '<a href="'.esc_url(get_permalink()).'">'.$first.' '.$middle." ".$last.'</a>';
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Wrap two or more blocks in a single link’ is closed to new replies.