wp 6.7.1
compatible
php 8.3
compatible
An average of 4.5 stars for ratings on wp.org!

Custom Post Type (CPT)

The file metadata is saved in a custom post type named "shared_file" while the actual files are stored under the WordPress installation in directory /wp-content/uploads/shared-files/ (or in a subdirectory under that if defined so in the settings).

You can loop the shared_file CPT in a PHP template using WP_Query or get_posts().

It's also possible to fetch and manipulate the file metadata using the built-in functions of WordPress: get_post_meta() and update_post_meta()

The file metadata is saved in the following fields:

Field title Field name
Filename (used in the file URL) _sf_filename
File date (can be used instead of the post date) _sf_main_date
External URL _sf_external_url
Expiration date _sf_expiration_date
Notification email _sf_notify_email
Allow access for these users _sf_permission_user_id
Password _sf_password
Allow access for these roles (boolean) _sf_permission_user_role_administrator
_sf_permission_user_role_editor
_sf_permission_user_role_author
_sf_permission_user_role_contributor
_sf_permission_user_role_subscriber
_sf_permission_user_role_anonymous
_sf_permission_user_role_translator
(and any custom roles you might have on your site)
Limit downloads to this count (int) _sf_limit_downloads
Custom fields _sf_file_upload_cf_1
_sf_file_upload_cf_2
_sf_file_upload_cf_3
etc.
Description _sf_description

More data in these fields (not editable in the UI):

Field title Field name
File info (not the actual file, which is stored outside the database) _sf_file
File load count (int) _sf_load_cnt
Bandwidth usage _sf_bandwidth_usage
File was originally added at this time _sf_file_added
Post ID of the page the file was uploaded on using the front end uploader _sf_embed_post_id
Page title of the page the file was uploaded on, at the time the file was uploaded _sf_embed_post_title
If set to 1, the file will be shown only on the page it was uploaded on (using the front end uploader) _sf_not_public
Manually set ID using the shortcode [shared_files file_upload=1 upload_id="name-for-id"] _sf_upload_id
If there is a connection to the media library, the post ID of that media library item _sf_media_library_post_id