\

Namespaces

DevOwl
MatthiasWeb

Constants

$prefix . _IS_PRO

$prefix . _IS_PRO = $isPro

$prefix . _OVERRIDES_INC

$prefix . _OVERRIDES_INC = $inc . 'overrides/' . ($isPro ? 'pro' : 'lite') . '/'

REAL_UTILS_ROOT_SLUG

REAL_UTILS_ROOT_SLUG = 'devowl-wp'

REAL_UTILS_SLUG

REAL_UTILS_SLUG = 'real-utils'

REAL_UTILS_SLUG_CAMELCASE

REAL_UTILS_SLUG_CAMELCASE = lcfirst(str_replace('-', '', ucwords(REAL_UTILS_SLUG, '-')))

REAL_UTILS_TD

REAL_UTILS_TD = REAL_UTILS_SLUG

REAL_UTILS_VERSION

REAL_UTILS_VERSION = filemtime(__FILE__)

RML_DB_PREFIX

RML_DB_PREFIX = 'realmedialibrary'

RML_FILE

RML_FILE = __FILE__

RML_INC

RML_INC = trailingslashit(path_join(RML_PATH, 'inc'))

RML_MIN_PHP

RML_MIN_PHP = '7.0.0'

RML_MIN_WP

RML_MIN_WP = '5.0.0'

RML_NS

RML_NS = 'MatthiasWeb\\RealMediaLibrary'

RML_OPT_PREFIX

RML_OPT_PREFIX = 'rml'

RML_PATH

RML_PATH = dirname(RML_FILE)

RML_PRO_VERSION

RML_PRO_VERSION = 'https://devowl.io/go/codecanyon/real-media-library?source=rml-lite'

RML_ROOT_SLUG

RML_ROOT_SLUG = 'devowl-wp'

RML_SLUG

RML_SLUG = basename(RML_PATH)

RML_SLUG_CAMELCASE

RML_SLUG_CAMELCASE = lcfirst(str_replace('-', '', ucwords(RML_SLUG, '-')))

RML_SLUG_LITE

RML_SLUG_LITE = 'real-media-library-lite'

RML_TD

RML_TD = $this->getPluginData('TextDomain')

RML_TYPE_ALL

RML_TYPE_ALL = 3

RML_TYPE_COLLECTION

RML_TYPE_COLLECTION = 1

RML_TYPE_FOLDER

RML_TYPE_FOLDER = 0

RML_TYPE_ROOT

RML_TYPE_ROOT = 4

RML_VERSION

RML_VERSION = $this->getPluginData('Version')

Functions

_wp_rml_root()

_wp_rml_root() : integer

Get the parent root folder for a given blog id.

Returns

integer —

Folder id

_wp_rml_sanitize()

_wp_rml_sanitize(string  $name, boolean  $database = false, integer  $exclude = -1) : string

Sanitize to a valid slug name for a given folder name. If the passed folder name contains only invalid characters, then it falls back to the base64 encode.

Parameters

string $name

The name of the folder

boolean $database

If true the name is generated unique from the database slugs

integer $exclude

Returns

string

_wp_rml_sanitize_filename()

_wp_rml_sanitize_filename(  $name) 

Parameters

$name

_wp_rml_synchronize_attachment()

_wp_rml_synchronize_attachment(integer  $postId, integer  $fid, boolean  $isShortcut = false) : boolean

Synchronizes a result with the realmedialibrary_posts table so on this base there can be made the folder content. It also creates shortcuts, if the given $isShortcut parameter is true.

Do not use this directly, instead use the wp_rml_move function.

Parameters

integer $postId

The post ID

integer $fid

The folder ID

boolean $isShortcut

true = Is shortcut in the given folder, false = Is no shortcut, mainly in this folder

Returns

boolean

add_media_folder_meta()

add_media_folder_meta(integer  $folder_id, string  $meta_key, mixed  $meta_value, boolean  $unique = false) : integer|false

Add meta data field to a folder.

Folder meta data is called "Custom Fields" on the Administration Screen.

Parameters

integer $folder_id

Folder ID.

string $meta_key

Metadata name.

mixed $meta_value

Metadata value. Must be serializable if non-scalar.

boolean $unique

Whether the same key should not be added.

Returns

integer|false

add_rml_meta_box()

add_rml_meta_box(string  $name, \MatthiasWeb\RealMediaLibrary\api\IMetadata  $obj, boolean  $hasScripts = false, integer  $priority = 10, string  $contentGroup = '') : boolean

Add a visible content to the folder details dialog.

Example: Adding a new tab "Physical" group to meta dialog (or RML/User/Settings/Groups for user settings)

add_filter("RML/Folder/Meta/Groups", function($groups) {
 $groups["physical"] = __("Physical");
 return $groups;
});

Parameters

string $name

Unique name for this meta box

\MatthiasWeb\RealMediaLibrary\api\IMetadata $obj

The object which implements IMetadata

boolean $hasScripts

boolean Load the resources if exists

integer $priority

Priority for actions and filters

string $contentGroup

The tab group for the meta settings, see example for adding a new group

Returns

boolean

add_rml_user_settings_box()

add_rml_user_settings_box(string  $name, \MatthiasWeb\RealMediaLibrary\api\IUserSettings  $obj, boolean  $deprecated = false, integer  $priority = 10, string  $contentGroup = '') : boolean

Add a visible content to the general user settings dialog.

Example: Adding a new tab "Physical" group to user settings dialog (or RML/Folder/Meta/Groups for folder details)

add_filter("RML/User/Settings/Groups", function($groups) {
 $groups["physical"] = __("Physical");
 return $groups;
});

Parameters

string $name

Unique name for this meta box

\MatthiasWeb\RealMediaLibrary\api\IUserSettings $obj

The object which implements IUserSettings

boolean $deprecated

boolean Load the resources if exists (since 4.3.0 deprecated, scripts method is always called)

integer $priority

Priority for actions and filters

string $contentGroup

The tab group for the meta settings, see example for adding a new group

Returns

boolean

delete_media_folder_meta()

delete_media_folder_meta(integer  $folder_id, string  $meta_key, mixed  $meta_value = '') : boolean

Remove metadata matching criteria from a folder.

You can match based on the key, or key and value. Removing based on key and value, will keep from removing duplicate metadata with the same key. It also allows removing all metadata matching key, if needed.

Parameters

integer $folder_id

Folder ID.

string $meta_key

Metadata name.

mixed $meta_value

Metadata value. Must be serializable if non-scalar.

Returns

boolean —

True on success, false on failure.

delete_media_folder_meta_by_key()

delete_media_folder_meta_by_key(string  $folder_meta_key) : boolean

Delete everything from folder meta matching meta key.

Parameters

string $folder_meta_key

Key to search for when deleting.

Returns

boolean —

Whether the post meta key was deleted from the database.

get_media_folder_meta()

get_media_folder_meta(integer  $folder_id, string  $key = '', boolean  $single = false) : array<mixed,mixed>|mixed

Retrieve folder meta field for a folder.

Parameters

integer $folder_id

Folder ID.

string $key

The meta key to retrieve. By default, returns data for all keys.

boolean $single

Whether to return a single value. Default false.

Returns

array<mixed,mixed>|mixed —

Will be an array if $single is false. Will be value of meta data field if $single is true.

is_rml_folder()

is_rml_folder(integer|\MatthiasWeb\RealMediaLibrary\api\IFolder  $obj) : boolean

Checks, if a given variable is an implementation of the IFolder interface.

Parameters

integer|\MatthiasWeb\RealMediaLibrary\api\IFolder $obj

Object or int (ID)

Returns

boolean

rml_skip_already_admin_notice()

rml_skip_already_admin_notice() 

Show an admin notice to administrators when the plugin is already active.

rml_skip_php_admin_notice()

rml_skip_php_admin_notice() 

Show an admin notice to administrators when the minimum PHP version could not be reached. The error message is only in english available.

rml_skip_rest_admin_notice()

rml_skip_rest_admin_notice() 

Show an admin notice to administrators when the minimum WP version could not be reached. The error message is only in english available.

rml_skip_wp_admin_notice()

rml_skip_wp_admin_notice() 

Show an admin notice to administrators when the minimum WP version could not be reached. The error message is only in english available.

truncate_media_folder_meta()

truncate_media_folder_meta(integer  $folder_id) : integer

Remove all meta of a folder. Use this with caution!!

Parameters

integer $folder_id

Folder ID

Returns

integer

update_media_folder_meta()

update_media_folder_meta(integer  $folder_id, string  $meta_key, mixed  $meta_value, mixed  $prev_value = '') : integer|boolean

Update folder meta field based on folder ID.

Use the $prev_value parameter to differentiate between meta fields with the same key and folder ID.

If the meta field for the folder does not exist, it will be added.

Parameters

integer $folder_id

Folder ID.

string $meta_key

Metadata key.

mixed $meta_value

Metadata value. Must be serializable if non-scalar.

mixed $prev_value

Previous value to check before removing.

Returns

integer|boolean

wp_attachment_ensure_source_file()

wp_attachment_ensure_source_file(integer|\WP_Post  $post) : integer|\WP_Post

Checks if a given attachment has already a shortcut in a given folder id or has generally shortcuts.

Parameters

integer|\WP_Post $post

The attachment id or a WP_Post object

Returns

integer|\WP_Post

wp_attachment_folder()

wp_attachment_folder(integer  $attachmentId, integer  $default = null) : integer|mixed

Returns the folder id of an given attachment or more than one attachment (array). If you pass an array as attachment ids, then the default value does not work, only for single queries. When you pass a shortcut attachment id, the folder id for the shortcut is returned.

Parameters

integer $attachmentId

The attachment ID, if you pass an array you get an array of folder IDs

integer $default

If no folder was found for this, this value is returned for the attachment

Returns

integer|mixed —

Folder ID or $default or Array

wp_attachment_get_shortcuts()

wp_attachment_get_shortcuts(integer  $postId, integer  $fid = false, boolean  $extended = false) : mixed

Checks if a given attachment ID has shortcut and returns the shortcut IDs as array.

Parameters

integer $postId

The attachment id

integer $fid

The folder id, if false, it checks if there generally exists shortcuts

boolean $extended

If true the result is an array with all information about the associated folder

Returns

mixed

wp_attachment_has_shortcuts()

wp_attachment_has_shortcuts(integer  $postId, integer  $fid = false) : boolean

Checks if a given attachment has already a shortcut in a given folder id or has generally shortcuts.

Parameters

integer $postId

The attachment id

integer $fid

The folder id, if false, it checks if there generally exists shortcuts

Returns

boolean

wp_attachment_is_shortcut()

wp_attachment_is_shortcut(integer|\WP_Post  $post, boolean  $returnSourceId = false) : boolean|integer

Checks if a given attachment is a shortcut, use the $returnSourceId parameter to get the source attachment id.

Parameters

integer|\WP_Post $post

The attachment id or a WP_Post object

boolean $returnSourceId

If true, the return will be the source attachment id or 0 if it is no shortcut

Returns

boolean|integer

wp_attachment_order_update()

wp_attachment_order_update(integer  $folderId, integer  $attachmentId, integer  $nextId, integer  $lastIdInView = false) : boolean

(Pro only) Moves an attachment before another given attachment in the order table.

Parameters

integer $folderId

The folder id where the attachment exists

integer $attachmentId

The attachment which should be moved

integer $nextId

The attachment next to the currentId, if it is false the currentId should be moved to the end of table.

integer $lastIdInView

If you have pagination, you can pass the last id from this view

Returns

boolean —

True or array with error strings

wp_rml_active()

wp_rml_active() : boolean

Checks if RML is active for the current user.

Returns

boolean

wp_rml_all_children_sql_supported()

wp_rml_all_children_sql_supported(boolean  $force = false, string  $type = 'legacy') : boolean

Checks if the wp_rml_create_all_children_sql() SQL is supported by the current used database system. The function itself creates a dummy table and performs the SQL and checks if the result is as expected. The "support" result is cached site-wide.

Parameters

boolean $force

If true the database check is performed again

string $type

The type which is minimum required. Possible values: 'function' (MySQL UDF) or 'legacy' (default, old variant)

Returns

boolean

wp_rml_create()

wp_rml_create(string  $name, integer  $parent, integer  $type, array<mixed,string>  $restrictions = array(), boolean  $supress_validation = false, boolean  $return_existing_id = false) : integer|array<mixed,string>

Creates a folder. At first it checks if a folder in parent already exists.

Then it checks if the given type is allowed in the parent.

It is highly recommend, to use wp_rml_structure_reset after you created your folders.

Parameters

string $name

String Name of the folder

integer $parent

int ID of the parent (_wp_rml_root() for root)

integer $type

integer 0|1|2, Folder.inc

array<mixed,string> $restrictions

Restrictions for this folder

boolean $supress_validation

Supress the permission validation

boolean $return_existing_id

If true and the folder already exists, then return the ID of the existing folder

Throws

\MatthiasWeb\RealMediaLibrary\exception\OnlyInProVersionException

Returns

integer|array<mixed,string> —

int (ID) when successfully array with error strings

wp_rml_create_all_children_sql()

wp_rml_create_all_children_sql(\MatthiasWeb\RealMediaLibrary\api\IFolder|integer  $folder, boolean  $includeSelf = false, array  $options = null) : string|boolean

Returns a SQL query to get all children for a folder id.

The first result for this SQL statement is the first children and so on...

$options parameters:

"fields"       => (string) SELECT fields (default: "rmldata.*"),
"join"         => (string) JOIN statement (default: ""),
"where"        => (string) Replace WHERE statement, it is preferred to use afterWhere (default: '1=1 ' . ($includeSelf === true ? "" : $wpdb->prepare(" AND rmldata.id != %d", $folderId))),
"afterWhere"   => (string) Additional WHERE statement to the above WHERE (default: ""),
"orderby"      => (string) ORDER BY statement (default: "rmldata.parent, rmldata.ord"),
"limit"        => (string) LIMIT statement (default: "")

Note: Not all database systems do support this kind of SQL query. You have to use the wp_rml_all_children_sql_supported() API function to check if it is supported.

Parameters

\MatthiasWeb\RealMediaLibrary\api\IFolder|integer $folder

The folder object or folder id

boolean $includeSelf

Set true to include self (passed $folder)

array $options

Additional options for the SQL query, see above

Returns

string|boolean —

SQL query or false if something went wrong

wp_rml_create_all_parents_sql()

wp_rml_create_all_parents_sql(\MatthiasWeb\RealMediaLibrary\api\IFolder|integer  $folder, boolean  $includeSelf = false, integer  $until = null, array  $options = null) : string|boolean

Returns a SQL query to get all parents for a folder id.

The first result for this SQL statement is the first parent and so on... Use rmltmp.lvl field for the depth number upwards. To avoid performance lacks you should figure out if there is already an action available to search for a meta_key in the action RML/$action/AnyParentHasMeta.

$options parameters:

"fields"    => (string) SELECT fields (default: "rmldata.*, rmltmp.lvl AS lvlup")
"join"      => (string) JOIN statement (default: "")
"where"     => (string) Replace WHERE statement, it is preferred to use afterWhere (default: "rmltmp.lvl > " . ($includeSelf === true ? "-1" : "0"))
"afterWhere"=> (string) Additional WHERE statement to the above WHERE (default: "")
"orderby"   => (string) ORDER BY statement (default: "rmltmp.lvl ASC")
"limit"     => (string) LIMIT statement (default: "")

Note: The created SQL is supported by all well-known MySQL systems.

Parameters

\MatthiasWeb\RealMediaLibrary\api\IFolder|integer $folder

The folder object or folder id

boolean $includeSelf

Set true to include self (passed $folder)

integer $until

Until this folder id

array $options

Additional options for the SQL query, see above

Returns

string|boolean —

SQL query or false if something went wrong

wp_rml_create_or_return_existing_id()

wp_rml_create_or_return_existing_id(string  $name, integer  $parent, integer  $type, array<mixed,string>  $restrictions = array(), boolean  $supress_validation = false) : integer|array<mixed,string>

Wrapper function for wp_rml_create.

Parameters

string $name

String Name of the folder

integer $parent

int ID of the parent (_wp_rml_root() for root)

integer $type

integer 0|1|2, Folder.inc

array<mixed,string> $restrictions

Restrictions for this folder

boolean $supress_validation

Supress the permission validation

Returns

integer|array<mixed,string> —

int (ID) when successfully array with error strings

wp_rml_create_shortcuts()

wp_rml_create_shortcuts(integer  $to, array<mixed,integer>  $ids, boolean  $supress_validation = false) : boolean|array<mixed,string>

Link/Copy a set of attachments to a specific folder. When the folder has already a given shortcut, the movement for the given attachment will be skipped.

If you want to receive the last created shortcut ID's you can use the wp_rml_created_shortcuts_last_ids() function.

Parameters

integer $to

Folder ID, if folder not exists then root will be

array<mixed,integer> $ids

Array of attachment ids

boolean $supress_validation

Supress the permission validation

Returns

boolean|array<mixed,string> —

True or Array with errors

wp_rml_created_shortcuts_last_ids()

wp_rml_created_shortcuts_last_ids() : array<mixed,integer>

If you create shortcuts you can get the ids for those shortcuts with this function.

Returns

array<mixed,integer>

wp_rml_debug()

wp_rml_debug(mixed|string  $message, string  $methodOrFunction = null) 

This function is recommend for RML add-ons. You can use this function to generate log entries in the database when Settings > Media > Debug is enabled.

Parameters

mixed|string $message

The message

string $methodOrFunction

METHOD or FUNCTION

wp_rml_delete()

wp_rml_delete(integer  $id, boolean  $supress_validation = false) : boolean|array<mixed,string>

Deletes a folder by ID.

Parameters

integer $id

The ID of the folder

boolean $supress_validation

Supress the permission validation

Returns

boolean|array<mixed,string> —

True or array with error string

wp_rml_dropdown()

wp_rml_dropdown(mixed  $selected, array<mixed,integer>  $disabled, boolean  $useAll = true) : string

This functions returns a HTML formatted string which contains options-tag elements with all folders, collections and galleries.

This function should only be used if you want to provide

Parameters

mixed $selected

The selected item, "" => "All Files", _wp_rml_root() => "Root", int => Folder ID. Can also be an array for multiple select (since 3.1.2)

array<mixed,integer> $disabled

Which folder types are disabled. Default disabled is RML_TYPE_COLLECTION

boolean $useAll

boolean Defines, if "All Files" should be showed

Returns

string

wp_rml_dropdown_collection()

wp_rml_dropdown_collection(mixed  $selected) : string

This functions returns a HTML formatted string which contains `<options>` elements with all folders, collections and galleries.

Note: Only COLLECTIONS are SELECTABLE!

This function should only be used if you want to provide

Parameters

mixed $selected

The selected item, "" => "All Files", _wp_rml_root() => "Root", int => Folder ID. Can also be an array for multiple select (since 3.1.2)

Returns

string

wp_rml_dropdown_gallery()

wp_rml_dropdown_gallery(mixed  $selected) : string

This functions returns a HTML formatted string which contains option-tag elements with all folders, collections and galleries.

Note: Only GALLERIES are SELECTABLE!

This function should only be used if you want to provide

Parameters

mixed $selected

The selected item, "" => "All Files", _wp_rml_root() => "Root", int => Folder ID. Can also be an array for multiple select (since 3.1.2)

Returns

string

wp_rml_dropdown_gallery_or_collection()

wp_rml_dropdown_gallery_or_collection(mixed  $selected) : string

This functions returns a HTML formatted string which contains option-tag elements with all folders, collections and galleries.

Note: Only GALLERIES AND COLLECTIONS are SELECTABLE!

Parameters

mixed $selected

The selected item, "" => "All Files", _wp_rml_root() => "Root", int => Folder ID. Can also be an array for multiple select (since 3.1.2)

Returns

string

wp_rml_get_attachments()

wp_rml_get_attachments(integer  $fid, string  $order = null, string  $orderby = null) : null|array<mixed,integer>

Reads content of a folder.

Parameters

integer $fid

The folder id

string $order

The order statement

string $orderby

The order by statement

Returns

null|array<mixed,integer> —

Null if folder not exists or array of post ids

wp_rml_get_by_absolute_path()

wp_rml_get_by_absolute_path(string  $path, array<mixed,integer>  $allowed = null) : \MatthiasWeb\RealMediaLibrary\api\IFolder

This functions checks if a specific folder exists by absolute path and is a given allowed RML Folder Type.

Parameters

string $path

Folder Absolute Path

array<mixed,integer> $allowed

Which folder types are allowed. If null all folder types are allowed.

Returns

\MatthiasWeb\RealMediaLibrary\api\IFolder

wp_rml_get_by_id()

wp_rml_get_by_id(integer  $id, array<mixed,integer>  $allowed = null, boolean  $mustBeFolderObject = false, boolean  $nullForRoot = true) : \MatthiasWeb\RealMediaLibrary\api\IFolder

This functions checks if a specific folder exists by ID and is a given allowed RML Folder Type. If the given folder is _wp_rml_root you will get the first level folders.

Parameters

integer $id

Folder ID

array<mixed,integer> $allowed

Which folder types are allowed. If null all folder types are allowed.

boolean $mustBeFolderObject

Defines if the function may return the wp_rml_root_childs result

boolean $nullForRoot

If set to false and $id == -1 then the Root instance is returned

Returns

\MatthiasWeb\RealMediaLibrary\api\IFolder

wp_rml_get_object_by_id()

wp_rml_get_object_by_id(integer  $id, array<mixed,integer>  $allowed = null) : \MatthiasWeb\RealMediaLibrary\api\IFolder

A shortcut function for the wp_rml_get_by_id function that ensures, that a IFolder object is returned. For -1 the root instance is returned.

Parameters

integer $id
array<mixed,integer> $allowed

Returns

\MatthiasWeb\RealMediaLibrary\api\IFolder

wp_rml_get_parent_id()

wp_rml_get_parent_id(integer  $id) : integer

Get the parent ID of a given folder id.

Parameters

integer $id

The id of the folder, collection, ...

Returns

integer —

or null

wp_rml_is_type()

wp_rml_is_type(\MatthiasWeb\RealMediaLibrary\api\IFolder|integer  $folder, array<mixed,integer>  $allowed) : boolean

Determines if a Folder is a special folder type.

Parameters

\MatthiasWeb\RealMediaLibrary\api\IFolder|integer $folder

The folder object

array<mixed,integer> $allowed

Which folder types are allowed

Returns

boolean

wp_rml_last_queried_folder()

wp_rml_last_queried_folder(integer  $folder = null) : integer

Set or get the last queried folder.

Parameters

integer $folder

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

Returns

integer

wp_rml_move()

wp_rml_move(integer  $to, array<mixed,integer>  $ids, boolean  $supress_validation = false, boolean  $isShortcut = false) : boolean|array<mixed,string>

Move or create shortcuts of a set of attachments to a specific folder.

If you copy attachments, the action called is also "RML/Item/Move"... but there is a paramter $isShortcut.

Parameters

integer $to

Folder ID

array<mixed,integer> $ids

Array of attachment ids

boolean $supress_validation

Supress the permission validation

boolean $isShortcut

Determines, if the ID's are copies

Returns

boolean|array<mixed,string> —

True or Array with errors

wp_rml_objects()

wp_rml_objects() : array<mixed,\MatthiasWeb\RealMediaLibrary\api\IFolder>

Get all available folders, collections, galleries, .

..

Returns

array<mixed,\MatthiasWeb\RealMediaLibrary\api\IFolder>

wp_rml_register_creatable()

wp_rml_register_creatable(string  $qualified, integer  $type, boolean  $onRegister = false) 

Register a new folder type for RML. It does not check if the creatable type is already registered.

Parameters

string $qualified

The qualified name of the class representing the creatable

integer $type

The type of the creatable. It must be the same as in yourClass::getType is returned

boolean $onRegister

Calls the yourClass::onRegister function

wp_rml_rename()

wp_rml_rename(string  $name, integer  $id, boolean  $supress_validation = false) : boolean|array<mixed,string>

Renames a folder and then checks, if there is no duplicate folder in the parent folder.

Parameters

string $name

String New name of the folder

integer $id

The ID of the folder

boolean $supress_validation

Suppress the permission validation

Returns

boolean|array<mixed,string> —

true or array with error strings

wp_rml_root_childs()

wp_rml_root_childs() : array<mixed,\MatthiasWeb\RealMediaLibrary\api\IFolder>

Gets the first level childs of the media library.

Returns

array<mixed,\MatthiasWeb\RealMediaLibrary\api\IFolder>

wp_rml_selector()

wp_rml_selector(array  $options = array()) : string

This function returns a HTML code (input[type="hidden"]) which gets nicely rendered via Javascript (FolderSelector). If you need a more complex implementation have a look at FolderSelector.js module.

$options:

  • mixed selected=Root The selected item, "" => "None", _wp_rml_root() => "Root", int => Folder ID
  • int[] disabled Which folder types are disabled
  • boolean nullable=false Defines if null ('') is allowed as value
  • boolean editable=true Define if the selector is editable
  • string name Name for the input
  • string title Title in the modal dialog

Parameters

array $options

Returns

string

wp_rml_structure()

wp_rml_structure() : \IStructure

Get the main working structure.

Returns

\IStructure

wp_rml_structure_reset()

wp_rml_structure_reset(integer  $root = null, boolean  $fetchData = true, integer  $returnId = false) : \MatthiasWeb\RealMediaLibrary\api\IFolder

Resets the structure. This function must be called when you create a new folder for example and to register it to the structure.

ATTENTION: This function will be declared as deprecated soon, because it is planned to automatically reset the structure data / reset folder data (lazy loading of Folder objects).

Parameters

integer $root

The root folder to read the structure

boolean $fetchData

Determine if the data should be re-fetched

integer $returnId

If set this folder is returned

Returns

\MatthiasWeb\RealMediaLibrary\api\IFolder

If $returnId is set

wp_rml_update_count()

wp_rml_update_count(array<mixed,integer>  $folders = null, array<mixed,integer>  $attachments = null, boolean  $onlyReturn = false) : string|null

Handle the count cache for the folders. This should avoid a lack SQL subquery which loads data from the postmeta table.

Parameters

array<mixed,integer> $folders

Array of folders ID, if null then all folders with cnt NULL are updated

array<mixed,integer> $attachments

Array of attachments ID, is merged with $folders if given

boolean $onlyReturn

Set to true if you only want the SQL query

Returns

string|null