WP Clips builds a Clips directory, containing a core Clip folder and a custom Clip folder. The core Clip includes a core-functions file (PHP) which is used for adding WordPress core functions, while the custom Clip includes style (CSS), script (JS) and functions (PHP) files for adding and editing content-related custom code (i.e. for customizing themes and plugins).
Code is added directly to files within the Clip folders –
/wp-content/clips/clip-core/core-functions.php – WordPress core functions (PHP)
/wp-content/clips/clip-custom/custom-functions.php – theme/plugin custom functions (PHP)
/wp-content/clips/clip-custom/custom-script.js – theme/plugin custom scripts (JS, jQuery)
/wp-content/clips/clip-custom/custom-style.css – theme/plugin custom styles (CSS)
The files can be edited with your preferred code editor, either locally, via FTP (or file manager), or download and install the WP Clips v3 Clips Editor to edit the custom Clip with the default WordPress Plugin Editor.
You can also add folders, included/enqueued files and other content to each Clip. There’s really no limit to what you include or how you use it.
Declaring compatible themes and required plugins
You can declare a required theme and/or plugins (dependencies) which dictate whether the custom Clip should or should not be enabled. Open the /clip-custom/custom-functions.php file and add the folder name (slug) of a required theme (parent or child) or required plugins (comma-separated) to the file’s data headers. This protects the site against unexpected errors or crashes should the active theme be changed or required plugins be deactivated.
/** * Clip Name: Custom Clip * Description: Custom functions (theme and plugins) * Required theme: theme-folder-name * Required plugins: plugin-folder-name, another-plugin-folder */
Note that core Clip headers are not applicable as core-based code should be compatible with all themes and plugins.
If you need to customize native files
Customizing a theme or plugin’s native files is sometimes easier and preferred. A log.txt file is included within the custom Clip to record any such changes.