Download the PHP package anttiviljami/wp-libre-form without Composer

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

WP Libre Form

Build Status Latest Stable Version Total Downloads Latest Unstable Version License

Use standard HTML5 markup to create fully functional forms for WordPress

Features

Why?

Modern HTML markup is already a great way to build forms. With Libre Form, there's no need to learn clunky form builders that are hard to customise.

Just use standard HTML inputs to build, or copy a form to your WordPress site that will just magically work. No need to touch PHP code if you don't want to.

Required field validation, email notifications, file uploads to WP gallery and lots more are included by default in the core of the plugin, but you can also add your own functionality with hooks and APIs provided by Libre Form.

Try it

TryoutWP has provided us with a live demo, which you can find here. It reflects the current release, not the master branch.

Screenshots

Editing a Form

Form displayed in the default Twentysixteen theme

Submissions view

Single submission view

Installation

The Composer Way (preferred)

Install the plugin via Composer

Activate the plugin

The Old Fashioned Way

This plugin is available on the official WordPress.org plugin directory.

You can also install the plugin by directly uploading the zip file as instructed below:

  1. Download the plugin
  2. Upload to the plugin to /wp-content/plugins/ via the WordPress plugin uploader or your preferred method
  3. Activate the plugin

Filter / Action API

Filter: wplf_validate_submission

Used to add validation to your forms.

Form specific hooks

This filter supports form specific hooks:

These filters are only applied for the target form by ID or slug.

Example: Google ReCaptcha integration

Action: wplf_post_validate_submission

Triggers after the form validation is done.

Form specific hooks

This action supports form specific hooks:

These actions are only run for the target form by ID or slug.

Example: Send a thank you email to the email in the submission

Filter: wplf_disable_validate_additional_fields

Dynamically generated fields are disabled by default. If you want to allow fields that are not set in the form to be submitted you can use this filter.

Form specific hooks

This filter supports form specific hooks:

These filters are only applied for the target form by ID or slug.

Disabling additonal fields validation for all forms:

Filter: wplf_allowed_additional_form_fields

You can provide your own set of allowed field names, instead of disabling additional field validation entirely.

Form specific hooks

This filter supports form specific hooks:

These filters are only applied for the target form by ID or slug.

Disabling additonal fields validation for all forms:

Filter: wplf_dynamic_values

Add or customize dynamic values available in forms.

Example: new value

Filter: wplf_uploaded_file_name

If you choose to not add uploaded files to the media library, you can change the file upload name.

Filter: wplf_uploaded_file_path

If you choose to not add uploaded files to the media library, you can change the file upload path.

Plugins

1.5 exposes a new function, wplf(). It simply returns the class instance of WP Libre Form.

It allows you to register your plugin as a WP Libre Form plugin, which in turn allows you to expose an API and a settings page for your plugin, should you want to.

If you use spaces in the name, you can access the plugin instance like this:

wplf()->plugins->{"Your plugin"}->somePublicMethod()

Javascript API

Client side callbacks

WP Libre Form supports client side callbacks after form submission using window.wplf object. Example usage:

These callbacks are executed in the order they appear.

To avoid running your JavaScript too early, add wplf-form-js to your enqueue dependencies:

Otherwise you might run into errors like "Cannot read property 'push' of undefined".

REST API driven sites

You can get forms out of the REST API. Just use /wp/v2/wplf-form to retrieve forms. You can get a singular form by using filters:

/wp/v2/wplf-form?slug=form-slug

However, if you're sending forms from a different domain than WP site URL, you'll run across a CORS issue submitting the form, which you can get around with this:

Do note that the above code snippet opens your form submissions to the world.

You can also use the "official" JS bundle if you want to.

Multilingual

You can create multilingual forms using Polylang. WPLF will register and automatically fetch the translation when you use special template tags.

Example:

You can also disable this feature, and create your own middleware for WPML, if you'd like.

Adding extra classes to the form element

You can use the xclass attribute inside the shortcode to add your own extra classes for CSS.

Adding extra attributes to the form element

You can add any custom attributes to the form element easily by adding them to the shortcode

The attribute will render as is on the <form> element

Importing forms from a predefined HTML template

Sometimes a project might require static forms which are not supposed to be editable in the admin panel.

This plugin allows you to define HTML forms in your project source code and import them into the form admin for specific forms.

Creating a static HTML template

The simplest way is to create a HTML5 file and read its contents. Other options include using Twig to render HTML templates.

Remember: WPLF will insert form tags on its own, meaning you only have to create the markup which sits directly inside the form tags.

Importing a template into WPLF

Once you're done creating a form template, you need to inform WPLF about it. You can use the wplf_import_html_template filter hook for this:

The $template variable should be a raw HTML string. If it is set to null no template will be imported.

After a template is imported for a certain form the form's editview will be set to read only mode, meaning you must make changes to the static HTML template in code instead of editing the form inside the admin panel.

Otherwise the form should function normally, meaning you can use WPLF features as always.


All versions of wp-libre-form with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.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 anttiviljami/wp-libre-form contains the following files

Loading the files please wait ....