Skip to content

wpscholar/flex-fields

Repository files navigation

Flex Fields

A library for working with fields in WordPress.

Installation

  • Run composer require wpscholar/flex-fields
  • Make sure you require the vendor/autoload.php file in your project.

Usage

Register a field

<?php

register_flex_field(
  'email_address',                      // The field name
  [                                     // The field arguments
    'field' => 'input',  
    'type' => 'email',
    'value' => 'john.doe@gmail.com',
  ],
  'default'                             // The group name, defaults to 'default'
);

Render a field

<?php

render_flex_field(
  'email_address',  // Field name 
  'default'         // The group name, defaults to 'default'
);

Maintainers

Micah Wood

Contributors

This project exists thanks to all the people who contribute.

project contributors