| 开发者 | pexlechris |
|---|---|
| 更新时间 | 2026年5月30日 05:41 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.0 |
| 版权: | GPLv2 |
| 版权网址: | 版权信息 |
yoursite.com/library). To display any other directory, you can use the path parameter available in Library Viewer Pro.
Whether you want to share documents with your customers on the front-end or manage them internally from the WordPress dashboard, Library Viewer provides a seamless and secure experience.
The significant difference from other similar plugins is that:
Starting from version 3.3.0, you can access your library directly from the WordPress back-end. Simply navigate to Media > Library Viewer. You can browse your files in the "Library" tab and customize the page title or access permissions in the "Settings" tab. This is perfect for administrators who need quick access without leaving the dashboard! Read more in ADMIN PAGE DOCUMENTATION
You can use the Library Viewer for WooCommerce Add-on. It allows you to link specific folders to WooCommerce products, granting access automatically upon purchase.
Yes, by adding the Library Viewer File Manager Add-on. This enables front-end uploading, renaming, and deletion of files and folders based on user roles.
Yes, with Library Viewer Pro you can display any folder on the same server, even if it is outside your WordPress installation directory (e.g., above the public_html folder), as long as the server's PHP has access to it.
This can be achieved using the lv_filter_global_abspath filter to change the default ABSPATH to the root path of the folder you want to display.
For more detailed instructions and code examples on how to set this up, please feel free to ask in the support forum. As you can see, I usually respond within a few hours to help you out!
Yes. By default, the plugin hides:
.php and .ini files.
Rename your files or folders accordingly to hide them. For more advanced control (including specific inclusion/exclusion lists), you can use Library Viewer Pro.Yes, with Library Viewer Pro you can protect your files so they are only accessible through the plugin's viewer, preventing direct URL access. See this support topic: wordpress.org/support/topic/executable-pdf-file
To enhance security, you should add the following code to a .htaccess file inside the folder you want to protect:
<Files *.php> deny from all </Files>
You can test your own use cases in the DEMO
Library Viewer have been tested with TinyMCE (Classic Editor), Gutenberg, WPBakery, Visual Composer, Elementor and works fine! Generally can be used, everywhere that shortcodes are accepted...
Yes. If you want to add text above the front-end folders or below the front-end files, you can create via FTP a file with name "include.php" in the FTP folder that you want texts to be shown in front-end.
HTML tags are allowed!
Your texts must be values of php variables ($text_at_beginning , $text_at_end respectively) as you can see below:
`
Also, you can use the hookslv_folder_text_at_beginningandlv_folder_text_at_end` respectively for this scope.
= Is Library Viewer' file viewer supports all mime types (file extensions)?
From 1.1.2, the Library Viewer' file viewer supports all mime types that WordPress supports.
These that included in the function: wp_get_mime_types()
If you want to add support for mime types that are not included, use the WP filter: lv_mime_types to include them.
Read more in HOOKS DOCUMENTATION
Read also how to add PHP hooks in your WordPress Site in my blog
= I want all files to be downloaded. Is that possible?
Yes, you need to use the Library Viewer' file viewer (my_doc_viewer="library-viewer") and to add the following hook in your functions.php
add_filter('lv_mime_types', function(){ return array(); });
Read how to add PHP hooks in your WordPress Site in my blog
Yes. But only with plain CSS at the moment. So you can add your custom css from WP customizer (from Additional CSS)
Yes. I need new ideas to improve my plugin. Send it to me via email or via support forum
lv_autoload_shortcodes. It is recommended to autoload this option only if shortcodes are used on every page.lv_should_load_shortcode to control whether the shortcode should be loaded in the current request.Library_Viewer_Init::get_file_identifier() to retrieve the LV file identifier.Library_Viewer_Init::should_load_file_viewer() to determine if the file viewer should be loaded for the current request.lv_should_load_file_viewer to control whether the Library Viewer's file viewer should be loaded.load_plugin_textdomain is now hooked to init with priority 1 instead of 10.Library_Viewer_Init.library-viewer-shortcodes is no longer autoloaded by default.Library_Viewer_Plugin_Page to Library_Viewer_Plugin_Row to better reflect that it handles the plugin row (action links & meta links) in the Plugins page.new Library_Viewer_Plugin_Row();library-viewer-shortcodes rest api URLs (/wp-json/)Library_Viewer_Init::is_frontend() method has been deprecated. Use Library_Viewer_Init::should_load_shortcode() instead, after init with priority 10.lv_is_frontend filter has been deprecated. You can use filter lv_should_load_shortcode to control whether the shortcode should be loaded in the current request.set_file_identifier callback from the init action has been removed.dir GET parameter now displays slashes (/) instead of their encoded form (%2F).Undefined array key "abspath", which occurred when viewing a file.Library_Viewer_Init::is_frontend() to determine when the above hooks should be loaded.login_page shortcode parameter.lv_prepend_document_title action handles this.$library_viewer_object, which stores the shortcode object after shortcode execution or when a file is being viewed.lv_prepend_document_title filter introduced. Used to prepend the current folder in document title parts.lv_folder_name filter introduced. With this filter, you can filter the name of a folder. See more details in docs.lv_breadcrumb_item_html filter introduced. With this filter, you can filter html of each breadcrumb item. See more details in docs.enqueue_scripts introduced, in order all addons be able to enqueue shortcode scripts more efficiently.enqueue_styles introduced, in order all addons be able to enqueue shortcode styles more efficiently.enqueue_styles_and_scripts!Library_Viewer_Shortcode::get_single_shortcode_attrs()Library_Viewer_Shortcode::get_page_shortcodes_matches()Library_Viewer_Shortcode::get_page_shortcodes_counter()Library_Viewer_Shortcode::get_current_folder()Library_Viewer_Shortcode::get_breadcrumb_items()Library_Viewer_Shortcode::get_globals()protected method get_current_page_url() to public.lv_before_breadcrumb_start action has been deprecated. You can use filter lv_breadcrumb_html to return the HTML you want.lv_after_breadcrumb_start action has been deprecated. You can use filter lv_breadcrumb_html to return the HTML you want.lv_after_breadcrumb_end action has been deprecated. You can use filter lv_breadcrumb_html to return the HTML you want.lv_before_breadcrumb_end action has been deprecated. You can use filter lv_breadcrumb_html to return the HTML you want.LIBRARY_VIEWER_SHORTCODE has been removed. You can replace it with $GLOBALS['library_viewer_object']?->get_globals().apply_filters('lv_file_identifier', 'LV') to get fil identifier.LV__folder_was_viewed, `LV__file_was_viewed, LV__mime_types, wp_get_mime_types, LV__array_replace_to__in_filenames, LV__array_replace_from__in_foldernames, LV__array_replace_from__in_filenames, LV__folder_html, LV__file_htmlLibrary_Viewer_Shortcode (and its child classes), shortcode_class_names, file_viewer_class_names, and all_class_names have been removed and replaced by the class_names property.library-viewer-name has been added in the div with class library-viewer--containerlv_filter_global_{$parameter} filter introduced. With this filter, you can filter the parameters BEFORE the rest globals' initialization.lv_breadcrumb_html filter introduced. With this filter, you can filter the html of whole breadcrumb.library folder doesn't exist, will be created automatically when the shortcode will called in the front-end.current_viewer was not existed. Now exists.lv_file_anchor_html, the variable $file_anchor_href has been also added in the array $file (2nd parameter). View hook' documentation for more info..library-viewer--folder h3{margin-top: 0; display: inline-block;} css has been added.lv_shortcode_class_name has been replaced by lv_shortcode_class_names. This is an advanced hook...lv_file_viewer_class_name has been replaced by lv_file_viewer_class_names. This is an advanced hook...breadcrumb value has been removed from Library Viewer globals parameter of all hooks. From now, there is only in Library Viewer Pro's hooksmy_doc_viewer parameter. If you don't want to be encoded use lv_my_doc_viewer_file_encoded filter.library-viewer--current-breadcrumb-item class removed from breadcrumb current item. Replaced with the CSS rule .library-viewer--breadcrumb-item:last-of-type
Hooks:LV__folder_was_viewed action replaced with lv_folder_was_viewed action.LV__array_replace_to__in_foldernames filter replaced with lv_folder_fake_path_symbols filter.LV__array_replace_from__in_foldernames filter replaced with lv_folder_real_path_symbols filter.LV__array_replace_to__in_filenames filter replaced with lv_file_fake_path_symbols filter.LV__array_replace_from__in_filenames filter replaced with lv_file_real_path_symbols filter.LV__folder_html filter replaced with lv_folder_html filter.LV__file_html filter replaced with lv_file_html filter.LV__file_was_viewed filter replaced with lv_file_was_viewed filter.lv_file_identifier filter introduced. With this you can change the '/LV/' that is the part of URL of a file.lv_before_breadcrumb_start action introduced.lv_after_breadcrumb_start action introduced.lv_breadcrumb_folder_delimiter_html action introduced. You can change the delimiter of folders of breadcrumb.lv_breadcrumb_items action introduced. With this filter, you can alter the breadcrumb items, for example the folder name and folder fake link.lv_before_breadcrumb_end action introduced.lv_after_breadcrumb_end action introduced.lv_empty_folder_html filter introduced. If the current folder contains neither files nor folders, an equivalent message will be displayed an with filter. With this filter you can change it.lv_folder_text_at_beginning filter introduced. This filter allow us to add or change the text at beginning of the folder, i.e. the text before the first containing folder.lv_containing_folders filter introduced. Containing folders of current folder filter.lv_folder_icon_html filter introduced. Used to filter the html of folder icon.lv_folder_html filter introduced. Used to filter the html output of printed folder.lv_before_folder action introduced.lv_after_folder action introduced.lv_containing_files filter introduced. Containing files of current folder filter.lv_file_icon_html filter introduced. Used to set a file icon using php.lv_file_html filter introduced. Used to filter the html output of printed file.lv_before_file action introduced.lv_after_file action introduced.lv_folder_text_at_end filter introduced. This filter allow us to add or change the text at end of the folder, i.e. the text after the last containing file.lv_folder_was_viewed action introduced. Do some actions if a folder was accessed/viewed.lv_file_was_viewed action introduced. Do some actions if a file was accessed/viewed.lv_my_doc_viewer_file_encoded introduced. With this filter you can determine if the file will be appended to my_doc_viewer as encoded or not default is true (encoded).lv_mime_types introduced. If you want to add support for mime types that are not included, use this filter.LV__folder_html introduced the $attributes parameterLV__file_html introduced