Skip to content

Commit 76af862

Browse files
committed
Add readme
1 parent 46c825d commit 76af862

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

README.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Flex Fields
2+
3+
A library for working with fields in WordPress.
4+
5+
## Installation
6+
7+
- Run `composer require wpscholar/flex-fields`
8+
- Make sure you require the `vendor/autoload.php` file in your project.
9+
10+
## Usage
11+
12+
### Register a field
13+
14+
```php
15+
<?php
16+
17+
register_flex_field(
18+
'email_address', // The field name
19+
[ // The field arguments
20+
'field' => 'input',
21+
'type' => 'email',
22+
'value' => 'john.doe@gmail.com',
23+
],
24+
'default' // The group name, defaults to 'default'
25+
);
26+
```
27+
28+
### Render a field
29+
30+
```php
31+
<?php
32+
33+
render_flex_field(
34+
'email_address', // Field name
35+
'default' // The group name, defaults to 'default'
36+
);
37+
```
38+
39+
## Maintainers
40+
41+
<a href="https://github.com/wpscholar">
42+
<img src="https://avatars.githubusercontent.com/u/890951?v=4" alt="Micah Wood" style="width: 60px;border-radius:50%;" />
43+
</a>
44+
45+
## Contributors
46+
47+
This project exists thanks to all the people who contribute.
48+
49+
<a href="https://github.com/wpscholar/flex-fields/graphs/contributors">
50+
<img src="https://contrib.rocks/image?repo=wpscholar/flex-fields" alt="project contributors"/>
51+
</a>

0 commit comments

Comments
 (0)