ewels / CPT-Bootstrap-Carousel

WordPress plugin which generates a custom post type for choosing images and content. Outputs Bootstrap Image Carousel (slider) HTML from a shortcode.
http://wordpress.org/plugins/cpt-bootstrap-carousel/
GNU General Public License v2.0
51 stars 36 forks source link

Consider supporting WYSIWYG content editor #65

Open grahamharper opened 9 years ago

grahamharper commented 9 years ago

Have you considered enabling the content editor for the post type and using that instead of the excerpt? It would give much more freedom with the content of the slide.

ewels commented 9 years ago

Hi @grahamharper - interesting idea. I originally wrote the plugin for a client, and I didn't want to give too much freedom to mess around with the way that the site looked ;) However, I think it's fair to say that the plugin has grown beyond that now and a lot of people could find it useful.

I'd need to remove the 'before caption' and 'after caption' settings fields though, and write some kind of migration tool so that people don't lose their captions when they upgrade. Can't see any particular problems with that though.

grahamharper commented 9 years ago

Maybe you could make it optional? I needed this for a project so in a fork added a settings option to enable the content editor and on the front end use the post content instead of the excerpt if it's enabled.

https://github.com/IgniteNetwork/cpt-bootstrap-carousel/tree/editor-content

In this branch I also added a setting to optionally hide the title. Which might also be a useful addition.

ewels commented 9 years ago

That could work.. Is the 'hide title' feature to make it easier to skim slides on the admin page or something?

Your changes look nice anyway. I don't get the str_replace( ']]>', ']]>' though?

grahamharper commented 9 years ago

Thanks, they were just some quick changes to achieve what I needed.

I wanted the option of hiding the title, it's useful to see it in the admin area but I don't necessarily need it showing up on the front end, especially if I'm adding content through the WYSIWYG editor.

With the str_replace( ']]>', ']]>' I was just following this example in the Codex.

https://codex.wordpress.org/Function_Reference/the_content#Alternative_Usage

As get_the_content() is not filtered, this is mimicking how it's used within the_content(). It escapes CDATA blocks.

https://core.trac.wordpress.org/browser/tags/4.2.1/src/wp-includes/post-template.php#L220

ewels commented 9 years ago

Nice - learn something new every day..!

If you fancy opening up a pull-request that'd be great anyway, I like all of the changes you've made. Only alteration that I might make is having either the excerpt or the content editor, rather than both.. Might get confusing having the excerpt box there if its content is ignored.

grahamharper commented 9 years ago

Sure, I'll give it the once over before I open the pull request. It was written very late at night! Good idea about having either the excerpt or the content editor.