Skip to content

Commit

Permalink
2881 confusing site api related to meta and option (#2978)
Browse files Browse the repository at this point in the history
* docs: update custom-fields documentation regarding ACF options fields

* update docs
  • Loading branch information
Levdbas committed Apr 30, 2024
1 parent 6b72908 commit 7384e76
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/v2/guides/custom-fields.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,9 @@ For site options, it’s also possible to access it directly through its name:

Please be aware that using this might conflict with existing Timber methods on the `Timber\Site` object. That’s why the `option()` method is the preferred way to retrieve site options.


You cannot fetch ACF options with `site.option()`. You will need to add the fields to the context yourself. This process is described in the [ACF integration](https://timber.github.io/docs/v2/integrations/advanced-custom-fields/#options-page) documentation.

## Query by custom field value

This example that uses a [WP_Query](http://codex.wordpress.org/Class_Reference/WP_Query) array shows the arguments to find all posts where a custom field called `color` has a value of `red`.
Expand Down

0 comments on commit 7384e76

Please sign in to comment.