Download the PHP package wptrt/customize-section-button without Composer
On this page you can find all versions of the php package wptrt/customize-section-button. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download wptrt/customize-section-button
More information about wptrt/customize-section-button
Files in wptrt/customize-section-button
Package customize-section-button
Short Description A button section for the WordPress customizer.
License GPL-2.0-or-later
Homepage https://github.com/WPTRT/customize-section-button
Informations about the package customize-section-button
WPTRT Customize Section Button
This is a custom section class for the WordPress customizer, which allows theme authors to build a section that has a "button." Its primary purpose is for providing a standardized method of creating a "pro" or "upsell" section in the customizer. However, it can technically be used to link to anywhere.
Usage
The following code should be integrated within your theme's existing customizer code.
Arguments
The Button
section accepts all the same arguments as a normal WP_Customize_Section
. However, two additional arguments have been added.
'button_text'
- The text to display for the section button. Defaults to the active theme name.'button_url'
- The URL to use for the section button. Falls back to theTheme URI
or theAuthor URI
.
Loading Required CSS and JS
Both the development and production versions of the CSS and JS files are available.
To avoid loading additional resources, we encourage theme authors to import the following files into their own build processes for their customize CSS and JS:
/path/to/customize-section-button/resources/js/customize-controls.js
/path/to/customize-section-button/resources/scss/customize-controls.scss
.
However, if you decide to enqueue the production assets directly, integrate the following into your customizer code.
Autoloading
You'll need to use an autoloader with this. Ideally, this would be Composer. However, we have a basic autoloader available to include with themes if needed.
Composer
From the command line:
WPTRT Autoloader
If using the WPTRT autoloader, use the following code: