Created
March 21, 2019 18:23
-
-
Save luclemo/e46d5f45a72109c53e87b75a71d147f0 to your computer and use it in GitHub Desktop.
Protect custom fields if they are on a password protected page #wordpress
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Add custom fields to password protected blocks | |
* | |
* @link https://wordpress.org/support/article/using-password-protection/#protect-custom-fields | |
*/ | |
if ( ! post_password_required() ) { | |
// Your ACF code goes here. | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment