Tagged: , , ,

Viewing 4 reply threads
  • Author
    Posts
    • #4418
      cezarion
      Participant

      Hello,

      I need to filter media type (application,video,image,…) when I use an upload field.
      It seems that this is not available in Piklist.
      With few modifications it’s available :
      in parts/fields/file.php – ligne 31

      
       <a
            href="#"
            class="button piklist-upload-file-button piklist-field-part"
            title="<?php _e($options['modal_title']); ?>"
            data-type="<?php echo isset($options['mime_type'] ? $options['mime_type'] : ""; ?>"
          >
      

      in parts/js/piklists.js – ligne 1728

      
      var media_frame = wp.media.frames.file_frame = wp.media({
        title: button.attr('title'),
        button: {
          text: button.text(),
        },
        multiple: true,
        library:{ type: button.data('type') }
      );
      

      I don’t know if it’s the good way, if not I’m interesting in your return.
      I think it would be a nice feature.

    • #4419
      cezarion
      Participant

      Updated : (semicolon missing)

      
          <a
            href="#"
            class="button piklist-upload-file-button piklist-field-part"
            title="<?php _e($options['modal_title']); ?>"
            data-type="<?php echo isset($options['mime_type']) ? $options['mime_type'] : ""; ?>"
          >
      
    • #4426
      Steve
      Keymaster

      @cezarion– Welcome to the Piklist Community!

      Piklist allows you to create your own validation rules. I suggest you try that and let us know what you think.

    • #4431
      cezarion
      Participant

      Yes, I saw, but it’s not about validation, just filtering media by type when the user open the media window and this filter is based on the rules of validations.
      I set my validations rules for this field. It’s works fine ! )-

    • #4458
      Steve
      Keymaster

      Great! Closing ticket. Let us know if you need any more help.

Viewing 4 reply threads
  • You must be logged in to reply to this topic.