For the complete documentation index, see llms.txt. This page is also available as Markdown.

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.php

Get 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