Image upload vs. Image Advanced

Support General Image upload vs. Image AdvancedResolved

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #33916
    Ole PoetterOle Poetter
    Participant

    Hi,

    for users on frontend I have a image upload field. That's fine.

    Is there any way to transform this image upload field for me as admin in backend to an image advanced field?

    This user should not have access to the Media Library, but I as admin.

    Kind Regards,
    Ole

    #33927
    Long NguyenLong Nguyen
    Moderator

    Hi Ole,

    It is possible. You can use the filter rwmb_normalize_{$field_id}_field to change the field type on backend only. For example:

    add_filter( 'rwmb_normalize_image_upload_ID_field', function( $field ) {
        if( is_admin() ){
            $field['type'] = 'image_advanced';    
        }    
        return $field;
    });

    Read more on the documentation https://docs.metabox.io/filters/#rwmb_normalize_field

    #33930
    Ole PoetterOle Poetter
    Participant

    Hi Long,

    amazing....it works.

    Thank you very much.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.