function save_families() { check_admin_referer(__CLASS__); $all_fonts = Genesis_Club_Fonts::get_all_fonts(); $new_fonts = array(); foreach ($_POST as $key => $values) { if ('family-' == substr($key, 0, 7)) { $font_id = substr($key, 7); $new_fonts[$font_id] = array('family' => $all_fonts[$font_id]['family'], 'variants' => $values); } } $message = __(Genesis_Club_Fonts::save_families(array_merge(Genesis_Club_Fonts::get_families(), $new_fonts)) ? 'Font Families were updated successfully' : 'Font Families were not updated', GENESIS_CLUB_DOMAIN); $redir = wp_get_referer(); //get the referer $redir = remove_query_arg(array('action', 'noheader', 'font_id'), $redir); //remove the action $redir = add_query_arg(array('message' => urlencode($message), 'lastaction' => 'fonts'), $redir); //update the URL wp_redirect($redir); exit; }