$me
$me :
Create general functionality for the custom folder fields.
For an example see the function-doc of this::content_general and this::save_general
content(string $content,\MatthiasWeb\RealMediaLibrary\api\IFolder|null $folder): 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>
string | $content | the HTML formatted string for the dialog |
\MatthiasWeb\RealMediaLibrary\api\IFolder|null | $folder | The folder object |
save(array<mixed,string> $response,\MatthiasWeb\RealMediaLibrary\api\IFolder|null $folder,\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";
Since v.4.0.8 the minimum PHP version is 4.0.8 and you can use traits in your meta implementation: metadata\CommonTrait, metadata\CommonFolderTrait or usersettings\CommonUserSettingsTrait.
array<mixed,string> | $response | Array of errors and successful data. |
\MatthiasWeb\RealMediaLibrary\api\IFolder|null | $folder | The folder object |
\WP_REST_Request | $request | The server request |
scripts(\MatthiasWeb\RealMediaLibrary\Assets $assets)
Enqueue scripts and styles for this meta box.
\MatthiasWeb\RealMediaLibrary\Assets | $assets | The assets instance so you can enqueue library scripts |
add(string $name,\MatthiasWeb\RealMediaLibrary\api\IMetadata $instance): boolean
Add meta box.
string | $name | |
\MatthiasWeb\RealMediaLibrary\api\IMetadata | $instance |
get(string $name): \MatthiasWeb\RealMediaLibrary\api\IMetadata|null
Get meta box instance.
string | $name |
getInstance(): \MatthiasWeb\RealMediaLibrary\metadata\Meta
Get instance.