private function setSuppressOthers() { // Setting supress others option erpPROPaths::requireOnce(erpPROPaths::$erpPROTheme); if ($this->optObj->getSuppressOthers() === true) { erpPROTheme::suppressOthers(true); } elseif ($this->optObj->getSuppressOthers() === false) { erpPROTheme::suppressOthers(false); } }
/** * Saves shortcode profile in DB * * @author Panagiotis Vagenas <*****@*****.**> * @since 1.0.0 */ public function saveShortcodeProfile() { if (!current_user_can('edit_posts')) { echo json_encode(array('error' => 'Action not allowed')); die; } if (!isset($_POST['profileName']) || empty($_POST['profileName'])) { echo json_encode(array('error' => 'You must set a profile name and define all options')); die; } $profileName = wp_strip_all_tags($_POST['profileName']); unset($_POST['profileName']); $profileOptions = $_POST; erpPROPaths::requireOnce(erpPROPaths::$erpPROShortCodeOpts); $scOpts = new erpPROShortCodeOpts(); $scOpts->loadOptions($profileName); $res = $scOpts->saveOptions($profileOptions); echo json_encode(array('result' => $res, 'profileName' => $profileName)); die; }