Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider supporting WYSIWYG content editor #65

Open
grahamharper opened this issue May 6, 2015 · 6 comments
Open

Consider supporting WYSIWYG content editor #65

grahamharper opened this issue May 6, 2015 · 6 comments

Comments

@grahamharper
Copy link

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
Copy link
Owner

ewels commented May 7, 2015

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
Copy link
Author

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
Copy link
Owner

ewels commented May 7, 2015

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
Copy link
Author

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
Copy link
Owner

ewels commented May 7, 2015

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
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants