Field file_upload change options

Support General Field file_upload change options

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #10317
    Infolu OfficialInfolu Official
    Participant

    Hello, when using the file_upload or file field, the displayed files there are two Edit and remove options, is it possible to remove the edit option leaving only the remove option?

    Image and video hosting by TinyPic

    #10324
    Anh TranAnh Tran
    Keymaster

    Hi, this can be done with CSS. Here is a trick to output quick CSS for the field without enqueuing new CSS file:

    <?php
    add_filter( 'rwmb_meta_boxes', function( $meta_boxes ) {
        $meta_boxes[] = [
            'title' => 'Test Meta Box',
            'fields' => [
                [
                    'type' => 'file_upload',
                    'id'   => 'test',
                    'name' => 'File Upload',
                    'after' => '<style>.rwmb-edit-media { display: none; }</style>'
                ]
            ],
        ];
        return $meta_boxes;
    } );
    #10333
    Infolu OfficialInfolu Official
    Participant

    Great solution, but I think that in the future it would be great to have direct options as below

    'options' => array(
    'edit' => false,
    'remove' => false,
    ),

    it's just something I thought of improvement, thank you anyway.

    Best regards, Araújo Luiz

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Field file_upload change options’ is closed to new replies.