Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • You’re right, serialize() wasn’t the problem.

    I am stripping html because I prefer an excerpt over all html-content. It doesn’t easily ruin the admin interface either. Saying this, I realize it isn’t a real excerpt in my current implementation and in fact it changes the current functionality, so I have no problem if that part wouldn’t make a next release.

    I will create a patch file tomorrow.

    I have tested wp_editor() but it doesn’t load Gutenberg. No matter what plugins you have enabled. I don’t think Gutenberg is intended to be used as an editor for anything else other then posts.

    I did some further research and jQuery’s serialize() was the reason it didn’t work.

    Apart from the html change, I’ve also adjusted the JavaScript file and added:

    tinyMCE.triggerSave();

    before:

    var form_data = jQuery(this).serialize();

    It’s confusing that it also clears the input fields. I can see why it was done, but because you have mixed both the insert and update into a single method it gets blurry from a UX perspective. I don’t expect my input fields to be cleared after an update. If this is required, the success function needs the following to empty it:

    tinymce.activeEditor.setContent('');

    I also think it would be better to remove html from the admin output with wp_strip_all_tags(). To me that makes more sense. I understand you have to deal with other users too though.

    I have never in my life contributed to WordPress plugins before. Is there a GitHub repo that I can use so you can see the changes I have made?

    I tried some things myself. I thought it would be easy enough to just switch the plain textarea to wp_editor in admin.php but for some reason it doesn’t pick up the update.

    I think that having the WordPress editor there wouldn’t hurt the simplicity. In fact, it would even add to it, as it ensures a similar look and feel across the entire backend.

    I would tinker a bit more with it myself but my time is a little limited these days unfortunately. This is what I used:

    <td><?php wp_editor(stripslashes($name['description']), 'description', array('textarea_rows' => 5, 'textarea_name' => 'description')); ?></td>

    Would you consider adding this?

Viewing 3 replies - 1 through 3 (of 3 total)