adding patchs files according to form in menu

This commit is contained in:
asus
2024-03-24 16:16:55 +01:00
parent 28a1f7922d
commit 1745d8754d
4 changed files with 12 additions and 6 deletions

View File

@@ -108,8 +108,17 @@ class Fbpatch {
update_option(self::$_patches['_name'], $serialize_patches_option);
}
/*
* this function will include the files of the different patches if they are set in the options
*
*/
public static function init_hook() {
add_action('wp_enqueue_scripts', __NAMESPACE__.'\add_form_builder_calculations_patch', 22);
$patches = Fbpatch::get_patches();
foreach($patches as $patch => $data) {
if ($data['checked'] === true) {
include_once(plugin_dir_path(__DIR__) . '/php/'.$patch.'.php');
}
}
}
}