Pregunta

I am using the Advanced Custom Fields plugin with the options add on.
How can I use the value of a field from options in a plugin?
I have a simple php file in the plugins folder that needs to get this value. Is that possible?

¿Fue útil?

Solución

For anyone searching for the solution:

Suppose your options field is a text field named "my_option_field_01".

In your php, if you wanted to display the value of that option field inside of a paragraph tag, you would put this:

<p><?php echo get_field('my_option_field_01', 'option'); ?></p>
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top