Skip to content

Instantly share code, notes, and snippets.

@Christian-Roth
Last active January 26, 2024 09:12
Show Gist options
  • Save Christian-Roth/215482d36b591992f98c044980bbfda5 to your computer and use it in GitHub Desktop.
Save Christian-Roth/215482d36b591992f98c044980bbfda5 to your computer and use it in GitHub Desktop.
Removes the admin menu for CPTs, Taxonomies or Options Pages in ACF
<?php
/* Disable CPTs und Taxomies in ACF and ACF PRO */
add_filter( 'acf/settings/enable_post_types', '__return_false' );
/* Disable Options Pages in ACF PRO */
add_filter( 'acf/settings/enable_options_pages_ui', '__return_false' );
/* Disable Options Pages in ACF */
add_action( 'admin_init', function () {
remove_submenu_page( 'edit.php?post_type=acf-field-group', 'acf_options_preview' );
}, 99 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment