Download the PHP package yipresser/wp-settings-api-helper without Composer

On this page you can find all versions of the php package yipresser/wp-settings-api-helper. 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-settings-api-helper

wp-settings-api-helper

An abstract class that simplifies the process of creating WordPress admin settings pages using the WordPress Settings API.

Installation

You can install this package via Composer:

Alternatively, you can use this class in your WordPress plugins or themes to easily define settings sections, fields, and handle their saving process.

Usage

To use the helper, create a new class that extends Yipresser\WpSettingsApiHelper\WP_Settings_API_Helper.

1. Extend the Class and initialize the Settings

You need to define $settings_options for your database options and $settings_sections for the visual sections and fields you want to show on the page. Lastly, you need to run the setup() method.

2. Display the Settings Form

When rendering your options page HTML, call the render_settings_on_page() method so it can generate the settings form, fields, and submit button.

Supported Field Types

The type key in your field configuration supports the following values:

Example Select Field

Example Code Editor Field

code_type accepts shorthand values like css, js, javascript, php, html, json, scss, and markdown, or a full MIME-style value like text/css or application/x-httpd-php.

If you set code_theme, the helper only passes the theme name to CodeMirror. It does not enqueue the theme stylesheet for you. You can get the matching CodeMirror 5 theme CSS file from https://github.com/codemirror/codemirror5/tree/master/theme, add it to your plugin or theme, and enqueue it yourself:

Sanitization and Validation

By default, a placeholder sanitize_settings method is provided which returns the options untouched. You need to override sanitize_settings($option) in your child class to safely sanitize your data before saving them to the database.


All versions of wp-settings-api-helper with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2
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 yipresser/wp-settings-api-helper contains the following files

Loading the files please wait ...