Last active
January 26, 2024 09:12
-
-
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
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 | |
/* 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