Documentation

IFolderContent

This interface provides elementary action methods for folder content. All folder types (Folder, Collection, Gallery, ...) have implemented this interface.

Also the root ("Unorganized") is a folder and implements this interface.

Tags
since
3.3.1

Table of Contents

Methods

contentDeleteOrder()  : bool
(Pro only) Deletes the complete order for this folder.
contentEnableOrder()  : bool
(Pro only) Enable the order functionality for this folder.
contentIndex()  : bool
(Pro only) Index the order table.
contentOrder()  : true
(Pro only) See API function for more information.
contentOrderBy()  : bool
(Pro only) Start to order the given folder content by a given order type.
contentReindex()  : bool
(Pro only) This function retrieves the order of the order table and removes empty spaces, for example: <pre>0 1 5 7 8 9 10 => 0 1 2 3 4 5 6</pre>
contentRestoreOldCustomNr()  : bool
(Pro only) Restore the current order number to the old custom order number.
forceContentCustomOrder()  : bool
Override this functionality to force the content custom order in the posts_clauses.
getAttachmentNextTo()  : array<string|int, mixed>
(Pro only) Get the next attachment row for a specific attachment. It returns false if the attachment is at the end or the folder has no custom content order.
getContentAggregationNr()  : int
(Pro only) Gets the biggest order number;
getContentCustomOrder()  : int
The content custom order defines the state of the content order functionality:
getContentNrOf()  : int|bool
(Pro only) Get the order number for a specific attachment in this folder.
getContentOldCustomNrCount()  : int
(Pro only) Get the old custom order number count so we can decide if already available.
isContentCustomOrderAllowed()  : bool
Checks if the folder is allowed to use custom content order.
postsClauses()  : bool
Override the default posts_clauses join and orderby instead of the RML standard.

Methods

contentIndex()

(Pro only) Index the order table.

public contentIndex([bool $delete = true ]) : bool
Parameters
$delete : bool = true

Delete the old order

Tags
throws
OnlyInProVersionException
Return values
bool

contentOrder()

(Pro only) See API function for more information.

public contentOrder(int $attachmentId, int|false $nextId[, int|bool $lastIdInView = false ]) : true
Parameters
$attachmentId : int
$nextId : int|false
$lastIdInView : int|bool = false
Tags
throws
Exception
throws
OnlyInProVersionException
see
wp_attachment_order_update()
Return values
true

contentOrderBy()

(Pro only) Start to order the given folder content by a given order type.

public contentOrderBy(string $orderby[, bool $writeMetadata = true ]) : bool
Parameters
$orderby : string

The order type key

$writeMetadata : bool = true
Tags
throws
OnlyInProVersionException
Return values
bool

contentReindex()

(Pro only) This function retrieves the order of the order table and removes empty spaces, for example: <pre>0 1 5 7 8 9 10 => 0 1 2 3 4 5 6</pre>

public contentReindex() : bool
Tags
throws
OnlyInProVersionException
Return values
bool

contentRestoreOldCustomNr()

(Pro only) Restore the current order number to the old custom order number.

public contentRestoreOldCustomNr() : bool
Tags
throws
OnlyInProVersionException
Return values
bool

forceContentCustomOrder()

Override this functionality to force the content custom order in the posts_clauses.

public forceContentCustomOrder() : bool
Tags
since
4.0.2
Return values
bool

getAttachmentNextTo()

(Pro only) Get the next attachment row for a specific attachment. It returns false if the attachment is at the end or the folder has no custom content order.

public getAttachmentNextTo(int $attachmentId) : array<string|int, mixed>
Parameters
$attachmentId : int

The attachment id

Tags
since
4.0.8

Now the method returns an array instead of int

throws
OnlyInProVersionException
Return values
array<string|int, mixed>

or null

getContentAggregationNr()

(Pro only) Gets the biggest order number;

public getContentAggregationNr([string $function = 'MAX' ]) : int
Parameters
$function : string = 'MAX'

The SQL aggregation function (MIN or MAX)

Tags
throws
OnlyInProVersionException
Return values
int

getContentNrOf()

(Pro only) Get the order number for a specific attachment in this folder.

public getContentNrOf(int $attachmentId) : int|bool
Parameters
$attachmentId : int

The attachment id

Tags
throws
OnlyInProVersionException
Return values
int|bool

getContentOldCustomNrCount()

(Pro only) Get the old custom order number count so we can decide if already available.

public getContentOldCustomNrCount() : int
Tags
throws
OnlyInProVersionException
Return values
int

isContentCustomOrderAllowed()

Checks if the folder is allowed to use custom content order.

public isContentCustomOrderAllowed() : bool
Return values
bool

postsClauses()

Override the default posts_clauses join and orderby instead of the RML standard.

public postsClauses(array<string|int, mixed> $pieces) : bool

This can be useful if you want to take the order from another relationship. You have to return true if you have overwritten it.

Parameters
$pieces : array<string|int, mixed>

The posts_clauses $pieces parameter

Tags
since
4.0.2
Return values
bool

        
On this page

Search results