Documentation

Shortcut
in package
Uses UtilsProvider

Handle the metadata and attached file for shortcuts.

Table of Contents

Properties

$lastIds  : mixed
The last generated shortcut ids.
$lockCreate  : mixed
Avoid recursive creation of shortcuts.
$me  : mixed

Methods

_resetLastIds()  : mixed
This function should only be used in the Creatable::insert() function.
add_post_metadata()  : mixed
Avoids to generate own meta data for shortcuts.
create()  : bool
Creates a shortcut.
delete_attachment()  : mixed
Delete all associated shortcuts.
get_post_metadata()  : mixed
If it is a shortcut, read the metadata from the source file.
getInstance()  : Shortcut
Get instance.
getLastIds()  : array<string|int, int>
Get last generated shortcut ids.
getPluginConstantPrefix()  : string
Get the prefix of this plugin so composer packages can dynamically build other constant values on it.
update_post_metadata()  : mixed
Avoids to generate own meta data for shortcuts.
__construct()  : mixed
C'tor.
isInheritableMetaKey()  : bool
Check if a meta key is inheritable.

Properties

$lastIds

The last generated shortcut ids.

private mixed $lastIds = false

$lockCreate

Avoid recursive creation of shortcuts.

private mixed $lockCreate = false

Methods

_resetLastIds()

This function should only be used in the Creatable::insert() function.

public _resetLastIds() : mixed

add_post_metadata()

Avoids to generate own meta data for shortcuts.

public add_post_metadata(mixed $check, int $object_id, string $meta_key, string $meta_value, bool $unique) : mixed
Parameters
$check : mixed
$object_id : int
$meta_key : string
$meta_value : string
$unique : bool

create()

Creates a shortcut.

public create(int $postId, int $fid[, bool $isShortcut = false ]) : bool
Parameters
$postId : int
$fid : int
$isShortcut : bool = false
Tags
see
wp_rml_create_shortcuts
see
_wp_rml_synchronize_attachment
Return values
bool

delete_attachment()

Delete all associated shortcuts.

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

get_post_metadata()

If it is a shortcut, read the metadata from the source file.

public get_post_metadata(mixed $check, int $object_id, string $meta_key, bool $single) : mixed

It also handles the wp_delete_attachment process to avoid to delete the source files if shortcut.

Parameters
$check : mixed
$object_id : int
$meta_key : string
$single : bool

getLastIds()

Get last generated shortcut ids.

public getLastIds() : array<string|int, int>
Tags
see
wp_rml_created_shortcuts_last_ids()
Return values
array<string|int, 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

update_post_metadata()

Avoids to generate own meta data for shortcuts.

public update_post_metadata(mixed $check, int $object_id, string $meta_key, string $meta_value, string $prev_value) : mixed
Parameters
$check : mixed
$object_id : int
$meta_key : string
$meta_value : string
$prev_value : string

__construct()

C'tor.

private __construct() : mixed

isInheritableMetaKey()

Check if a meta key is inheritable.

private isInheritableMetaKey(string $meta_key[, bool $withAttached = true ]) : bool
Parameters
$meta_key : string
$withAttached : bool = true
Return values
bool

        
On this page

Search results