Download the PHP package wp-launchpad/options without Composer

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

Options

This library offers OOP facades to work with options and transients in WordPress.

Install

Just run the command composer require wp-launchpad/options

Note: It is easier to work with that library using the Launchpad framework.

Options

Options are a way to save a simple and light value in WordPress.

To use options with that library you need first to instantiate the class and provide it a prefix:

Note: By convention your prefix should be your plugin or theme name.

Once this is done then you can directly access, update or delete options using the following API:

Method Description Example
get Fetch the option value $options->get('my_option', false )
set Update the option value $options->set('my_option', true )
delete Delete the option value $options->delete('my_option' )

Site options

Site options are a way to save a simple and light value in WordPress just as regular options. However, the main difference resides in the fact in case of a multisite it will be present at the level of the website and not at the level from the network.

To use options with that library you need first to instantiate the class and provide it a prefix:

Note: By convention your prefix should be your plugin or theme name.

Once this is done then you can directly access, update or delete options using the following API:

Method Description Example
get Fetch the option value $options->get('my_option', false )
set Update the option value $options->set('my_option', true )
delete Delete the option value $options->delete('my_option' )

Transients

Transients are a way to save simple and light value but at the difference of options they expire after a certain time.

To use transients with that library you need first to instantiate the class and provide it a prefix:

Note: By convention your prefix should be your plugin or theme name.

Once this is done then you can directly access, update or delete transients using the following API:

Method Description Example
get Fetch the transient value $transients->get('my_transient', false, HOUR )
set Update the transient value $transients->set('my_transient', true )
delete Delete the transient value $transients->delete('my_transient' )

Settings

Settings are a way to easily save configurations for a plugin or a theme.

The advantage compared to options is that it is possible to mass update them or export them in one time.

To use settings with that library you need first to instantiate the class and provide it a prefix:

Note: By convention your prefix should be your plugin or theme name.

Once this is done then you can directly access, update or delete settings using the following API:

Method Description Example
get Fetch the setting value $settings->get('my_setting', false )
set Update the setting value $settings->set('my_setting', true )
delete Delete the setting value $settings->delete('my_setting' )
dumps Dumps all settings values $settings->dumps()
import Import multiple settings values $settings->imports(['my_setting' => false])

Set

Sets are a way to easily interact with array data coming from an option.

To use set with that library you need first to instantiate the class and provide it a prefix:

Note: The prefix is actually important for filters within the class.

Once this is done then you can directly access, update or delete values within the set using the following API:

Method Description Example
get Fetch the set value $set->get('my_setting', false )
set Update the set value $set->set('my_setting', true )
delete Delete the set value $set->delete('my_setting' )
get_values Dumps all set values $set->get_values()
set_values Import multiple set values $set->set_values(['my_setting' => false])

Note: The key difference between settings and sets is that Settings handle the saving in the database themselves when Set won't.


All versions of options with dependencies

PHP Build Version
Package Version
Requires php Version >=7.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 wp-launchpad/options contains the following files

Loading the files please wait ....