MickeyKay / better-font-awesome

[WordPress] A WordPress plugin that allows you to easily integrate the latest version of FontAwesome.
GNU General Public License v2.0
10 stars 7 forks source link

Switch to using AJAX for saving settings #4

Closed BraadMartin closed 9 years ago

BraadMartin commented 9 years ago

For added slickness.

michaelbeil commented 9 years ago

Nice work @BraadMartin.

MickeyKay commented 9 years ago

@BraadMartin and @dashaluna

Looking again, I'm noticing that __() seems to typically be used in non-output scenarios (e.g. plugin name, widget title, etc), whereas esc_html__() is used in contexts that involve direct HTML output. I still don't understand why you need to escape within those contexts though, if you have total control over the string/markup being output. Is it just to protect against translations that include faulty markup?

dashaluna commented 9 years ago

@MickeyKay I feel like we're highjacking this PR a bit :) I wondered if you could copy these comments to my PR and we can continue discussion there. I hope that's ok.

BraadMartin commented 9 years ago

After some testing I realized that calling update_option passes the options through the sanitize callback defined in register_setting before saving to the database, so there's no need to do this manually before calling update_option.

dashaluna commented 9 years ago

@BraadMartin sorry, I'm a bit confused what you're referring to? Could you explain a bit more?

@MickeyKay I've added a comment to my PR, not to hijack this one :) https://github.com/MickeyKay/better-font-awesome/pull/5#issuecomment-92774412

MickeyKay commented 9 years ago

PS - it's cool, Braad and I work together so we're chatting about this daily anyways :)