jtsternberg / Code-Snippets-CPT

A WordPress plugin for managing and displaying code snippets
http://dsgnwrks.pro
19 stars 17 forks source link

Fully Integrated Ace Editor/Viewer #22

Closed JayWood closed 8 years ago

JayWood commented 8 years ago

@jtsternberg - Cleaned up the ancient code a bit, please take a look and compare/test. As always with any questions let me know.

jtsternberg commented 8 years ago

One problem I see here off-the-bat is that current users may be pretty peaved if we change the render engine out from under them. I think Ace is prob. the way to go, but we need to make sure the front-end rendering does not change unless they opt into it (and ace could be the default for new installs).

JayWood commented 8 years ago

@jtsternberg good point, didn't think about that, just wanted to update the old PR from 2015 haha - I'll get to work on the front-end to prevent an angry mob :+1:

JayWood commented 8 years ago

@jtsternberg Nice and tidy, cleaned up a few things as well - I'll patiently await your response :smile:

Ended up splitting up the two shortcode outputs into helper methods.

I didn't really know of a way to 'enable ace for new installs' aside from checking against the installed version. In the interest of simplicity, I just went with a filter to enable/disable the front-end shortcode ACE output.

So, to enable the ACE shortcode output, one only has to drop this somewhere in their theme/plugin: add_filters( 'snippets-cpt-ace-frontend', '__return_true' );

bradp commented 8 years ago

If you're bundling ACE, make sure you keep the License intact, as you'll want to properly credit the author and uphold the terms of the License.

JayWood commented 8 years ago

Noted!

bradp commented 8 years ago

@jtsternberg yoooooooo

jtsternberg commented 8 years ago

I'm soooo on this... soon.

jtsternberg commented 8 years ago

Thanks for all your effort @JayWood... Finally merged! I've made a lot of changes, so I suggest reviewing master for changes if you want. I'll be releasing an official version shortly (on wordpress.org).