Skip to content

Instantly share code, notes, and snippets.

@luclemo
Created March 21, 2019 18:23
Show Gist options
  • Save luclemo/e46d5f45a72109c53e87b75a71d147f0 to your computer and use it in GitHub Desktop.
Save luclemo/e46d5f45a72109c53e87b75a71d147f0 to your computer and use it in GitHub Desktop.
Protect custom fields if they are on a password protected page #wordpress
<?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