clarklab
Member
Posted 7 months ago #
I've got a handful of content buckets that are controlled through the Theme Customizer (newly added in 3.4). I called the data in my templates with get_theme_mod().
Any plans to support this type of content? I'm finding the Theme Customizer a great place to set some simple text buckets and I'd love if folks could edit with Front End Editor.
Thanks!
http://wordpress.org/extend/plugins/front-end-editor/
Could you post some example code that sets up one such "text bucket" on http://gist.github.com (or a similar site)?
clarklab
Member
Posted 7 months ago #
Sure! Here is a quick example, allowing the user to input a line of text into the footer:
https://gist.github.com/3902885
clarklab
Member
Posted 7 months ago #
If needed, I could output some extra classes. I'm not certain how Front End Editor actually works (a client installed it). Does it hook as the PHP renders or in the front-end based on class names, etc?
And thanks for the quick response.
clarklab
Member
Posted 7 months ago #
btw, there is an equivalent function for updating the data, set_theme_mod: http://codex.wordpress.org/Function_Reference/set_theme_mod so I thought it might be something you guys could implement without having to move mountains.
Plus I assume others might want it as the Theme Customizer gets more popular. It's a great way to avoid an options page.
Does it hook as the PHP renders or in the front-end based on class names, etc?
It wraps the content in a <div> using filters such as 'the_content' and then makes them editable via JS.
Since get_theme_mod() has such a filter, it should be doable. I don't know when I'll get around to implemening it, but I posted it on github:
https://github.com/scribu/wp-front-end-editor/issues/83