Download the PHP package gebruederheitz/wp-easy-customizer without Composer

On this page you can find all versions of the php package gebruederheitz/wp-easy-customizer. 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 wp-easy-customizer

Wordpress Easy Customizer

A simplified, object-oriented interface for the Wordpress Customizer.


Installation

via composer:

Make sure you have Composer autoload or an alternative class loader present.

Usage

For information on migrating from v1.x or v2.x see UPGRADING.md

You will need at least one CustomizerPanel object to start with, optionally passing a label (which defaults to "Theme Settings"). Then you can start adding sections to your new panel.

Adding Sections to a panel

A section is sub-panel or sub-menu which contains the actual settings. There are three basic ways to add sections to a panel. Which one you use is mostly a matter of taste and code organisation. The main difference is that sections added via the filter hook (variants (a) & (c), using $panel->addNewSection() or $section->setPanel()) are added to the rendered panel after the ones directly added (variant (b), using $panel->addSections()). So if you require a specific order of sections, you'll need to make certain these are registered through the same mechanism.

(a) Directly from the panel using the automatic filter hook

This allows for a very compact Customizer setup and is particularly useful if you only have a handful of fairly standard settings. The disadvantage is that you can not use any custom section classes, as addNewSection() will always instantiate a new vanilla CustomizerSection. And since we don't actually receive the created section object, we have to add all settings right away.

(b) Instance for instance - directly with objects

(c) Instance for instance – indirectly via automatic hooks

In all these examples, we've added our settings right when constructing the sections. If we need some advanced logic, they can be added separately:

Defining Settings and adding them to a section

Now you will have to define your settings. Each setting is a class implementing CustomizerSetting. You can extend BasicCustomizerSetting for convenience:

BasicCustomizerSettings are singleton objects, so instead of constructing them you retrieve an instance with the static get() method:

Retrieving the value

Settings: Advanced

You can do more with settings than the basic example above. Here are some more detailed usages:

Some of these examples can lead to a lot of repetition. A URL input is always going to have the type url and should ideally always have a sanitizer sanitize_url. For these cases, some specialized input classes are available at Gebruederheitz\Wordpress\Customizer\InputTypes:

Customizing which panels are removed

By default, CustomizerSettings "cleans up" the Customizer, removing some panels that are rarely used. You can use a filter hook to control which of the default panels are removed:

Using Custom Controls

You can use custom controls if they extend the default WP_Customize_Control by returning the FQCN from CustomizerSetting::getInputType():

Using the Separator field

The separator custom field allows inserting static separations between settings in the shape of a <hr>. Optionally you can specify a label that will render an <h2> underneath the horizontal rule. The easiest way is to use the SeparatorSetting class:

Development

Dependencies


All versions of wp-easy-customizer with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4|^8.0
gebruederheitz/simple-singleton Version ^1.0
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 gebruederheitz/wp-easy-customizer contains the following files

Loading the files please wait ....