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_Querydelete_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
Return values
int|array<string|int, int>|nullgetFolder()
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
intgetInstance()
Get instance.
public
static getInstance() : Filter
Return values
FiltergetPluginConstantPrefix()
Get the prefix of this plugin so composer packages can dynamically build other constant values on it.
public
getPluginConstantPrefix() : string
Tags
Return values
stringisQuerying()
Check if the current request is a query request for attachments.
public
isQuerying() : bool
Return values
boollastQueriedFolder()
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
Return values
intposts_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