Tips on Customizing Image Gallery

How to Hide Image Gallery Admin Menus

function plt_hide_new_image_gallery_menus() {
	//Hide "Image Gallery".
	remove_menu_page('edit.php?post_type=image_gallery');
	//Hide "Image Gallery → All Image Gallery".
	remove_submenu_page('edit.php?post_type=image_gallery', 'edit.php?post_type=image_gallery');
	//Hide "Image Gallery → Add Image Gallery".
	remove_submenu_page('edit.php?post_type=image_gallery', 'post-new.php?post_type=image_gallery');
	//Hide "Image Gallery → Docs".
	remove_submenu_page('edit.php?post_type=image_gallery', 'ig-doc-page');
	//Hide "Image Gallery → Our Plugins".
	remove_submenu_page('edit.php?post_type=image_gallery', 'ig-our-plugins');
	//Hide "Image Gallery → Our Themes".
	remove_submenu_page('edit.php?post_type=image_gallery', 'ig-our-themes');
}

add_action('admin_menu', 'plt_hide_new_image_gallery_menus', 102);

Where do I put this code?

How to Hide Image Gallery Meta Boxes

function plt_hide_new_image_gallery_metaboxes() {
	$screen = get_current_screen();
	if ( !$screen ) {
		return;
	}

	//Hide the "Copy Image Gallery Shortcode" meta box.
	remove_meta_box('1', $screen->id, 'side');
	//Hide the "Add Image" meta box.
	remove_meta_box('2', $screen->id, 'normal');
}

add_action('add_meta_boxes', 'plt_hide_new_image_gallery_metaboxes', 20);