Skip Navigation

[Resuelto] Word count on WYSIWYG fields

Este hilo está resuelto. Aquí tiene una descripción del problema y la solución.

Problem:
Can we create a word count on any text field that Toolset Types creates?

Solution:
https://toolset.com/forums/topic/word-count-on-wysiwyg-fields/#post-608196

This support ticket is created hace 6 años, 3 meses. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 2 respuestas, has 2 mensajes.

Last updated by Simon hace 6 años, 3 meses.

Assisted by: Beda.

Autor
Mensajes
#608102

Tell us what you are trying to do?
- I would like to show people how much text they have entered in to a CRED WYSIWYG text field, so they will be able to keep content within the word limit stated by my client

Any solution for either showing the word count OR imposing a word limit on the field would be great.

Thanks!

#608196

We have a request filed for Types, which also would affect CRED later on, where a Field with count would be provided, mainly with the goal to limit the amount of characters or words.

This could also be used for your goal, and I added your voice there.

Now, for your specific goal there is no solution within WordPress without custom code or 3rd party software.
Toolset does not include any count of data either yet.

You would need to use Custom JS right now, or Custom PHP validation on submit (not really what you want)
Here are a few examples:
hidden link
hidden link
https://wordpress.org/support/topic/how-to-display-wp-editor-word-count/#post-7538501

On PHP validation, you can hook your code to the CRED API:
https://toolset.com/documentation/programmer-reference/cred-api/#cred_save_data

For JS, you can add it directly to the CRED Form Edit area for JS below the main content.

#608304

Thank you. For the benefit of others, I used this solution.

https://wordpress.org/support/topic/how-to-display-wp-editor-word-count/#post-7538501

It's not very clear, but it does work if you make your own WordPress plugin containing the PHP sample code supplied, and the relevant TinyMCE plugin referenced (that's why the thread is a bit muddled, because there are two different plugins being talked about!)

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.