WordPress.org

Ready to get started?Download WordPress

Forums

WP No External Links
[resolved] Mask in Custom fields? (2 posts)

  1. devrekli
    Member
    Posted 1 year ago #

    Hello. I tried many auto nofollow plugins including wp-noexternallinks . But its not working in my custom fields.

    my custom fields name= downloadurl

    I've read it but I do not understand. which file? what line? what code should be written? Can anyone help me? thanks

    How can I mask links in custom field?

    You will have to add just a line in 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:
    $metadata = get_post_meta($id, 'MetaTagName', true);// get data from wordpress database
    $metadata=apply_filters('comment_text',$metadata);// add this line of code for preprocessing field value
    echo $metadata;//output preprocessed field value

    That's if you want to mask links in custom field like in comments text. Use "the_content" instead of "comment_text" if you want to use the same masking policy as for post text.

    http://wordpress.org/extend/plugins/wp-noexternallinks/

  2. Jehy
    Member
    Plugin Author

    Posted 10 months ago #

    You can try masking all output, or add filter to your custom field.

    You need to apply filter at the place where your custom filed is created, modified or written to output - it depends on nature of this custom field...

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.