Interface IFolder
This interface provides elementary methods for folder objects. All folder
types (Folder, Collection, Gallery, ...) have implemented this interface.
Also the root ("Unorganized") is a folder and implements this interface. Usually,
the root acts as "-1" but you should use the _wp_rml_root()
function to get the
root id.
If this interface does not provide an expected method, yet, have a look at the
other API files. For example to create a folder use wp_rml_create()
.
Check if a variable is surely a IFolder interface object:
$folder = wp_rml_get_object_by_id(5); if (is_rml_folder($folder)) { // It is an interface implementation of IFolder }
See:
wp_rml_root_childs()
See:
wp_rml_get_object_by_id()
See:
wp_rml_get_by_id()
See:
wp_rml_get_by_absolute_path()
See:
wp_rml_objects()
See:
is_rml_folder()
Located at IFolder.interface.php
Methods summary
public
|
#
read( string $order = null, string $orderby = null )
Fetch all attachment ids currently in this folder. It uses the default WP_Query to fetch the ids. You can also use the WP_Query like: $query = new \WP_Query(array( 'post_status' => 'inherit', 'post_type' => 'attachment', 'rml_folder' => 4 )); |
public
|
#
hasChildren( string $slug, boolean $isSlug = true, boolean $returnObject = false )
Checks if this folder has a children with a given name. |
public
|
#
getType( )
Return the type for the given folder. For example: 0 = Folder, 1 = Collection, 2 = Gallery |
public
boolean|int[]
|
|
public
|
|
public
|
|
public
|
|
public
|
#
getSlug( boolean $force = false )
Returns a santitized title for the folder. If the slug is empty or forced to, it will be updated in the database, too. |
public
|
|
public
|
#
getAbsolutePath( boolean $force = false )
Creates a absolute path. If the absolute path is empty or forced to, it will be updated in the database, too. |
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
#
setRestrictions( string[] $restrictions = array() )
Set restrictions for this folder. Allowed restrictions for folders: |
public
|
|
public
|
|
public
|