Created
January 14, 2021 08:50
-
-
Save abelsaad/292591427451d1d428885312d25f70dc to your computer and use it in GitHub Desktop.
Disable Install New Theme Button
This file contains hidden or 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 | |
function __block_caps( $caps, $cap ) { | |
if ( $cap === 'install_themes' ) | |
$caps[] = 'do_not_allow'; | |
return $caps; | |
} | |
add_filter( 'map_meta_cap', '__block_caps', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment