• Resolved resqonline

    (@resqonline)


    unfortunately the latest version doesn’t seem to be able to limit field type “group” to certain roles, only the sub-fields of this group, which means, user roles who shouldn’t see the fields see the group field name

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author John Huebner

    (@hube2)

    Unfortunately, because fields hidden by this plugin aren’t updated correctly when a repeater is updated I had to remove support for repeater fields, which includes group fields. This is because in order to allow repeaters to save correctly the values need to be provided in hidden fields. This is an issue with repeaters of any kind because the values are in nested arrays and I have not worked out a way to output all of the hidden fields that would be required to allow them to continue working. Enabling group fields would break your field content, and quite possibly crash your site.

    Plugin Author John Huebner

    (@hube2)

    Now that I think more about it, I think this plugin will break any field that has an array value, including select, taxonomy, relationship, and several more. I am looking into a way to resolve this. Hopefully I can, otherwise I’m going to need to discontinue this plugin.

    Thread Starter resqonline

    (@resqonline)

    hm, that’s too bad! so I have to disable each group manually for certain user roles…

    Thread Starter resqonline

    (@resqonline)

    I am using a custom class and the following code to just hide the field not supposed to be seen by the user role:

    // CSS based on user role
    add_action( 'wp_enqueue_scripts', 'hide_from_author_users' );
    function hide_from_author_users(){
        if( in_array( 'author', (array) wp_get_current_user()->roles ) ){
            echo '<style>
                .authorhide {
                    display: none;
                }
            </style>';
        }
    }
    Plugin Author John Huebner

    (@hube2)

    I am pretty sure I have this solved, let me know of you run into any problems.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘User roles not showing in Groups field’ is closed to new replies.