[wp-hackers] Custom post publish: show error $notice in stead of update $message

Jeremy Clarke jer at simianuprising.com
Wed Nov 17 15:45:11 UTC 2010


A related strategy is to use the Transients API to store error data so you
can give more useful error messages without a huge _GET output. You can save
detailed error data into a short-lived transient, set your error message
flag, then when the page reloads with the editor your admin_notices hook
fetches the details from the transient, shows them, and deletes the
transient.

http://codex.wordpress.org/Transients_API

The plugin system and the errors built into the settings API both use this
strategy.

-- 
Jeremy Clarke | http://jeremyclarke.org
Code and Design | http://globalvoicesonline.org


More information about the wp-hackers mailing list