GenerateBlocks button and link with rel=me attribute

Hi there!
Now that Mastodon is relevant, I’m trying to accomplish a link to my Mastodon profile.
The link should contain rel=“me” attribute and value in order to make profile confirmed.
Something like this Mastodon

In GB only possible to add rel=“sponsored” and rel=“nofollow” as in the screenshot


Any advice available in adding rel=“me” ?

Rgds Teuvo

Hi @Stedi,

Try adding add-rel-me to the class list of the Block.

Then, add this Snippet:

function db_rerender_rel_me( $block_content, $block ) {
	if(!is_admin() && ! empty( $block['attrs']['className'] ) && strpos( $block['attrs']['className'], 'add-rel-me' ) !== false  ) {
			$my_replace='rel="me" href="';
			$new_content = str_replace($my_search, $my_replace, $block_content);
			return $new_content;
    return $block_content;
add_filter( 'render_block', 'db_rerender_rel_me', 10, 2 );

Adding PHP: Adding PHP - Documentation

1 Like

Great, works fine!

But another problem arised.

The margin setting in the button does not have any effect in the frontend.

(Finnish translation, sorry)

and in the site quite truncated:

Can you provide the link to the site in question so we can have a look?

Footer social links.
BUT I just updated both GP theme and GPP plugin as there were an update available today.
And the problem went away. I also purged the cache.

I see. Glad it’s resolved now!