Skip to content

Plugin that extends the WordPress media library with some features (folders, dominant color, location category, and others).

License

Notifications You must be signed in to change notification settings

picasso/zu-media

Repository files navigation

Zu Media: Media Library with folders and more.

WordPress Plugin Version WordPress Plugin: Tested WP Version WordPress Plugin Required PHP Version License

Enhances WordPress Media Library with some features (folders, dominant color, location category and others).

Zu Media - Media Library with folders, dominant colors and more.

Description

This plugin includes several enhancements to the WordPress Media Library that can be used within specialized themes or separately. The plugin allows users to quickly organize all their media into folders. You can easily drag and drop images into folders and change the tree view of the folders as you wish. The plugin also allows you to calculate the dominant color for all images in your Media Library (which can then be used in different blocks or shortcodes), add different categories and tags to images, create a set of media sizes to display Responsive Images, and much more.

🎃 In addition to the main functionality, the plugin implements many small functions for working with the Media Library, which I found it possible to include in the plugin for ease of developing WordPress themes.

Folders Features

  • Create unlimited folders in the Media Library
  • Allows to rename and delete folders
  • Drag and drop folders, change order, and hierarchy
  • Bulk select images and media files and drag them to any folder
  • Assign colors to selected folders
  • Lock folders - images in locked folders cannot be used for random selection
  • Customize the look and feel of your folders
  • Monitor orphaned media library files
  • Import folders from other plugins (WP Media Folder)
  • Responsive layout

Other Features

  • Calculates the dominant color for all images in the Media Library
  • Adds a field displaying the dominant color to the image detail
  • Provides an API for getting the dominant color and updating it
  • Allows you to add post categories and post tags for images
  • Creates a new category 'location' and lets you manage it
  • Adds a new meta with the calculated image ratio and displays it in the image detail
  • Registers a set of media sizes to display Responsive Images
  • Provides API for getting different image properties
  • Adds several new color schemes for admin
  • Compatible with the latest version of WordPress

Download

Installation

  1. Upload the zu-media folder to the /wp-content/plugins/ directory.
  2. Activate the plugin using the Plugins menu in your WordPress admin panel.
  3. You can adjust the necessary settings using your WordPress admin panel in Settings > Zu Media.
  4. You can import folders form other plugins or create new folders in the Media Library and then easily organize your files with drag and drop.

Public API methods

Basically, using the API to access plugin methods is not meant for casual users. This is necessary for developers of themes or plugins. While this plugin is used only by me, then all these descriptions are just memos for myself.

  • get_dominant_by_id($post_or_attachment_id = null)
  • update_dominant_by_id($post_or_attachment_id = null)
  • is_landscape($post_or_attachment_id = null, $limit = '3:2')
  • get_folders()
  • get_folder($folder_id)
  • get_folder_by_attachment_id($attachment_id)
  • get_galleries($post_id = null)
  • get_gallery_by_attachment_id($attachment_id)

Since Zu Media plugin is based on the singleton concept, you can access all of its public methods using the special function zumedia, which returns a static instance of the plugin class.

// if this is the attachment ID then the dominant color for the image will be returned
$image_dominant = zumedia()->get_dominant_by_id(67);
// if this is a post ID then the dominant color for featured image of the post will be returned
$post_dominant = zumedia()->get_dominant_by_id(283);
// if the ID is not specified, then the dominant color for the featured image of the current post will be returned
$current_post_dominant = zumedia()->get_dominant_by_id();
// re-calculate the dominant color for the featured image of the current post
zumedia()->update_dominant_by_id();

// if this is the attachment ID then the ratio for the image will be returned
$image_ratio = zumedia()->get_ratio(67);
// if this is a post ID then the ratio for featured image of the post will be returned
$post_ratio = zumedia()->get_dominant_by_id(283);

// if the image with the attachment ID has a 'landscaped' ratio
$is_landscape = zumedia()->is_landscape(67);
// if the featured image of the post with the ID has a 'landscaped' ratio
// the ratio '16:9 'will be used to distinguish between 'landscape' and 'portrait' images
$is_landscape = zumedia()->is_landscape(283, '16:9');

// get all folders data
$folders = zumedia()->get_folders();
// get folder data for the ID
$folder = zumedia()->get_folder(4);
// check if folder with the ID is 'private'
$is_private = zumedia()->is_private_folder(4);

// get all galleries data
$galleries = zumedia()->get_galleries();
// get all galleries for a post with the ID
$galleries = zumedia()->get_galleries(283);
// get gallery for the attachment ID (empty array will be returned if no gallery found)
$gallery = zumedia()->get_gallery_by_attachment_id(67);

Screenshots

Plugin Settings Page

Media Folders Settings Section

Media Library with Folders

Bulk drag & drop

Drag & drop over folders tree

Folders Toolbar

About

Plugin that extends the WordPress media library with some features (folders, dominant color, location category, and others).

Topics

Resources

License

Stars

Watchers

Forks