$instance
$instance : mixed
Public static variable to hold the single instance of the class.
Class MainWP_Child_Misc
Misc functions that don't really belong anywhere else.
uploader_upload_file(string $file_url, string $path, string $file_name) : array
Method uploader_upload_file()
Upload file from the MainWP Dashboard.
string | $file_url | URL of file to be uploaded. |
string | $path | Path to upload to. |
string | $file_name | Name of file to upload. |
Error message.
Full path and file name of uploaded file.
snippet_update_wp_config(string $action, string $slug, string $code = '') : boolean
Method snippet_update_wp_config()
Update the child site wp-config.php file.
string | $action | Action to perform: Delete, Save. |
string | $slug | Snippet slug. |
string | $code | Code snippet. |
If remvoed, return true, if not, return false.
sanitize_file_name(string $filename) : string
Sanitizes a filename, replacing whitespace with dashes.
Removes special characters that are illegal in filenames on certain operating systems and special characters requiring special escaping to manipulate at the command line. Replaces spaces and consecutive dashes with a single dash. Trims period, dash and underscore from beginning and end of filename. It is not guaranteed that this function will return a filename that is allowed to be uploaded.
string | $filename | The filename to be sanitized. |
The sanitized filename.
snippet_save_snippet(string $slug, string $type, string $code, array $snippets) : array
Method snippet_save_snippet()
Save code snippet.
string | $slug | Snippet slug. |
string | $type | Type of snippet. |
string | $code | Snippet code. |
array | $snippets | An array containing all snippets. |
$return Status response.
snippet_delete_snippet(string $slug, string $type, array $snippets) : array
Method snippet_delete_snippet()
Delete code snippet.
string | $slug | Snippet slug. |
string | $type | Type of snippet. |
array | $snippets | An array containing all snippets. |
$return Status response.