-
Notifications
You must be signed in to change notification settings - Fork 17
/
hooks.php
51 lines (45 loc) · 1.3 KB
/
hooks.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php if (!defined('FW')) die('Forbidden');
/**
* @param bool $exclude
* @param string $option_name
* @param bool $is_full_backup
*
* @return bool
*/
function _filter_fw_ext_backups_db_export_exclude_option($exclude, $option_name, $is_full_backup) {
foreach (array(
'_site_transient_',
'_transient_'
) as $option_prefix) {
if (substr($option_name, 0, strlen($option_prefix)) === $option_prefix) {
return true;
}
}
return $exclude;
}
add_filter('fw_ext_backups_db_export_exclude_option', '_filter_fw_ext_backups_db_export_exclude_option', 10, 3);
/**
* Other extensions options
*/
{
function _filter_fw_ext_backups_db_export_exclude_other_extensions_options($exclude, $option_name, $is_full_backup) {
if (!$is_full_backup) {
if ($option_name === 'fw_ext_settings_options:mailer') {
return true;
}
}
return $exclude;
}
add_filter('fw_ext_backups_db_export_exclude_option',
'_filter_fw_ext_backups_db_export_exclude_other_extensions_options', 10, 3
);
function _filter_fw_ext_backups_db_restore_keep_other_extensions_options($options, $is_full) {
if (!$is_full) {
$options[ 'fw_ext_settings_options:mailer' ] = true;
}
return $options;
}
add_filter('fw_ext_backups_db_restore_keep_options',
'_filter_fw_ext_backups_db_restore_keep_other_extensions_options', 10, 2
);
}