Add, edit specific CPT with custom role

There’s no such hook named load-themes.php in WordPress. One of the hooks you can use to add custom capabilities is after_setup_theme. Also, there’s no need to use ‘themes.php’ == $pagenow && isset($_GET[‘activated’]) condition there. What are you trying to achieve this way? Try to use this code instead: add_action( ‘after_setup_theme’, function() { $role = get_role( … Read more