Skip to content

Instantly share code, notes, and snippets.

@adrianvalenz
Last active May 22, 2017 08:41
Show Gist options
  • Save adrianvalenz/69e85e340eb8204ef84c67f86572f6a2 to your computer and use it in GitHub Desktop.
Save adrianvalenz/69e85e340eb8204ef84c67f86572f6a2 to your computer and use it in GitHub Desktop.
place this after initial php open tag to update the site's url
update_option( 'siteurl', 'http://example.com' );
update_option( 'home', 'http://example.com' );
// Allow editors to see Appearance menu
$role_object = get_role( 'editor' );
$role_object->add_cap( 'edit_theme_options' );
function hide_menu() {
// Hide theme selection page
remove_submenu_page( 'themes.php', 'themes.php' );
// Hide widgets page
remove_submenu_page( 'themes.php', 'widgets.php' );
// Hide customize page
global $submenu;
unset($submenu['themes.php'][6]);
}
add_action('admin_head', 'hide_menu');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment