diff --git a/documentation/10-containers/20-post-meta.md b/documentation/10-containers/20-post-meta.md index cf0f5c6..e429234 100644 --- a/documentation/10-containers/20-post-meta.md +++ b/documentation/10-containers/20-post-meta.md @@ -20,19 +20,22 @@ The priority within the context where the container should show (`'high'` (defau ### Accessing field values -To access field values you need to use the function `carbon_get_post_meta( $id, $name )`, where: +To access field values you need to use the function `carbon_get_post_meta( $id, $name, $container_id = '' )`, where: | Parameter | Description | | -------------------- | ----------------------------------------------------------------------------------- | -| `$id` | Post ID where your value was entered. | -| `$name` | The field name pattern of the field to be retrieved. | +| `$id` | Post ID where your value was entered. (required) | +| `$name` | The field name pattern of the field to be retrieved. (required) | +| `$container_id` | The container id for which to retrieve the field value. (optional) | + +*Container ID is generated from the `carbon_fields_container_` prefix and sanitized version of the Container Name. For example if you define `post_meta` Container named `Post Settings` its id will be - `carbon_fields_container_post_settings`. Passing the container id is recommended if you have defined fields with same names and in different containers.* ```php
Article was published in:
-CopyrightOffice locations: - '; @@ -146,4 +147,4 @@ To retrieve field values from a theme options container, you need to use the fun
``` -After saving, the `carbon_fields_theme_options_container_saved` hook is called, which allows you to hook additional functionality after saving. \ No newline at end of file +After saving, the `carbon_fields_theme_options_container_saved` hook is called, which allows you to hook additional functionality after saving. diff --git a/documentation/10-containers/40-term-meta.md b/documentation/10-containers/40-term-meta.md index a7649cc..32943aa 100644 --- a/documentation/10-containers/40-term-meta.md +++ b/documentation/10-containers/40-term-meta.md @@ -16,19 +16,20 @@ Container::make( 'term_meta', 'Category Properties' ) ### Accessing field values -To access field values you need to use the function `carbon_get_term_meta( $term_id, $name )`, where: +To access field values you need to use the function `carbon_get_term_meta( $term_id, $name, $container_id = '' )`, where: | Parameter | Description | | -------------------- | ----------------------------------------------------------------------------------- | -| `$term_id` | Term ID where your value was entered. | -| `$name` | The field name pattern of the field to be retrieved. | +| `$term_id` | Term ID where your value was entered. (required) | +| `$name` | The field name pattern of the field to be retrieved. (required) | +| `$container_id` | The container id for which to retrieve the field value. (optional) See [Post Meta Container](/containers/post-meta?id=accessing-field-values) for more info. | ```php
Editor of this category: term_id, 'crb_editor' ); ?>
-term_id, 'crb_authors' ); foreach ( $authors as $author ) { echo $author['name']; @@ -36,4 +37,4 @@ foreach ( $authors as $author ) { ?> ``` -After saving, the `carbon_fields_term_meta_container_saved` hook is called, which allows you to hook additional functionality after saving. It accepts the `$term_id` parameter, which is the `term_id` of the taxonomy term that was updated. \ No newline at end of file +After saving, the `carbon_fields_term_meta_container_saved` hook is called, which allows you to hook additional functionality after saving. It accepts the `$term_id` parameter, which is the `term_id` of the taxonomy term that was updated. diff --git a/documentation/10-containers/50-user-meta.md b/documentation/10-containers/50-user-meta.md index 12faa69..1c45f2d 100644 --- a/documentation/10-containers/50-user-meta.md +++ b/documentation/10-containers/50-user-meta.md @@ -16,19 +16,20 @@ Container::make( 'user_meta', 'Address' ) ### Accessing field values -To access field values you need to use the function `carbon_get_user_meta( $user_d, $name )`, where: +To access field values you need to use the function `carbon_get_user_meta( $user_id, $name, $container_id = '' )`, where: | Parameter | Description | | -------------------- | ----------------------------------------------------------------------------------- | -| `$user_id` | User ID where your value was entered. | -| `$name` | The field name pattern of the field to be retrieved. | +| `$user_id` | User ID where your value was entered. (required) | +| `$name` | The field name pattern of the field to be retrieved. (required) | +| `$container_id` | The container id for which to retrieve the field value. (optional) See [Post Meta Container](/containers/post-meta?id=accessing-field-values) for more info. | ```phpAuthor address:
- -``` \ No newline at end of file +``` diff --git a/documentation/10-containers/80-nav-menu-item.md b/documentation/10-containers/80-nav-menu-item.md index f09a049..c543e78 100644 --- a/documentation/10-containers/80-nav-menu-item.md +++ b/documentation/10-containers/80-nav-menu-item.md @@ -18,12 +18,13 @@ Containers are rendered in the order they are initialized. ### Accessing field values -Since each menu entry is a post from post type `"nav_menu_item"` with status `"publish"`, the values can be accessed with the function `carbon_get_nav_menu_item_meta( $nav_menu_item_ID, $name )`, where: +Since each menu entry is a post from post type `"nav_menu_item"` with status `"publish"`, the values can be accessed with the function `carbon_get_nav_menu_item_meta( $nav_menu_item_ID, $name, $container_id = '' )`, where: -| Parameter | Description | -| -------------------- | ------------------------------------------------------------- | -| `$nav_menu_item_ID` | Nav Menu Item Post ID where your value was entered. | -| `$name` | The field name pattern of the field to be retrieved. | +| Parameter | Description | +| -------------------- | -------------------------------------------------------------- | +| `$nav_menu_item_ID` | Nav Menu Item Post ID where your value was entered. (required) | +| `$name` | The field name pattern of the field to be retrieved. (required) | +| `$container_id` | The container id for which to retrieve the field value. (optional) See [Post Meta Container](/containers/post-meta?id=accessing-field-values) for more info. | ### Custom Walkers or Walker Filters @@ -116,4 +117,4 @@ Both of the above examples will result in: -``` \ No newline at end of file +```