Skip to content

Commit f58874c

Browse files
authored
Update README.md
1 parent 8e52e83 commit f58874c

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ $framework->register_settings( array( $settings ) ); // Note: $settings one grou
179179

180180
To retrieve options for the above settings, locate the settings key, in our case `custom_options`.
181181

182-
```
182+
```php
183183
// Make settings instance
184184
$settings = get_option('custom_options');
185185

@@ -252,13 +252,15 @@ $framework->register_metabox( array(
252252

253253
To retrieve the metabox settings, use get_post_meta() function as follows.
254254

255-
```
255+
```php
256256
$value = get_post_meta($post_id, 'demo_text', true);
257257
```
258258

259-
If you are using `'save_mode' => 'array'` in the metabox settings, then all the settings will be stored into one meta row as serialized array. To retrieve with this kind of save mode, call the get_post_meta() function on the metabox id as follows:
259+
If you are using `'save_mode' => 'array'` in the metabox settings, then all the settings will be stored into one meta row as serialized array. This appraoch is good if you want better performance. The data will be accessible with one mysql query instead of separate for each field.
260260

261-
```
261+
To retrieve with this kind of save_mode, call the get_post_meta() function on the metabox id as follows:
262+
263+
```php
262264
$data = get_post_meta($post_id, 'demo_meta_box', true);
263265
$value = $data['demo_text'];
264266
```

0 commit comments

Comments
 (0)