Layers is a theme framework for WordPress that offers a unique page/site building experience. Layers Extensions are plugins that provide additional or modified functionality to Layers such as widgets, custom post types, additional widget areas and so on. Please refer to the following guidelines before submitting Layers WP Extension items to CodeCanyon.
Upload Requirements
- Layers Extensions must follow all standard CodeCanyon General File Preparation Guidelines on CodeCanyon.
- The Layers WP theme should not be included in the extension zip file. Include a prominent link to the Layers WP download in the Item Description and documentation instead.
- Item must have the following at the top of their description to help buyers know that the item works with Layers:
<a href="http://enva.to/2Hhv8"><img src="http://all-marketplaces.s3.amazonaws.com/growth/layers/landing-badge-small.png"></a>
Technical Requirements
General
- The main extension folder must have a lower-case name, prefixed by “layers-”, with hyphens to separate multiple words. For example “layers-your-extension-name”.
- The extension should follow a similar file / folder structure as the Layers theme framework itself as in the following example:
- layers-your-extension-name /
- assets /
- css /
- images /
- js /
- plugin.js
- includes /
- class-layers-your-extension-name.php
- languages /
- widgets /
- modules /
- my-widget.php
- my-widget-2.php
- my-widget-3.php
- ajax.php (Ajax functions pertaining to widgets)
- functions.php
- style.css
- readme.md
- changelog.md
<?php if ( ! defined( ‘ABSPATH’ ) ) exit;
- Plugin files must use UTF-8 encoding
- Plugins that hook into any WordPress or Layers filters or actions must create a core class to help keep the code organized, efficient and reusable. See Setup Your Plugin Class for a detailed walkthrough.
- Including PHP files or libraries must be done using the require_once() method from within the plugin’s “functions.php” file.
- This applies the core class PHP file as well.
- Do not use require_once() to include scripts, css, templates, or widgets. Those must be properly enqueued or registered in your plugin class. See Including Scripts, Styles & PHP for details.
Customizer
- Defaults for pre-existing Layers customizer controls must be added via the layers_customizer_control_defaults hook.
- New custom controls must be added to the Customizer by filtering the layers_customizer_controls hook.
- Customizer controls may be added in both Extensions and Child Themes.
- Adding to the Layers config array will neatly initialize your controls at the same time as the existing Layers controls.
- New custom sections must be added to the Customizer by filtering the filtering layers_customizer_sections hook.
- See Layers Plugin Guide: Adding Customizer Controls for a detailed walkthrough
Widgets
- Layers Builder Widgets (widgets that are used in the Layers Builder pages that include specialized Layers controls) must extend the Layers_Widget class rather than the standard wp_widget. This enables you to use helper functions within Layers to speed up widget creation.
- Your Layers Builder Widget “classname” setting must be prefixed with “obox-layers-” to show the Layers badge on the widget.
- if( class_exists( “Layers_Widget” ) ) must wrap your widgets to avoid conflict when a non-Layers theme is active.
- When setting up a widget’s Design Bar, its components must be passed through a filter so that other developers can hook into it if needed.
- Widgets must always allow for sorting of queried content.
- The general HTML structure and classes must be retained in your custom builder widgets to ensure proper linkage with the framework and widget options.
- You may inject custom classes or HTML but must not change the existing ones, especially the default classes and the HTML element types used.
- See the Layers Widget Guide for a detailed walkthrough.
Custom Post Types & Templates
- Custom post types must use unique post type names, and have a condition check on the custom post type name to make absolutely sure the user doesn’t have a conflict / error on activation of your plugin.
- You can still set your post type slug as something more generic.
- When adding templates within a plugin, you must place all your custom template files into the templates subfolder.
- The plugin template folder location must be set by filtering the layers_template_locations hook.
Documentation Requirements
Written documentation is required to help buyers with installation, setup, and customization.
- Please refer to the CodeCanyon General File Preparation Guidelines for instructions on how to format your help file(s).
- Include a clear link or description for where customers can go for support for plugin-specific issues.
- You may link to the existing Layers Help website for general Layers usage and tips.