Skip to content

Commit 11cccb0

Browse files
committed
Update README for clarity
1 parent 05f7ad3 commit 11cccb0

File tree

1 file changed

+19
-7
lines changed

1 file changed

+19
-7
lines changed

README.md

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ A framework to register [Advanced Custom Fields](https://wordpress.org/plugins/a
77

88
ACF PHP makes it easier to register ACF fields using PHP by automating the tedious parts of adding new fields and adding defaults that make sense.
99

10-
*Without ACF PHP:*
10+
**Without ACF PHP:**
1111

1212
```php
1313
array (
@@ -30,7 +30,7 @@ array (
3030
)
3131
```
3232

33-
*With ACF PHP:*
33+
**With ACF PHP:**
3434

3535
```php
3636
'header_title',
@@ -55,7 +55,9 @@ Download the `.zip` file from GitHub to install in your WordPress admin.
5555

5656
All options for ACF fields are supported. For more information, please check out the official [Advanced Custom Fields website](https://www.advancedcustomfields.com/resources/register-fields-via-php/).
5757

58-
*Basic example:*
58+
**Basic example:**
59+
60+
*Setting up the metabox:*
5961

6062
```php
6163
$page_settings_metabox = array(
@@ -81,17 +83,26 @@ $page_settings_metabox = array(
8183
),
8284
),
8385
);
86+
```
8487

88+
*Register the metabox:*
89+
90+
```php
8591
if ( function_exists( 'acf_php_add_local_field_group' ) ) {
8692
acf_php_add_local_field_group( $page_settings_metabox );
8793
}
94+
```
95+
96+
*Retrieve the meta values:*
8897

89-
// To retrieve the meta values (alternatively, use standard ACF functions)
98+
```php
9099
$text_content = get_post_meta( get_the_ID(), 'text', true );
91100
$textarea_content = get_post_meta( get_the_ID(), 'textarea', true );
92101
```
93102

94-
*Repeater example:*
103+
Alternatively, use standard ACF functions.
104+
105+
**Repeater example:**
95106

96107
```php
97108
'fields' => array(
@@ -112,7 +123,7 @@ $textarea_content = get_post_meta( get_the_ID(), 'textarea', true );
112123
),
113124
```
114125

115-
*Flexible Content example:*
126+
**Flexible Content example:**
116127

117128
```php
118129
'fields' => array(
@@ -133,7 +144,7 @@ $textarea_content = get_post_meta( get_the_ID(), 'textarea', true );
133144
),
134145
```
135146

136-
*Reusable field example:*
147+
**Reusable field example:**
137148

138149
```php
139150
$checkbox = array(
@@ -151,6 +162,7 @@ $checkbox = array(
151162
```
152163

153164
## To-do
165+
* Improve ACF_PHP_Metabox class (leaner code).
154166
* Add support for multiple fields in a single variable.
155167
* Improve field group location settings.
156168

0 commit comments

Comments
 (0)