/** * Saves the admin settings. * * @since 1.5.7 * @return void */ public static function save_admin_settings() { global $wpdb; // Templates override if (is_network_admin()) { $templates_override = sanitize_text_field($_POST['fl-templates-override']); if (empty($templates_override)) { $templates_override = false; } else { if (!is_numeric($templates_override)) { $templates_override = false; FLBuilderAdminSettings::add_error(__("Error! Please enter a number for the site ID.", 'fl-builder')); } else { if (!FLBuilderMultisite::blog_exists($templates_override)) { $templates_override = false; FLBuilderAdminSettings::add_error(__("Error! A site with that ID doesn't exist.", 'fl-builder')); } } } update_site_option('_fl_builder_templates_override', $templates_override); } else { if (!is_multisite()) { if (isset($_POST['fl-templates-override'])) { $templates_override = 1; } else { $templates_override = false; } update_site_option('_fl_builder_templates_override', $templates_override); } } // Row and module templates if (is_network_admin() || !is_multisite()) { update_site_option('_fl_builder_templates_override_rows', isset($_POST['fl-templates-override-rows'])); update_site_option('_fl_builder_templates_override_modules', isset($_POST['fl-templates-override-modules'])); } }
/** * Initializes the builder network admin settings page * and additional multisite logic. * * @since 1.0 * @return void */ public static function init_multisite() { if (is_multisite()) { if (class_exists('FLBuilderMultisite')) { FLBuilderMultisite::init(); } if (class_exists('FLBuilderMultisiteSettings')) { FLBuilderMultisiteSettings::init(); } } }
/** * Uninstalls the builder and all of its data. * * @since 1.0 * @access private * @return void */ private static function uninstall() { if (!current_user_can('delete_plugins')) { return; } else { if (isset($_POST['fl-uninstall']) && wp_verify_nonce($_POST['fl-uninstall'], 'uninstall')) { if (is_multisite() && class_exists('FLBuilderMultisite')) { FLBuilderMultisite::uninstall(); } else { FLBuilderAdmin::uninstall(); } } } }