Support

Account

Home Forums General Issues Line Break on ACF Link Text

Helping

Line Break on ACF Link Text

  • Is it possible to use html line breaks (<br> or <br/>) when entering text on ACF’s Link Text field?

    The code line is <?php echo get_field('link')['title']; ?> without esc_html, but the “<br>” tag still appears as a string on the frontend.

    Are there any other solutions possible?

  • No, you cannot use breaks here. ACF uses the built in link editor, the same on that WP uses when you insert a link into content. The text you insert for the link title will be escaped when saving to the database and html tag characters converted to html entities. This escaping happens on saving the value and not when displaying the value.

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

You must be logged in to reply to this topic.