post-field: relative path, text-field: html not working

Support General post-field: relative path, text-field: html not workingResolved

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #46020
    jw_blnjw_bln
    Participant

    Hi,
    I have two hopefully simple questions:

    I am using the post-field and want to get a relative link
    (so NOT https://abc.com/cpt/pagetitle/ BUT /cpt/pagetitle/).
    Is there an easy way (e.g. with options?

    Not sure why, but it seems, the text field cannot save HTML tags, I want to save
    "first line<br>second line", but it will not work - what should I check?

    #46026
    PeterPeter
    Moderator

    Hello,

    1. The post field saves the post ID to the database. You can get the raw field value (post ID), and get a relative path based on the ID. Following the WordPress documentation https://developer.wordpress.org/reference/functions/wp_make_link_relative/

    2. Please bypass the sanitization to add HTML tags to the text field
    https://docs.metabox.io/sanitization/#bypass-the-sanitization

    #46028
    jw_blnjw_bln
    Participant

    Great, thanks.

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