How to use get_theme_mod in gutenberg editor wordpress?

Question

In my old WordPress themes (before Gutenberg) I used get_theme_mod to get custom values for certain things in the theme.

get_theme_mod( 'news_custom_headline' );

Now I would like to use the gutenberg editor, however still want to access data from the customizer. How can I do something like this:

save({ attributes }) {
   return <p>Value from backend: get_theme_mod( 'news_custom_headline' ) </p>;
}
0
Lars Flieger 2 years 2020-12-17T13:10:46-05:00 0 Answers 8 views 0

Leave an answer

Browse
Browse