\MatthiasWeb\RealMediaLibrary\usersettingsAllFilesShortcuts

Add an option so the user can hide shortcuts in "All files" view.

Summary

Methods
Properties
Constants
getPluginConstantPrefix()
__construct()
posts_clauses()
content()
save()
scripts()
isEnabled()
No public properties found
FIELD_NAME
OPTION_NAME
is()
get()
No protected properties found
N/A
No private methods found
No private properties found
N/A

Constants

FIELD_NAME

FIELD_NAME ='hideAllFilesShortcuts'

OPTION_NAME

OPTION_NAME ='rmlHideAllFilesShortcuts'

Methods

getPluginConstantPrefix()

getPluginConstantPrefix(): string

Get the prefix of this plugin so composer packages can dynamically build other constant values on it.

Returns

string

__construct()

__construct()

C'tor.

posts_clauses()

posts_clauses(array  $clauses,\WP_Query  $query,integer  $folderId): array

Modify posts clauses to hide shortcuts.

Parameters

array $clauses
\WP_Query $query
integer $folderId

Returns

array

content()

content(string  $content,integer  $user): string

Return modified content for the meta box.

Note: If you want to use a more complex content in a meta table use something like this:

<tr>
 <th scope="row">Medium size</th>
 <td><fieldset>
     <legend class="screen-reader-text"><span>Medium size</span></legend>
     <label for="medium_size_w">Max Width</label>
     <input name="medium_size_w" type="number" step="1" min="0" id="medium_size_w" value="300" class="small-text">
     <label for="medium_size_h">Max Height</label>
     <input name="medium_size_h" type="number" step="1" min="0" id="medium_size_h" value="300" class="small-text">
 </fieldset></td>
</tr>

If you want to "group" your meta boxes you can use this code to create a empty space: <tr class="rml-meta-margin"></tr>

Parameters

string $content

the HTML formatted string for the dialog

integer $user

Current user id

Returns

string —

Content

save()

save(array<mixed,string>  $response,integer  $user,\WP_REST_Request  $request): array<mixed,string>

Save the infos. Add an error to the array to show on the frontend dialog. Add an successful data to receive it in JavaScript.

$response["errors"][] = "Your error";
$response["data"]["myData"] = "Test";

Parameters

array<mixed,string> $response

Array of errors and successful data.

integer $user

Current user id

\WP_REST_Request $request

The server request

Returns

array<mixed,string>

scripts()

scripts(\MatthiasWeb\RealMediaLibrary\Assets  $assets)

Enqueue scripts and styles for this meta box.

Parameters

\MatthiasWeb\RealMediaLibrary\Assets $assets

The assets instance so you can enqueue library scripts

isEnabled()

isEnabled(  $persist = null)

Parameters

$persist

is()

is(string  $meta,boolean  $persist = null): boolean

Gets (and persists) a checkbox to the user (settings) metadata.

Parameters

string $meta

The meta key

boolean $persist

If setted it will be updated or deleted

Returns

boolean

get()

get(string  $meta,boolean  $persist = null): string|boolean

Gets (and persists) a string to the user (settings) metadata.

Parameters

string $meta

The meta key

boolean $persist

If setted it will be updated or deleted

Returns

string|boolean