Download the PHP package wptrt/control-color-alpha without Composer

On this page you can find all versions of the php package wptrt/control-color-alpha. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package control-color-alpha

WPTRT color-alpha Control

A color control for the WordPress Customizer with support for alpha channel.

This is a customizer control using the react-color colorpicker.

The control will save either a HEX value (#000000) or RGBA (rgba(0,0,0,0.9)) depending on the opacity of the selected color. If the color is completely opaque, then it will save a HEX value. If the selected color is not completely opaque (has an alpha value smaller than 1) then the value will be saved as RGBA.

Usage

Registering the Control

This is a control containing a JS template. As such, it should be whitelisted in the Customizer. To do that we can use the WP_Customize_Manager::register_control_type method:

After we register the control using the above code, we can use it in the customizer using the Customizer API:

Available filters

wptrt_color_picker_alpha_url

You can use this filter to change the URL for control assets. By default the control will work out of the box for any plugins and themes installed in wp-content/themes and wp-content/plugins respectively. It is possible however to change the URL by using the wptrt_color_picker_alpha_url filter:

Sanitization

All controls in the WordPress Customizer should have a sanitize_callback defined. You can write your own function and use it as a sanitization callback, or use the example function below:

Advanced Usage

This control allows you to save the value as either a string or an array. The default behavior is to save a string, but you can easily alter that by using the choices argument in the control:

The value will then be saved using a format like this:

Array Sanitization

If you choose to save the value of this control as an array, then you will need to change the sanitization function for this setting. You can write your own, or use the one below.

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:


All versions of control-color-alpha with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package wptrt/control-color-alpha contains the following files

Loading the files please wait ....