• Resolved ali.dolphin

    (@alidolphin)


    Hi

    I am trying to password protect custom fields using the default WordPress Password Protect feature.

    Can you confirm if the following code will work with hiding a location custom fields. I will need to expand this to multiple fields.

    if ( post_password_required() ) {
        $value = get_field( "Location" );
    
        if( $value ) {
            echo $value;
        }
    } else {
        echo 'You need to enter a password to see this information';
    }
    • This topic was modified 1 year, 4 months ago by ali.dolphin.
    • This topic was modified 1 year, 4 months ago by ali.dolphin.
Viewing 1 replies (of 1 total)
  • Plugin Author Jory Hogeveen

    (@keraweb)

    Hi @alidolphin

    Based on the documentation this would indeed not display the value if no password is provided.
    However, keep in mind that there are more methods of retrieving metadata like the REST API so if there is sensitive data there you’ll have to validate this in more areas.

    Cheers, Jory

Viewing 1 replies (of 1 total)
  • The topic ‘Password Protect Custom Fields’ is closed to new replies.