-
Notifications
You must be signed in to change notification settings - Fork 1
Home
Hi there! Welcome to the Featured Galleries wiki. This wiki is the main source of documentation for developers working with (or contributing to) the Featured Galleries WordPress plugin.
Please note, this plugin is not for end users. This plugin is meant to theme developers, or theme setup-ers. Regulars users can add this to an existing site, but you need to understand basic PHP, because this plugin only handles the backend.
This plugin handles Featured Galleries in the same way that WordPress handles Featured Images. IE, it handles the backend/admin part of gallery creation by adding an admin metabox that lets users open the MediaManager and select images. Image IDs are then saved in post metadata, and themes are responsible for using PHP code to get those image IDs, convert them to image URLs, and display them on the page.
WordPress comes with get_post_thumbnail_id() built-in. Featured Galleries adds get_post_gallery_ids. As long as it is used on a single post or page template, it doesn't need to be passed any parameters. In that case, by default, it will return a PHP array with the ID's of all images in the post's Featured Gallery. However, you can also customize the returned value to suit your needs, with up to three parameters.
For details on how to use this function, see get_post_gallery_ids docs.
By default, Featured Galleries are enabled on Posts and Pages. The plugin comes with a filter, fg_post_types to allow you to easily integrate featured galleries into any custom post type(s).
The media manager modal is the popup modal that opens on the backend/admin page when users want to select images. This modal can be customized. By default, the right "Details" sidebar is hidden. However, you may wish to see it. The plugin comes with a filter, fg_show_sidebar, which will allow you to show the sidebar rather than hide it.
Note, this filter only affects the media manager modal for the Featured Galleries metabox. Other metaboxes may call the media manager as well, but those aren't affected by this plugin.
Up until v2.1.0, the Media Manager Modal was set to use the default selection mode. Multiple images can be selected, but it requires holding down the SHIFT key or the COMMAND/CONTROL key.
In v2.1.0, the default behavior has been changed to use the Gallery selection mode. Clicking on thumbnails adds them to the selection, rather than resetting the selection. The SHIFT key and COMMAND/CONTROL key is not needed.
Some people may prefer the legacy selection mode. The plugin comes with a filter, fg_use_legacy_selection to allow you to easily switch back.