| 开发者 | dglingren |
|---|---|
| 更新时间 | 2026年1月28日 09:12 |
| 捐献地址: | 去捐款 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 6.9 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
[mla_gallery] display and you can add custom fields as sortable, searchable columns in the Media/Assistant submenu table. You can also modify the WordPress _wp_attachment_metadata contents to suit your needs.[mla_gallery] shortcode, used in a post, page or custom post type to add a gallery of images and/or other Media Library items (such as PDF documents). MLA Gallery is a superset of the WordPress [gallery] shortcode; it is compatible with [gallery] and provides many enhancements. These include: 1) full query and display support for WordPress categories, tags, custom taxonomies and custom fields, 2) support for all post_mime_type values, not just images 3) media Library items need not be "attached" to the post, and 4) control over the styles, markup and content of each gallery using Style and Markup Templates. Twenty-eight hooks are provided for complete gallery customization from your theme or plugin code.[mla_tag_cloud] shortcode, displays a "cloud" of the "most used" terms in your Media Library where the size of each term is determined by how many times that particular term has been assigned to Media Library items. Twenty-five hooks are provided for complete cloud customization from your theme or plugin code.[mla_term_list] shortcode, displays hierarchical (and flat) taxonomy terms in list, dropdown control or checklist formats. Twenty hooks are provided for complete list customization from your theme or plugin code.[mla_custom_list] shortcode, displays flat/cloud lists, dropdown controls and checkbox lists of custom field values. Twenty-seven hooks are provided for complete list customization from your theme or plugin code.[mla_archive_list] shortcode, displays flat/cloud lists and dropdown controls of date-based values. Twenty hooks are provided for complete list customization from your theme or plugin code.[mla_gallery] galleries.[mla_gallery] shortcode.[mla_gallery] shortcode.media-library-assistant and its subfolders to your /wp-content/plugins/ directory, OR Visit the Plugins/Add New page and search for "Media Library Assistant"; click "Install Now" to upload it[mla_gallery] shortcode to add galleries of images, documents and more to your posts and pages[mla_tag_cloud], [mla_term_list], [mla_custom_list] and [mla_archive_list] shortcodes to add clickable lists of taxonomy terms, custom field values and date-based values to your posts and pagesYou can add support for many attachment metadata values such as file size by visiting the Custom Fields tab on the Settings page. There you can define a rule that maps the data to a WordPress custom field and check the "MLA Column" box to make that field a sortable column in the Media/Assistant submenu table. You can also use the field in your [mla_gallery] shortcodes. For example, this shortcode displays a gallery of the ten largest images in the "general" category, with a custom caption:
[mla_gallery category="general" mla_caption="{+caption+}<br>{+custom:File Size+}" meta_key="File Size" orderby="meta_value" order="DESC" numberposts=10]
The powerful [mla_gallery] shortcode supports almost all of the query flexibility provided by the WP_Query class. You can find complete documentation in the Settings/Media Library Assistant Documentation tab. A simple example is in the preceding question. Here's an example that displays PDF documents with Att. Category "fauna" or Att. Tag "animal":
[mla_gallery post_mime_type="application/pdf" size=icon mla_caption="{+title+}" tax_query="array(array('taxonomy'=>'attachment_category','field'=>'slug','terms'=>'fauna'),array('taxonomy'=>'attachment_tag','field'=>'slug','terms'=>'animal'),'relation'=>'OR')"]
Yes! The [mla_gallery] shortcode supports all MIME types when you add the post_mime_type parameter to your query. You can build a gallery of your PDF documents, plain text files and other attachments. You can mix images and other MIME types in the same gallery, too. Here's an example that displays a gallery of PDF documents, using Imagick and Ghostscript to show the first page of each document as a thumbnail:
[mla_gallery post_mime_type=application/pdf post_parent=all link=file mla_viewer=true columns=1 orderby=date order=desc]
Yes! You can activate or deactivate support for Categories and Tags at any time by visiting the Media Library Assistant Settings page.
No! The Assistant supplies pre-defined Att. Categories and Att. Tags; these are WordPress custom taxonomies, with all of the API support that implies. You can activate or deactivate the pre-defined taxonomies at any time by visiting the Media Library Assistant Settings page.
Yes. Any custom taxonomy you register with the Attachment post type will appear in the Assistant UI. Use the Media Library Assistant Settings page to add support for your taxonomies to the Assistant UI.
You can use other gallery-generating shortcodes to give you the data selection power of [mla_gallery] and the formatting/display power of popular alternatives such as the WordPress.com Jetpack Carousel and Tiled Galleries modules. Any shortcode that accepts "ids=" or a similar parameter listing the attachment ID values for the gallery can be used. Here's an example of a Jetpack Tiled gallery for everything except vegetables:
[mla_gallery attachment_category=vegetable tax_operator="NOT IN" mla_alt_shortcode=gallery type="rectangular"]
Most lightbox plugins use HTML class= and/or rel= tags to activate their features. [mla_gallery] lets you add this tag information to your gallery output. Here's an example that opens PDF documents in a shadowbox using Easy Fancybox:
[mla_gallery post_mime_type=application/pdf post_parent=all link=file size=icon mla_caption='<a class="fancybox-iframe fancybox-pdf" href={+filelink_url+} target=_blank>{+title+}</a>' mla_link_attributes='class="fancybox-pdf fancybox-iframe"']
In the example, the mla_caption= parameter turns the document title into a link to the shadowbox display so you can click on the thumbnail image or the caption to activate the display.
This is a known WordPress problem with multiple support tickets already in Trac, e.g., Ticket #20708(closed defect (bug): duplicate) Wrong posts count in taxonomy table, Ticket #14084(assigned defect (bug)) Custom taxonomy count includes draft & trashed posts, and Ticket #14076(closed defect (bug): duplicate) Misleading post count on taxonomy screen. For example, if you add Tags support to the Assistant and then assign tag values to your attachments, the "Posts" column in the "Tags" edit screen under the Posts admin section includes attachments in the count. If you click on the number in that column, only posts and pages are displayed. There are similar issues with custom post types and taxonomies (whether you use the Assistant or not). The "Attachments" column in the edit screens added by the Assistant shows the correct count because it works in a different way.
No; that's a structural limitation of the WordPress database. However, you can use Categories, Tags and custom taxonomies to organize your images and associate them with posts and pages in any way you like. The [mla_gallery] shortcode makes it easy. You can also use the ids= parameter to compose a gallery from a list of specific images.
Hover over the item you want to modify and click the "Edit" or "Quick Edit" action. Set the ID portion of the Parent Info field to zero (0), then click "Update" to record your changes. If you change your mind, click "Cancel" to return to the main page without recording any changes. You can also click the "Select" button to bring up a list of posts//pages and select one to be the new parent for the item. The "Set Parent" link in the Media/Assistant submenu table also supports changing the parent and unattaching an item.
Some of the MLA features such as where-used reporting and ALT Text sorting/searching require a lot of database processing. If this is an issue for you, go to the Settings page and adjust the "Where-used database access tuning" settings. For any where-used category you can enable or disable processing. For the "Gallery in" and "MLA Gallery in" you can also choose to update the results on every page load or to cache the results for fifteen minutes between updates. The cache is also flushed automatically when posts, pages or attachments are inserted or updated.
Rest assured, custom templates and all of your option settings persist unchanged whenever you update to a new MLA version. You can also back a backup of your templates and settings from the Settings/Media Library Assistant General tab. Scroll to the bottom of the page and click "Export ALL Settings" to create a backup file. You can create as many files as you like; they are date and time stamped so you can restore the one you want later. In addition, you can deactivate and even delete the plugin without losing the settings. They will be there when you reinstall and activate in the future. You can permanently delete the settings and (optionally) the backup files if you are removing MLA for good. The "Uninstall (Delete)" Plugin Settings section of the General tab enables these options.
Not many, but all of the internationalization work in the plugin source code has been completed and there is a Portable Object Template (.POT) available in the "/languages" directory. I don't have working knowledge of anything but English, but if you'd like to volunteer to produce a translation, I would be delighted to work with you to make it happen. Have a look at the "MLA Internationalization Guide.pdf" file in the languages directory and get in touch.
All of the MLA source code has been annotated with "DocBlocks", a special type of comment used by phpDocumentor to generate API documentation. If you'd like a deeper understanding of the code, navigate to the MLA phpDocs web page and have a look. Note that these pages require JavaScript for much of their functionality.
[mla_archive_list] shortcode lets you create lists and dropdown controls with date-based elements and use them to filter the gallery displayed by the [mla_gallery] shortcode.mla_get_custom_values() function used by the [mla_custom_list] shortcode is now available for public use in the MLAShortcodes class (includes/class-mla-shortcodes.php).utf8_encode() function call, deprecated in PHP 8.2, has been replaced.[muie_archive_list] shortcode has been deprecated.[mla_gallery] shortcode, the "mla_viewer" feature has been redesigned to mitigate an Unauthenticated Local File Read security issue. The feature now uses WordPress AJAX processing when PDF thumbnail images are not available, which is less efficient but secure.[mla_gallery] shortcode, the "Transfer by Item Name" feature has been redesigned to mitigate an Insecure Direct Object Reference security issue. This fix also requires you to manually update the "MLA Item Transfer Pretty Links" example plugin if your site uses it.[mla_term_list] shortcode, a defect that caused the famous "There Has Been a Critical Error on This Website" error has been corrected.screen_options_show_screen filter for the Settings/Media Library Assistant page has been updated to avoid a defect in Sugar Calendar Lite v3.8.0 (fixed in v3.8.1).[mla_term_list] shortcode, the checklist,div output format wraps the list in an HTML "div" tag so, for example, you can add CSS styles to highlight the current list item or limit the size of the display area and add scroll bars to a long list. More information in the Settings/Media Library Assistant Documentation tab.[mla_gallery] shortcode, the meta_date_key parameter supports simple date searches and the date_query using any custom field instead of the Uploaded on date. More information in the Settings/Media Library Assistant Documentation tab.[mla_tag_cloud] and [mla_term_list] shortcode parameters have been mitigated.mla_image_class and mla_image_alt parameters. Two enhancements, two fixes in all.class-mla-options.php. Delay localization of built-in style and markup templates until init action.[mla_gallery] parameters containing HTML are once again processed correctly. New "MLA Custom Field List" shortcode. Code refactor reduces load time and memory required for the [mla_gallery] shortcode. Four enhancements in all, six fixes.[mla_gallery], MLA Insert Fixit improvements, [mla_gallery] simple date parameters, "Mine" filter/view. Four enhancements in all, twelve fixes.[mla_gallery] and Media Manager Modal Window. Seven enhancements in all, eleven fixes.[mla_gallery], corrects v2.63 problem that applied mla_named_transfer to all link=file and link=download galleries.xdebug_get_function_stack() causing fatal PHP error.[mla_gallery] display. Seven enhancements in all, six fixes.[mla_gallery] style and markup templates. Five other fixes.[mla_gallery] support for custom fields, taxonomy terms and IPTC/EXIF metadata. Updated for WordPress 3.5![mla_gallery] parameters "mla_itemwidth" and "mla_margin" for control of gallery item spacing. Quick edit support of WordPress standard Categories taxonomy has been fixed.[mla_gallery] shortcode output. Eight other enhancements and four fixes.[gallery] and [mla_gallery] shortcodes. Two other enhancements and two fixes.[mla_gallery] shortcode, a superset of the [gallery] shortcode that provides many enhancements. These include taxonomy support and all post_mime_type values (not just images). Media Library items need not be "attached" to the post.