get_names(); $roles = array(); foreach ( $role_names as $key => $value ) { $roles[ $key ] = get_role( $key ); $roles[ $key ]->display_name = $value; } $post_types = get_post_types( array( 'public' => true, '_builtin' => false ) ); $dont_touch = get_post_types( array( 'capability_type' => 'post' ) ); $not_mapped = get_post_types( array( 'map_meta_cap' => false ) ); // Don't edit capabilties for any custom post type with "post" as its capability type $post_types = array_diff( $post_types, $dont_touch ); // For mapping capabilities, post type needs to have map_meta_cap set to true $mapped_post_types = array_diff( $post_types, $not_mapped ); echo '