Skip to content

Instantly share code, notes, and snippets.

@craigsimps
Created June 22, 2018 18:19
Show Gist options
  • Save craigsimps/a2ab9c81bcf3621e933e71764cde80c5 to your computer and use it in GitHub Desktop.
Save craigsimps/a2ab9c81bcf3621e933e71764cde80c5 to your computer and use it in GitHub Desktop.
<?php
add_filter( 'genesis_customizer_theme_settings_config', __NAMESPACE__ . '\\remove_genesis_customizer_panels' );
/**
* Remove redundant Genesis Customizer panels.
*
* @param array $config The config array for theme settings in the Customizer.
*
* @return array
*/
function remove_genesis_customizer_panels( $config ) {
$panels = [
'genesis_updates',
'genesis_header',
'genesis_adsense',
'genesis_color_scheme',
'genesis_layout',
'genesis_breadcrumbs',
'genesis_comments',
'genesis_archives',
'genesis_scripts',
];
array_walk( $panels, function ( $panel ) use ( &$config ) {
unset( $config['genesis']['sections'][ $panel ] );
} );
return $config;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment