wpfts_submit_settings_after (Filter)
The wpfts_submit_settings_after
filter in WP Fast Total Search is called after processing data submitted via the plugin’s AJAX settings form. This allows developers to perform additional actions after settings have been saved to the database.
When to Use
This filter is useful if you need to:
- Perform additional actions after saving settings, such as clearing the cache, updating data, or sending a notification.
- Perform actions only if the settings were successfully saved.
Arguments
$is_form_processed
(bool): A flag indicating whether the form was successfully processed.$data
(array): An array of data submitted via the form.$jx
(object): TheWPFTS_jxResponse
object for sending AJAX responses.
Return Value
$is_form_processed
(bool): The modified flag indicating whether the form was processed. Usually, the input value is returned.
Example (Clearing Cache After Saving Settings)
add_filter('wpfts_submit_settings_after', 'clear_cache_after_settings_save', 10, 3);
function clear_cache_after_settings_save($is_form_processed, $data, $jx)
{
if ($is_form_processed) { // Check if settings were successfully saved.
// Clear the cache.
wp_cache_flush();
}
return $is_form_processed;
}
Important Notes
- The
wpfts_submit_settings_after
filter is called after standard form processing. - The
$is_form_processed
parameter indicates whether the settings were successfully saved. - You can use the
$jx
object to send additional information back to JavaScript.
This filter provides developers with the ability to perform necessary actions after saving WP Fast Total Search settings.