Functions
The Function section provides a collection of PHP functions designed to manage folders and attachments within the WordPress Media Library. These functions utilize a structured namespace for easy integration and usage within custom plugins or themes.
Key Features:
โ Simplified Folder Management โ Create, retrieve, and organize folders effortlessly. โ Attachment Handling โ Easily assign or remove media files from folders. โ Optimized for Developers โ Functions are namespaced for better organization and seamless integration. โ Flexible Usage โ Designed for use in custom development, ensuring compatibility with WordPress best practices.
Available Functions:
๐น Get Folders โ Retrieve detailed information about all folders. ๐น Get Folder โ Fetch data for a specific folder by ID. ๐น Add Folder โ Create a new folder within the media library. ๐น Rename Folder โ Rename folder by id. ๐น Change Folder Color โ Change folder color by id. ๐น Remove Folder โ Remove folder by id. ๐น Add Attachment โ Assign media files to a folder. ๐น Remove Attachment โ Detach media files from a folder.
Each function is well-documented, making it easy for developers to integrate and extend functionality based on project needs.
Source
\includes\Model\Folder.phpGet Folders
<?php
use Luvre\Model\Folder as MyFolder;
$folders = MyFolder::generateFoldersData();Get Folder
<?php
use Luvre\Model\Folder as MyFolder;
$folder_id = 1;
$folders = MyFolder::getFolderData( $folder_id );Add Folder
Rename Folder
Change Folder Color
Remove Folder
Source
Add Attachment
Remove Attachment
Last updated