Shortcode Parameters

have_file_access
have_file_access parameter determines which user have access to view the files.
Accepts user capabilities or roles separated by commas, `logged_in` and `all`.
"all" is the DEFAULT value.

HAVE_FILE_ACCESS PARAMETER USE CASES

- have_file_access="all" : public access, all people can open the files.
- have_file_access="administrator" : only administrators can open the files.
- have_file_access="administrator,author,subscriber" : only administrators,
authors and subscribers can open the files.
- have_file_access="edit_posts" : only those that have the CAPABILITY
to edit posts, can open the files.
- have_file_access="subscriber,edit_posts" : only subscribers and those that
have the CAPABILITY to edit posts, can open the files.
- have_file_access="logged_in" : all logged in users can open the files.
my_doc_viewer
my_doc_viewer parameter determines in which viewer the file will be opened.
Accepts `default`, `library-viewer` or any other link.
If $have_file_access=='all', `default` is the default value,
If not, `library-viewer` is the default value.

MY_DOC_VIEWER PARAMETER USE CASES

NOTE: If have_file_access is NOT in the DEFAULT state, my_doc_viewer does NOTHING.

- my_doc_viewer="default" : the files open in the default viewer of your browser
or they are downloaded.
- my_doc_viewer="library-viewer" : the files open in the Library Viewer’ viewer.
- my_doc_viewer="https://docs.google.com/viewerng/viewer?url=" : the files open
with Google Doc Viewer.
(The advantage of google doc viewer is that opens
ALL the files -pdf,doc,docx,ppt etc- in the browser, in smartphones too)
- my_doc_viewer="http://ouo.io/qs/Is36k2da?s=" : the files open via paid URL shortener
- Or : you can use your custom viewer.
login_page
login_page parameter defines the login page that user will be redirected -if need it-,
to log in. Accepts `wp-login.php` or any slug. Default is `wp-login.php`.
DON'S USE SLUG WITH GET PARAMETERS PLEASE.

LOGIN_PAGE PARAMETER USE CASES

If have_file_access is NOT in the DEFAULT state and you had set your custom login page,
you can define it in this parameter.

- login_page="wp-login.php" : the user will be redirected in the default WP login page
to log in.
- login_page="login" : if your login page is located in the link
yoursite.com/login/
- login_page="my-account" : if your login page is located in the link
yoursite.com/my-account/
- login_page="pages/login" : if your login page is located in the link
yoursite.com/pages/login/
path
path parameter allow us to choose what folder we want to display in the Library
in the front-end. When we say, folder, we mean folder's contents
i.e. containing folders and files of this folder.
Accepts string, the name of the folder to view. Examples below.
"library" is the DEFAULT value.

PATH PARAMETER USE CASES

- path="wp-content" : containing folders & files of `wp-content` directory are
being displayed in the front-end
- path="wp-content/uploads" : containing folders & files of `uploads` directory
are being displayed in the front-end. `wp-content/` nowhere is being displayed!
So users don't know what is the actually path of the folder that they see in the Library.
- path="wp-content/uploads/2015" : containing folders & files of `2015` directory
are being displayed in the front-end. `wp-content/uploads/` nowhere is being displayed!
So users don't know what is the actually path of the folder that they see in the Library.
- path="root" : All the folders and files of your site are being displayed in the Library.
- path="mysite.gr" : All the folders and files of your site are being displayed in the Library,
if the file_identifier have been changed with the `lv_file_identifier` filter
Just adding this code in functions.php :
add_filter('lv_file_identifier', function(){return 'mysite.gr';});
- If you want to display the contents of folder root (mysite.gr/root/) :
just change the file identifier:
add_filter('lv_file_identifier', function(){return '';});
and in shortcode use the
path='root'
hidden_folders
hidden_folders determines which folders will not be displayed and will not be accessible
by Library in the front-end.
Accepts string. The names of hidden folders separated by commas and empty string ''.
'hidden-folder' is the DEFAULT value.

HIDDEN_FOLDERS PARAMETER USE CASES

- hidden_folders='wp-, hidden-folder' : Folders that contains in their (reaL) name
the `wp-` or `hidden-folder` will not be accessible via the Library and also
will be hidden.
- hidden_folders='wp-' : Folders that contains in their (reaL) name the `wp-`
will not be accessible via the Library and also will be hidden.
- hidden_folders='' : No one folder will be hidden from the Library.
shown_folders
shown_folders parameter determines which folders will be displayed and will be accessible
by Library in the front-end.
Accepts string. The names of shown folders separated by commas and empty string ''.
DEFAULT behavior (if this parameter is not included in the shortcode call)
is to show all the folders.

SHOWN_FOLDERS PARAMETER USE CASES

- shown_folders='wp-, plugins' : Only folders that contains in their (reaL) name
the `wp-` or `plugins` will be accessible via the Library and also will be shown.
- shown_folders='wp-' : Only folders that contains in their (reaL) name
the `wp-` will be accessible via the Library and also will be shown.
- shown_folders='' : No one folder will be shown and will be accessible via the Library.
hidden_files
hidden_files determines which files will not be displayed and will not be accessible
by Library in the front-end.
Accepts string. The names of hidden files separated by commas and empty string ''.
'hidden-file' is the DEFAULT value.

HIDDEN_FILES PARAMETER USE CASES

- hidden_files='wp-, hidden-file' : Files that contains in their (reaL) name
the `wp-` or `hidden-file` will not be accessible via the Library and also
will be hidden.
- hidden_files='wp-' : Files that contains in their (reaL) name the `wp-`
will not be accessible via the Library and also will be hidden.
- hidden_files='' : No one file will be hidden and will be accessible via the Library.
shown_files
shown_files parameter determines which files will be displayed and will be accessible
by Library in the front-end.
Accepts string. The names of shown files separated by commas and empty string ''.
DEFAULT behavior (if this parameter is not included in the shortcode call)
is to show all the files.

SHOWN_FILES PARAMETER USE CASES

- shown_files='wp-, plugins' : Only files that contains in their (reaL) name
the `wp-` or `plugins` will be accessible via the Library and also will be shown.
- shown_files='wp-' : Only files that contains in their (reaL) name
the `wp-` will be accessible via the Library and also will be shown.
- shown_files='' : No one file will be shown and will be accessible via the Library.
breadcrumb
breadcrumb parameter determines if breadcrumb will be displayed
in the Library in front-end.
Accepts 'yes' and 'no'.
'yes' is the DEFAULT value.

BREADCRUMB PARAMETER USE CASES

- breadcrumb='yes' : Breadcrumb will be displayed in the Library in front-end.
- breadcrumb='no' : Breadcrumb won't be displayed in the Library in front-end.
waiting_seconds
waiting_seconds parameter sets the seconds of user is waiting the redirection
to login and see the file (0: for instant redirect).
Accepts integer.
'5' is the DEFAULT value.

WAITING SECONDS PARAMETER USE CASES

- waiting_seconds='0' : When the user opens a file and he/she is not logged in,
is redirected to login page to login instantly.
- waiting_seconds='3' : When the user opens a file and he/she is not logged in,
is redirected to login page to login after 3 seconds.
url_suffix
url_suffix is the suffix of files' URLs,
before file identifier ('LV' is the default file identifier).
You can use this parameter, when you have more than one libraries shortcodes
in the same page, and with different parameters.

URL SUFFIX PARAMETER USE CASE

If you use the library viewer shortcode more than one time in the same page
and you use in the shortcodes different parameters with different values,
you need to use `url_suffix` parameter in order to separate them.

Example: If you want to use the following shortcodes:
[library-viewer path="wp-content" have_file_access="logged_in" waiting_seconds="11"]
[library-viewer have_file_access="author" waiting_seconds="22"]
USE A URL SUFFIX AT LEAST IN OF THESE SHORTCODES

Accepts string.
DEFAULT value is an empty string.
Scroll to top