Skip to content

Instantly share code, notes, and snippets.

@markjaquith
Created January 12, 2021 08:28
Show Gist options
  • Select an option

  • Save markjaquith/852c716b06df15aea6bf07e1161bbb91 to your computer and use it in GitHub Desktop.

Select an option

Save markjaquith/852c716b06df15aea6bf07e1161bbb91 to your computer and use it in GitHub Desktop.

Revisions

  1. markjaquith created this gist Jan 12, 2021.
    7 changes: 7 additions & 0 deletions Disable-ACF-UI.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    <?php

    // Block the ACF settings UI entirely, except on local dev.
    if (! defined('WP_LOCAL_DEV') || ! WP_LOCAL_DEV) {
    add_filter('acf/settings/show_admin', '__return_false');
    add_filter('acf/settings/capability', function () { return 'do_not_allow'; });
    }