0

How do we restrict a user to see a field in a post without registration, after registration the user will be able to see the link.

I have a project in which I have created a post from an excelsheet by a plugin, now I want to hide a field of link with login/register button, after registration the user will able to see this link.

3

I assume you mean on the front end;

<?php
    if (is_user_logged_in()) {
        // Only visible when logged in
    } else {
        // Only visible when not logged in
    }
?>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.