DEV Community

Discussion on: Headless WordPress with React

 
jchiatt profile image
J.C. Hiatt • Edited

Hey Mauro! To make your plugin compatible, you'd create a custom endpoint for you plugin: developer.wordpress.org/rest-api/e...

For your CSS rules, you could just separate them from the plugin, or you may be able to send them back via the API in a JS object, and then grab them out of the object and write them to <head> or do inline styles. You could go a step further and add an interface in the Dashboard to change the styles of your footnotes.

I haven't done this yet, so you may want to read up more and test it out!

I don't really know the full extent of functionality of your plugin, but you could also simply not use a plugin and instead use a custom field on each post object and let the custom field include footnotes for that respective post. You could then trivially retrieve the value of the custom field via the API.