function TSpell_process_unignore_update() { if ( ! TSpell_is_allowed() ) return; if ( ! isset( $_POST['TSpell_ignored_phrases'] ) ) return; $user = wp_get_current_user(); if ( ! $user || $user->ID == 0 ) return; $ignores = array_filter( array_map( 'strip_tags', explode( ',', $_POST['TSpell_ignored_phrases'] ) ) ); TSpell_update_setting( $user->ID, 'TSpell_ignored_phrases', join( ',', $ignores ) ); }
function TSpell_update_options( $user_id, $name ) { // We should probably run $_POST[name] through an esc_*() function... if ( isset( $_POST[$name] ) && is_array( $_POST[$name] ) ) { $copy = array_map( 'strip_tags', array_keys( $_POST[$name] ) ); TSpell_update_setting( $user_id, TSpell_sanitize( $name ), implode( ',', $copy ) ); } else { TSpell_update_setting( $user_id, TSpell_sanitize( $name ), ''); } return; }