Documentation

Filter
in package
Uses UtilsProvider

This class handles all hooks for the general filters.

Table of Contents

Properties

$me  : mixed

Methods

ajax_query_attachments_args()  : WP_Query
Modify AJAX request for query-attachments request.
delete_attachment()  : mixed
Add the attachment ID to the count update when deleting it.
getAttachmentFolder()  : int|array<string|int, int>|null
Get folders of attachments.
getFolder()  : int
Get folder from different sources (WP_Query, GET Query).
getInstance()  : Filter
Get instance.
getPluginConstantPrefix()  : string
Get the prefix of this plugin so composer packages can dynamically build other constant values on it.
isQuerying()  : bool
Check if the current request is a query request for attachments.
lastQueriedFolder()  : int
Set or get the last queried folder.
posts_clauses()  : array<string|int, mixed>
Changes the SQL query like this way to JOIN the realmedialibrary_posts table and search for the given folder.
pre_get_posts()  : mixed
Define a new query option.
restrict_manage_posts()  : mixed
Create a select option in list table of attachments.
wp_prepare_attachment_for_js()  : array<string|int, mixed>
Add a attribute to the ajax output. The attribute represents the folder order number if it is a gallery.

Properties

$me

private static mixed $me = null

Methods

ajax_query_attachments_args()

Modify AJAX request for query-attachments request.

public ajax_query_attachments_args(WP_Query $query) : WP_Query
Parameters
$query : WP_Query
Return values
WP_Query

delete_attachment()

Add the attachment ID to the count update when deleting it.

public delete_attachment(int $postID) : mixed
Parameters
$postID : int

getAttachmentFolder()

Get folders of attachments.

public getAttachmentFolder(int|array<string|int, int> $attachmentId[, int $default = null ]) : int|array<string|int, int>|null
Parameters
$attachmentId : int|array<string|int, int>
$default : int = null
Tags
see
wp_attachment_folder()
Return values
int|array<string|int, int>|null

getFolder()

Get folder from different sources (WP_Query, GET Query).

public getFolder(WP_Query $query[, bool $fromRequest = false ]) : int
Parameters
$query : WP_Query
$fromRequest : bool = false
Return values
int

getPluginConstantPrefix()

Get the prefix of this plugin so composer packages can dynamically build other constant values on it.

public getPluginConstantPrefix() : string
Tags
codeCoverageIgnore

It only returns a string with the constant prefix

Return values
string

isQuerying()

Check if the current request is a query request for attachments.

public isQuerying() : bool
Return values
bool

lastQueriedFolder()

Set or get the last queried folder.

public lastQueriedFolder([int $folder = null ]) : int
Parameters
$folder : int = null

The folder id (0 is handled as "All files" folder)

Tags
since
4.0.8

The data is now saved in user meta data instead of Cookie

Return values
int

posts_clauses()

Changes the SQL query like this way to JOIN the realmedialibrary_posts table and search for the given folder.

public posts_clauses(array<string|int, mixed> $clauses, WP_Query $query) : array<string|int, mixed>
Parameters
$clauses : array<string|int, mixed>
$query : WP_Query
Return values
array<string|int, mixed>

pre_get_posts()

Define a new query option.

public pre_get_posts(WP_Query $query) : mixed
Parameters
$query : WP_Query

restrict_manage_posts()

Create a select option in list table of attachments.

public restrict_manage_posts() : mixed

wp_prepare_attachment_for_js()

Add a attribute to the ajax output. The attribute represents the folder order number if it is a gallery.

public wp_prepare_attachment_for_js(array<string|int, mixed> $response, WP_Post $attachment, mixed $meta) : array<string|int, mixed>
Parameters
$response : array<string|int, mixed>
$attachment : WP_Post
$meta : mixed
Return values
array<string|int, mixed>

        
On this page

Search results