After adding the code, the role does not appear in the selection list. Tell me what's wrong? Maybe something prevents the creation of a new role? Since the code is perfect).
register_activation_hook( __FILE__, array( 'mpg', 'mpg_activation' ) ); function mpg_activation(){ add_role('mpg_new', 'New', array( 'read' => true, 'edit_posts' => true, 'delete_posts' => true, 'publish_posts' => true ) ); } The function is written in the plugin. Also, certain rights are already prescribed for the custom type of post, which will be managed by the user with the above role.
Instructions read:
array( $this, 'mpg_activation' )? - KAGG Design