• I’m trying to find a way to place an e-mail link for the WordPress administrator in the widget footer using the Block-based Widgets Editor. In the classic widget editor, we used the following code:

    <a href="mailto:<?php bloginfo('admin_email'); ?>">Contact Webmaster</a>

    Obviously, the Block Editor doesn’t play nicely with PHP code. Because the Block-based Widgets Editor is relatively new, I can’t find an alternative method of offering this functionality.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Just making sure if you have tested your widget for html / php code?

    Thread Starter baxysquare

    (@baxysquare)

    Yes. The legacy Custom HTML widget seemed to work with PHP just fine. But when I try using this same code with the Custom HTML in the block editor, rather than place the administrator’s e-mail where it should go, the link says:

    mailto:<?php bloginfo('admin_email'); ?>

    I’m more than happy to ditch the PHP code if there’s another way to place an administrator’s e-mail address in the footer. Or if there’s a way to make the PHP code work from a block, that works too. I simply want it to work the way it did before we upgraded.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Admin Email Address Link in Block-based Widgets Editor’ is closed to new replies.