EvanAgee / vuejs-wordpress-theme-starter

A WordPress theme with the guts ripped out and replaced with Vue.
https://vuewp.com/
1.6k stars 281 forks source link

Is this compatible with Carbon fields? #49

Closed joannesalfa closed 5 years ago

joannesalfa commented 5 years ago

https://carbonfields.net

It's awesome library you can easily add custom fields as gallery, nested list, widget, gutenberg block, etc. Basically you add something in function.php then pass a variable into any wordpress page template.... but how do you store php variables into vue.js data?

In that case it's a php code carbon_get_theme_option( 'crb_myName_field' );

EvanAgee commented 5 years ago

@joannesalfa you would accomplish this by updating the WordPress REST API to include that data here's a guide on how to do so [https://developer.wordpress.org/rest-api/extending-the-rest-api/modifying-responses/]. There are also a number of WordPress plugins that allow you to control the API output.