File / Image / Video Field

The File / Image / Video field is used to store a relationship to Media attachment(s).

File Upload input (Row list style)
File Upload input (Tile list style)

The File / Image / Video field can store attachments to one or more Media items. It works similar to Relationships in terms of how data is stored and displayed.

Quick Start

  1. Fill out the Basic Field Settings (Label, Description, and Field Name)
  2. Select Field Type: File / Image / Video.
  3. Click Save New Field (or Save Field if you’re updating an existing field) to save your field configuration.

Settings

  • Upload Limit
    The available options are:
    • Single File
    • Multiple Files
      • Max Number of Files
        You can choose how many files to allow for Multiple Files. Default is “0” for no limit, but you can enter 1 or more to limit the number of items that can be selected.
  • File Uploader
    You can choose what kind of file upload experience you want. The available options are:
    • Upload and/or Select (Media Library)
      • Media Library Default Tab
        This is the default tab to show when clicking to choose a new file. Default is “Upload File”. The available options are:
        • Upload File
        • Media Library
      • Modal Title
        This is the title used in the Media Library modal that opens up when adding or selecting a file. Default is “Attach a file”.
      • Modal Add Button Text
        This is the add button text used for the Add File button within the modal itself. Default is “Add File”.
    • Upload only (Plupload)
      • Upload Directory
        This allows you to change where uploads will be saved to on your site folder structure. The available options are:
        • WordPress Default (/wp-content/uploads/yyyy/mm/)
        • Custom directory within the default uploads directory
          • Custom Upload Directory
            This allows you to enter a path relative to the /wp-content/uploads/ folder on your site. This is where files will be uploaded to when uploaded specifically using this File field.
      • Restrict File Size
        This allows you to limit the file size to a custom size. Valid size suffixes are: GB (gigabytes), MB (megabytes), KB (kilobytes), or B (bytes). This overrides what WordPress uses but may not exceed the maximum upload file size in WordPress. Leave empty to remain unchanged.
  • Restrict File Types
    This allows you to restrict which types of files can be uploaded and chosen for this File field. The available options are:
    • Images (jpg, jpeg, png, gif)
    • Video (mpg, mov, flv, mp4, etc..)
    • Audio (mp3, m4a, wav, wma, etc..)
    • Text (txt, csv, tsv, rtx, etc..)
    • Any Type (no restriction)
    • Other (customize allowed extensions)
      • Allowed File Extensions
        This allows you to specify file extensions manually. Separate file extensions with a comma (ex. “jpg,png,mp4,mov”).
  • Add Button Text
    This is the text of the Add File button that will be used to upload a file. Default is “Add File”.
  • For file types set to Images
    • List Style
      This is the style which files will appear in the form field. The available options are:
      • Rows
      • Tiles
    • Output as a WP Gallery
      This is a useful option that lets you display your Image(s) as a Gallery.
      • Gallery Image Links
        When using the WP Gallery, you can choose to automatically link the images. The available options are:
        • Attachment Page
        • Media File
        • None
      • Gallery Image Columns
        When using the WP Gallery, you can choose which number of image columns. You can choose between 1-9 columns of images.
      • Gallery Randomized Order
        When using the WP Gallery, you can choose to sort the images in a randomized order.
      • Gallery Image Size
        When using the WP Gallery, you can choose a supported image size to display the images with.

How to Display

By default, Pods will not link to the file URL when displaying. It will display as an image if the media type is an image. Otherwise, nothing will be displayed if there is no image representation of the attachment.

You can also traverse into any attachment’s data by following field() traversal notation which includes displaying specific fields for an attachment or displaying using a specific image size.

Display with a Shortcode

[pods field="my_file_field"]

Display with PHP: pods_field_display()

<?php
echo pods_field_display( 'my_file_field' );

Display with PHP: $pod->display()

<?php
$pod = pods();

echo $pod->display( 'my_file_field' );

Limitations

Elementor integration

The Elementor integration does not currently support the “Images – Any” option. You can only use the “Images” Restrict File Type option if you want to display images through Elementor. See the following discussions for reference:

Other Helpful Documentation on Working with Fields in Pods

Avatar Field

Extends User Profile with a Gravatar field that is managed under the Media Library as opposed to using Gravatar.com

Code (Syntax Highlighting) Field

The Code (Syntax Highlighting) field is used for multiple line code content.

Color Picker Field

The Color Picker field is useful in situations where a color needs to be able to be chosen and customized.

Conditional Logic for Fields

Conditional Logic for Fields will allow you to show or hide a field based on the value of another field.

Currency Field

The Currency field is used to store numeric, integer, and float currency amounts.

Date / Time Field

The Date / Time field is used to store a date and time value with an easy to use date / time input.

Date Field

The Date field is used to store a date value with an easy to use date input.

Date time fields redirect

Email Field

The Email field allows you to store email addresses with additional validation checks.

Heading Field

The Heading field is not a normal input field, it will output Heading text between your normal form fields to help organize the form.

HTML Content Field

The HTML Content field is not a normal input field, it will output as HTML itself between your normal form fields to help organize the form.

oEmbed Field

The oEmbed field is used to store a single URL that will use the oEmbed protocol to display remote content.

Password Field

The Password field is used to store single-line text with a basic password input form field.

Phone Field

The Phone field is used for telephone numbers in various formats.

Plain Number Field

The Plain Number field is used to store numeric, integer, and float values.

Plain Paragraph Text Field

The Plain Paragraph Text field is used for multiple line text values.

Plain Text Field

The Plain Text field is used for Simple Plain Text Values like a first name, last name, alphanumeric ID or value.

Relationship Field

The Relationship field is used to store related items on various objects in WordPress.

Settings: Advanced

Provides access to the Advanced field options when editing a field.

Settings: Field Details

Basic Field Settings (Label, Name, Description and Field Type) that apply to all Fields created in Pods.

Settings: Reserved List of Names

There are certain names you cannot use for Pod, Group, or Field names in Pods because they are reserved in WordPress or Pods for other uses.

Simple Repeatable Fields

Simple Repeatable Fields will allow you to repeat many different types of fields.

Time Field

The Time field is used to store a date value with an easy to use time input.

Website Field

The Website field is used to store a URL or Website Address or Link to a Website.

WYSIWYG (Visual Editor) Field

The WYSIWYG (Visual Editor) field is used for multiple line HTML content.

Yes / No Field

The Yes / No field offers customizable labels and display options for checkbox, radio buttons, or a drop-down input.