Shortcodes are used to implement the features of the plugin like frontend file manager, a gallery with selected files etc. You can insert them in a page, post or templates in your theme as per your convenience. Below are some shortcodes that the User Private Files PRO plugin offers.
Use this shortcode in a page to display a full-features file manager dashboard on frontend of your site.
If you are using the classic text editor in your site, you can directly paste this in the page content.
If you are using a page builder like Guttenberg, WPBakery, Elementor etc. then you need to insert a shortcode block and then paste this shortcode in that block’s content.
On the frontend, it works like a single page app and uses AJAX functionality to perform various actions. There is no page refresh when users use this.
Please see this (Link will be added soon) page for detailed instructions on how to manage files and folders using this frontend file manager dashboard.
Use this shortcode to display a list of selected files and folders that users have access to.
This shortcode accepts 2 parameters called “id” and “limit_folder_view” where id is a required parameter.
Pass the ids of the files or folders that you want to display and pass the roles to the second parameter separated by commas.
You can find the id of files and folders from the backend file manager. Go to the backend file manager and click a file or folder to see its id in the shortcode on the right sidebar information panel.
E.g. a typical shortcode may look like this – [upf_selected_files id=”401, 35″ limit_folder_view=”administrator”]
Where 401 could be the id of a folder and 35 could be the id of a file.
The second parameter decides whether to display the folder itself or the content from inside to these roles. In this example, admin users will see the folders and all other users will see the content from inside and they won’t know if these are from a folder.
If you don’t use the second parameter, folders will always display themselves by default.
Note: This shortcode will not display files if a user doesn’t have access to them.
This shortcode is used to display files that are publicly available and are not private. Users can view these files without the need of creating an account on your site.
This shortcode requires one parameter “id”. To display all public files, use the shortcode [upf_public_folder id=”public-files”]. Change the id to a folder/file id to display specific public folders or files.
You can copy this shortcode from the backend file manager. When you click the public files or any files/folders inside, you can see the shortcode on the right sidebar.
Public files are only viewable (supported formats) and downloadable. There is no functionality of sharing, editing, comments etc.
If you like to display only Upload Box to your users, use this shortcode.
This shortcode accepts an optional attribute “id”. You can pass a folder ID to it and the file will be uploaded to that folder if the user has upload access to it.
If there is no id attribute, the files will be uploaded to all files under the my-files section of that user.
If you like to display a user’s uploaded and shared files only. This works like a gallery. This will not display any folder but will display all files from the folders.
This is a limited shortcode and doesn’t offer much features. But if you just want to display all files that a user has uploaded and the files that he has given access to, then it’s a good one.