function SaveModuleSettings($blockID) { $moduleSettings = FlutterLayoutBlock::GetModuleSettingsByBlock($blockID); foreach ($moduleSettings->variables as $varKey => $variable) { $moduleSettings->variables[$varKey]->value = $_POST[$variable->variable_name]; } $moduleSettings->SaveValues(); }
function GetModules($pageName, $position = '', $templateName = false) { global $wpdb; if (!$templateName) { $templateName = get_option('template'); } $blocksID = $wpdb->get_col(" SELECT block_id " . " FROM " . FLUTTER_TABLE_LAYOUT_MODULES . " WHERE theme = '{$templateName}' AND position = '{$position}' AND page='{$pageName}'"); $resutls = array(); foreach ($blocksID as $blockID) { $resutls[] = FlutterLayoutBlock::GetModuleSettingsByBlock($blockID, $templateName); } return $resutls; }