WP Manifestindependent plugin directory
manifest / developer / rns-cmb-text-datalist-field

RNS CMB Text Datalist Field

Create text fields with datalists using Custom Metaboxes and Fields for WordPress

★ 0stars

Install

Download source zip No release zip yet

This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/religionnews/rns-cmb-text-datalist-field/archive/refs/heads/master.zip
No built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.

Create text fields with datalists using Custom Metaboxes and Fields for WordPress

Description

This plugin creates a text_datalist field type for use with Custom Metaboxes and Fields for WordPress.

The text_datalist field works like the CMB text field but includes a <datalist> element. <datalist>s provide suggestions as the user completes the field, as illustrated here.

For <datalist> browser compatability, see caniuse.com.

Installation

  1. Upload the plugin to the /wp-content/plugins/ directory
  2. Activate the plugin through the 'Plugins' menu in WordPress

The code for creating a text_datalist field looks identical to the code for creating a text field with the addition of the datalist key:

array(
  'name' => 'My Text Datalist Field',
  'desc' => 'field description (optional)',
  'id'   => $prefix . 'test_text_datalist',
  'type' => 'text_datalist',
  'datalist' => array( 'Apple', 'Banana', 'Cranberry' )
),

The value of datalist should be a numeric array, as illustrated above.

Screenshots

  1. An example of suggestions from a <datalist> shown as the user types

Changelog

0.1

  • Initial release