Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

bvucp on "Preserving option screen input for the next option page render"

$
0
0

Here's the scenario:

I have a field on an options page that accepts input from a wp_editor() TinyMCE editor.

If certain conditions are met (e.g. input is too long) the input will not be saved. Currently, I have the sanitization function display an error via add_settings_error() so the user is at least aware that this happened. But, since my option render function simply spits out whatever is currently saved (& so retrieved by get_option), the user immediately loses their invalid input when this happens.

However, I would like to also give the user back their input that was rejected in the WP Editor window, so they have a chance to revise and fix it and hit Save again, rather than their changes being immediately lost to the void. My immediate thought is to use $_SESSION, but is there a WordPress-specific way of carrying this information over temporarily?

My google fu appears to be weak - I'm sure this has been discussed, but I can't seem to find anything covering it.


Viewing all articles
Browse latest Browse all 8245

Trending Articles