Create Custom Control
Lazy Blocks plugin is packed with tons of powerful controls such as text, gallery, and repeater. However, when working on a project, it may be necessary to create a new custom control to save and use your unique data.
To easily get started, we prepared a template plugin with custom control. This plugin contains a simple text control with custom style and attribute. It will be a good starting point for your custom control:Get Custom Control Template
Download this repository and take a look at all files, comments, and readme to better understand it.
You will see placeholders in function names, file names, etc, that you will need to change for your own real names. Use this list of available placeholders to easily find it in code and replace:
|A short single word used in class names to avoid conflicts|
|Single-word, no spaces. Dashes allowed|
|Single-word, no spaces. Underscores allowed|
|Multiple words, can include spaces, visible when selecting a control|
|Unique identifier for retrieving translated strings. For the best compatibility with wordpress.org, please use your plugin slug (plugin folder name). eg. lzb-CONTROL-NAME|
|URL to the GitHub or WordPress repository|
|A comma-separated list of relevant tags used for search results on wordpress.org|
|Brief description of the control, no longer than 2 lines|
|Extended description of the control|
|Name or wordpress.org username of the author|
|URL to author's website|
When all placeholders have been modified, you should be left with a plugin containing all the logic for a custom control! Before diving into any code, first, copy this plugin into your WordPress plugins folder (wp-content/plugins) and activate it.