Loading metabox data in frontend using php throws and

Support Meta Box AIO Loading metabox data in frontend using php throws andResolved

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #46872
    Oskar EdinOskar Edin
    Participant

    Hello!

    We have a custom post type for some IT documentation. When we try to load some fields in front-end using PHP, it shows up some <p> and </br> for wysiwyg fields, all other fields shows up correctly.

    The code we use to load the data: https://pastebin.com/8uid9F7T

    The data shows up like this: https://prnt.sc/l8OPLxK2P--t

    SO: Övrig serverinfo: <p>AD Server<br />DNS<br />IIS<br />File and Storage Services</p>

    What do we have to adjust to make the code not showing up?

    Thanks a lot!

    #46881
    PeterPeter
    Moderator

    Hello Henrik,

    You use the function esc_html() which escapes HTML tags to wrap the field output, so HTML tags will display in plain text. Please remove it and recheck the issue.

    esc_html($serverinformation_clone['serverinformation'])

    #46891
    Oskar EdinOskar Edin
    Participant

    Awesome, thanks, that worked!

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.