• Resolved lestadt

    (@lestadt)


    Hello, I wonder if it would be possible to mask the content of a custom field, what would I have to do ?, what code should I use? Is it possible? Any suggestions?

Viewing 1 replies (of 1 total)
  • Plugin Author mihdan

    (@mihdan)

    You will have to add just a line in a theme code where you output custom field data.

    To add same preprocessing for data as for comment text, use

    $metadata = apply_filters( ‘comment_text’, $metadata );

    For example, if you use some kind of metadata, it should look like this:

    // get data from wordpress database
    $metadata = get_post_meta( $id, ‘MetaTagName’, true );
    
    // add this line of code for preprocessing field value 
    $metadata = apply_filters( ‘comment_text’, $metadata ); 
    
    //output preprocessed field value
    echo $metadata;
    

    Use the_content instead of comment_text if you want to use the same masking policy as for post text.

    • This reply was modified 6 years, 7 months ago by mihdan.
Viewing 1 replies (of 1 total)
  • The topic ‘Encoded Masks for a custom field’ is closed to new replies.