Feature Request: Make Links not clickable inside of Block Editor

Hello you fantastic Pinegrow Guys,

While building Blocks that are clickable (for example Cards or Custom Buttons) one thing annoys me: Selecting such Blocks inside the WP Editor is difficult because the link opens immediately.

Would it be possible to add an Option to the Smart Action for disabling links inside of the Block Editor (could be default, i think)?
The URL could be replaced by “#void” for example while rendered in Backend (Idea from here).

Hi @MichelyWeb :slight_smile: We do that already:

Link in a JS block:

Link in a PHP block:

Please share an example where this doesn’t work.

Hi @matjaz
here’s a case where it’s not working:
When setting the Link with PHP code with replacement of ´href` attribute.
Might be special because a mix of Block + PHP Code?

@MichelyWeb the suppressing feature only works with Block Attributes action. To do that with custom code, as in your case, you could use:

(!empty($_GET['context']) && $_GET['context'] === 'edit') ? 'javascript:void()' : get_field('booking-link', 'options')

It is a code sausage but should get the job done.

1 Like

Thank you very much @matjaz

Here is a ACF Block where this is not working automatically while using Actions only:

The link is clickable inside of the Block Editor.

Solution for Links in ACF Blocks:

2 Likes