Skip to content

Instantly share code, notes, and snippets.

@ithinkandicode
Created November 23, 2021 18:27
Show Gist options
  • Save ithinkandicode/7dfdc26bd923b8ed26bd6d265f3fc7fa to your computer and use it in GitHub Desktop.
Save ithinkandicode/7dfdc26bd923b8ed26bd6d265f3fc7fa to your computer and use it in GitHub Desktop.
ACF Extended - Disable default settings
<?php
add_action( 'acf/init', 'acfextended_disable_modules' );
/**
* Disable some ACF Extended modules which are enabled by default.
*
* @link https://wordpress.org/plugins/acf-extended/
* @link https://www.acf-extended.com/features/modules
* @link https://www.acf-extended.com/features/wordpress
*
* @return void
*/
function acfextended_disable_modules()
{
// Features » Modules
// ------------------------------------------------------------------------
// Disable Block Types
// Not needed if you use Classic Editor or manage ACF Blocks in the backend
// https://www.acf-extended.com/features/modules/dynamic-block-types
acf_update_setting('acfe/modules/block_types', false);
// Disable Dynamic Forms
// Not needed unless you have frontend ACF forms
// https://www.acf-extended.com/features/modules/dynamic-forms
acf_update_setting('acfe/modules/forms', false);
// Disable Options Pages
// Not needed if you already manage options pages in the backend
// https://www.acf-extended.com/features/modules/dynamic-options-pages
acf_update_setting('acfe/modules/options_pages', false);
// Disable Post Types
// Not needed if you use CPT UI, or manage CPTs in the backend
// https://www.acf-extended.com/features/modules/dynamic-post-types
acf_update_setting('acfe/modules/post_types', false);
// Disable Taxonomies
// Not needed if you use CPT UI, or manage custom taxonomies in the backend
// https://www.acf-extended.com/features/modules/dynamic-taxonomies
acf_update_setting('acfe/modules/taxonomies', false);
// Features » WordPress
// ------------------------------------------------------------------------
// Disable Enhanced UI
// This changes the design of core WP admin pages, eg. making tax terms
// look like CPTs, making Settings > General etc look like ACF fields
// https://www.acf-extended.com/features/wordpress/enhanced-ui
acf_update_setting('acfe/modules/ui', false);
// Disable Ajax Author box
// Uses AAJX to load the author dropdown, which is slower on most sites
// https://www.acf-extended.com/features/wordpress/ajax-author-box
acf_update_setting('acfe/modules/author', false);
// Disable WP Options
// Adds a new page under Settings > Options, usually not needed
// https://www.acf-extended.com/features/wordpress/options
acf_update_setting('acfe/modules/options', false);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment