Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/clone/wp-conte.../plugins/popup-bu.../com/classes
File: Ajax.php
if ( ! current_user_can( 'manage_options' ) ) {
[500] Fix | Delete
wp_die(esc_html__('You do not have permission to do this action!', 'popup-builder'));
[501] Fix | Delete
}
[502] Fix | Delete
[503] Fix | Delete
global $wpdb;
[504] Fix | Delete
[505] Fix | Delete
// we will use array_walk_recursive method for sanitizing current data because we can receive an multidimensional array!
[506] Fix | Delete
// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
[507] Fix | Delete
$newsletterData = isset($_POST['newsletterData']) ? stripslashes_deep($_POST['newsletterData']) : [];
[508] Fix | Delete
array_walk_recursive($newsletterData, function(&$item, $k){
[509] Fix | Delete
if ($k === 'messageBody'){
[510] Fix | Delete
$item = wp_kses($item, AdminHelper::allowed_html_tags());
[511] Fix | Delete
} else {
[512] Fix | Delete
$item = sanitize_text_field($item);
[513] Fix | Delete
}
[514] Fix | Delete
});
[515] Fix | Delete
if(isset($newsletterData['testSendingStatus']) && $newsletterData['testSendingStatus'] == 'test') {
[516] Fix | Delete
AdminHelper::sendTestNewsletter($newsletterData);
[517] Fix | Delete
}
[518] Fix | Delete
$subscriptionFormId = (int)$newsletterData['subscriptionFormId'];
[519] Fix | Delete
$subscribersTableName = $wpdb->prefix.SGPB_SUBSCRIBERS_TABLE_NAME;
[520] Fix | Delete
$wpdb->query( $wpdb->prepare("UPDATE $subscribersTableName SET status = 0 WHERE subscriptionType = %d", $subscriptionFormId) );
[521] Fix | Delete
$newsletterData['blogname'] = get_bloginfo('name');
[522] Fix | Delete
$newsletterData['username'] = wp_get_current_user()->user_login;
[523] Fix | Delete
update_option('SGPB_NEWSLETTER_DATA', $newsletterData);
[524] Fix | Delete
[525] Fix | Delete
wp_schedule_event(time(), 'sgpb_newsletter_send_every_minute', 'sgpb_send_newsletter');
[526] Fix | Delete
wp_die();
[527] Fix | Delete
}
[528] Fix | Delete
[529] Fix | Delete
// proStartGold
[530] Fix | Delete
public function checkSameOrigin()
[531] Fix | Delete
{
[532] Fix | Delete
check_ajax_referer(SG_AJAX_NONCE, 'nonce');
[533] Fix | Delete
/**
[534] Fix | Delete
* We only allow administrator to do this action
[535] Fix | Delete
*/
[536] Fix | Delete
if ( ! current_user_can( 'manage_options' ) ) {
[537] Fix | Delete
wp_die(esc_html__('You do not have permission to do this action!', 'popup-builder'));
[538] Fix | Delete
}
[539] Fix | Delete
$url = isset($_POST['iframeUrl']) ? esc_url_raw($_POST['iframeUrl']) : '';
[540] Fix | Delete
$status = SGPB_AJAX_STATUS_FALSE;
[541] Fix | Delete
[542] Fix | Delete
$remoteGet = wp_remote_get($url);
[543] Fix | Delete
[544] Fix | Delete
if(is_array($remoteGet) && !empty($remoteGet['headers']['x-frame-options'])) {
[545] Fix | Delete
$siteUrl = isset($_POST['siteUrl']) ? esc_url_raw($_POST['siteUrl']) : '';
[546] Fix | Delete
$xFrameOptions = $remoteGet['headers']['x-frame-options'];
[547] Fix | Delete
$mayNotShow = false;
[548] Fix | Delete
[549] Fix | Delete
if($xFrameOptions == 'deny') {
[550] Fix | Delete
$mayNotShow = true;
[551] Fix | Delete
} else if($xFrameOptions == 'SAMEORIGIN') {
[552] Fix | Delete
if(strpos($url, $siteUrl) === false) {
[553] Fix | Delete
$mayNotShow = true;
[554] Fix | Delete
}
[555] Fix | Delete
} else {
[556] Fix | Delete
if(strpos($xFrameOptions, $siteUrl) === false) {
[557] Fix | Delete
$mayNotShow = true;;
[558] Fix | Delete
}
[559] Fix | Delete
}
[560] Fix | Delete
[561] Fix | Delete
if($mayNotShow) {
[562] Fix | Delete
echo esc_html($status);
[563] Fix | Delete
wp_die();
[564] Fix | Delete
}
[565] Fix | Delete
}
[566] Fix | Delete
[567] Fix | Delete
// $remoteGet['response']['code'] < 400 it's mean correct status
[568] Fix | Delete
if(is_array($remoteGet) && isset($remoteGet['response']['code']) && $remoteGet['response']['code'] < 400) {
[569] Fix | Delete
$status = SGPB_AJAX_STATUS_TRUE;
[570] Fix | Delete
}
[571] Fix | Delete
[572] Fix | Delete
echo esc_html($status);
[573] Fix | Delete
wp_die();
[574] Fix | Delete
}
[575] Fix | Delete
[576] Fix | Delete
// proEndGold
[577] Fix | Delete
[578] Fix | Delete
public function changePopupStatus()
[579] Fix | Delete
{
[580] Fix | Delete
check_ajax_referer(SG_AJAX_NONCE, 'ajaxNonce');
[581] Fix | Delete
if (!isset($_POST['popupId'])){
[582] Fix | Delete
wp_die(esc_html(SGPB_AJAX_STATUS_FALSE));
[583] Fix | Delete
}
[584] Fix | Delete
$popupId = (int)sanitize_text_field($_POST['popupId']);
[585] Fix | Delete
$obj = SGPopup::find($popupId);
[586] Fix | Delete
$isDraft = '';
[587] Fix | Delete
$postStatus = get_post_status($popupId);
[588] Fix | Delete
if($postStatus == 'draft') {
[589] Fix | Delete
$isDraft = '_preview';
[590] Fix | Delete
}
[591] Fix | Delete
[592] Fix | Delete
if(!$obj || !is_object($obj)) {
[593] Fix | Delete
wp_die(esc_html(SGPB_AJAX_STATUS_FALSE));
[594] Fix | Delete
}
[595] Fix | Delete
$options = $obj->getOptions();
[596] Fix | Delete
$options['sgpb-is-active'] = isset($_POST['popupStatus'])? sanitize_text_field($_POST['popupStatus']) : '';
[597] Fix | Delete
[598] Fix | Delete
if( isset( $options['sgpb-conditions'] ) ){
[599] Fix | Delete
unset( $options['sgpb-conditions'] );
[600] Fix | Delete
}
[601] Fix | Delete
update_post_meta($popupId, 'sg_popup_options'.$isDraft, $options);
[602] Fix | Delete
[603] Fix | Delete
wp_die(esc_html($popupId));
[604] Fix | Delete
}
[605] Fix | Delete
[606] Fix | Delete
public function subscriptionSubmission()
[607] Fix | Delete
{
[608] Fix | Delete
check_ajax_referer(SG_AJAX_NONCE, 'nonce');
[609] Fix | Delete
// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
[610] Fix | Delete
$submissionData = isset($_POST['formData']) ? $_POST['formData'] : "[]";
[611] Fix | Delete
parse_str($submissionData, $formData);
[612] Fix | Delete
array_walk_recursive($formData, function(&$item){
[613] Fix | Delete
$item = sanitize_text_field($item);
[614] Fix | Delete
});
[615] Fix | Delete
$popupPostId = isset($_POST['popupPostId']) ? (int)sanitize_text_field($_POST['popupPostId']) : '';
[616] Fix | Delete
[617] Fix | Delete
if(empty($formData)) {
[618] Fix | Delete
echo esc_html( SGPB_AJAX_STATUS_FALSE );
[619] Fix | Delete
wp_die();
[620] Fix | Delete
}
[621] Fix | Delete
[622] Fix | Delete
$hiddenChecker = sanitize_text_field($formData['sgpb-subs-hidden-checker']);
[623] Fix | Delete
[624] Fix | Delete
// this check is made to protect ourselves from bot
[625] Fix | Delete
if(!empty($hiddenChecker)) {
[626] Fix | Delete
echo 'Bot';
[627] Fix | Delete
wp_die();
[628] Fix | Delete
}
[629] Fix | Delete
global $wpdb;
[630] Fix | Delete
[631] Fix | Delete
$status = SGPB_AJAX_STATUS_FALSE;
[632] Fix | Delete
$date = gmdate('Y-m-d');
[633] Fix | Delete
$email = sanitize_email($formData['sgpb-subs-email']);
[634] Fix | Delete
$firstName = sanitize_text_field($formData['sgpb-subs-first-name']);
[635] Fix | Delete
$lastName = sanitize_text_field($formData['sgpb-subs-last-name']);
[636] Fix | Delete
[637] Fix | Delete
$subscribersTableName = $wpdb->prefix.SGPB_SUBSCRIBERS_TABLE_NAME;
[638] Fix | Delete
$list = $wpdb->get_row( $wpdb->prepare("SELECT id FROM $subscribersTableName WHERE email = %s AND subscriptionType = %d", $email, $popupPostId), ARRAY_A);
[639] Fix | Delete
[640] Fix | Delete
// When subscriber does not exist we insert to subscribers table otherwise we update user info
[641] Fix | Delete
if(empty($list['id'])) {
[642] Fix | Delete
$res = $wpdb->query( $wpdb->prepare("INSERT INTO $subscribersTableName (firstName, lastName, email, cDate, subscriptionType) VALUES (%s, %s, %s, %s, %d) ", $firstName, $lastName, $email, $date, $popupPostId) );
[643] Fix | Delete
} else {
[644] Fix | Delete
$wpdb->query( $wpdb->prepare("UPDATE $subscribersTableName SET firstName = %s, lastName = %s, email = %s, cDate = %s, subscriptionType = %d WHERE id = %d", $firstName, $lastName, $email, $date, $popupPostId, $list['id']) );
[645] Fix | Delete
$res = 1;
[646] Fix | Delete
}
[647] Fix | Delete
if($res) {
[648] Fix | Delete
$status = SGPB_AJAX_STATUS_TRUE;
[649] Fix | Delete
}
[650] Fix | Delete
[651] Fix | Delete
echo esc_html( $status );
[652] Fix | Delete
wp_die();
[653] Fix | Delete
}
[654] Fix | Delete
[655] Fix | Delete
public function sgpbSubsciptionFormSubmittedAction()
[656] Fix | Delete
{
[657] Fix | Delete
check_ajax_referer(SG_AJAX_NONCE, 'nonce');
[658] Fix | Delete
/**
[659] Fix | Delete
* We only allow administrator to do this action
[660] Fix | Delete
*/
[661] Fix | Delete
if ( ! current_user_can( 'manage_options' ) ) {
[662] Fix | Delete
wp_die(esc_html__('You do not have permission to do this action!', 'popup-builder'));
[663] Fix | Delete
}
[664] Fix | Delete
// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
[665] Fix | Delete
$submissionData = isset($_POST['formData']) ? $_POST['formData'] : "[]";
[666] Fix | Delete
parse_str($submissionData, $formData);
[667] Fix | Delete
array_walk_recursive($formData, function(&$item){
[668] Fix | Delete
$item = sanitize_text_field($item);
[669] Fix | Delete
});
[670] Fix | Delete
$popupPostId = isset($_POST['popupPostId']) ? (int)sanitize_text_field($_POST['popupPostId']) : '';
[671] Fix | Delete
if(empty($_POST)) {
[672] Fix | Delete
echo esc_html( SGPB_AJAX_STATUS_FALSE );
[673] Fix | Delete
wp_die();
[674] Fix | Delete
}
[675] Fix | Delete
$email = isset($_POST['emailValue']) ? sanitize_email($_POST['emailValue']) : '';
[676] Fix | Delete
$firstName = isset($_POST['firstNameValue']) ? sanitize_text_field($_POST['firstNameValue']) : '';
[677] Fix | Delete
$lastName = isset($_POST['lastNameValue']) ? sanitize_text_field($_POST['lastNameValue']) : '';
[678] Fix | Delete
$userData = array(
[679] Fix | Delete
'email' => $email,
[680] Fix | Delete
'firstName' => $firstName,
[681] Fix | Delete
'lastName' => $lastName
[682] Fix | Delete
);
[683] Fix | Delete
$this->sendSuccessEmails($popupPostId, $userData);
[684] Fix | Delete
do_action('sgpbProcessAfterSuccessfulSubmission', $popupPostId, $userData);
[685] Fix | Delete
}
[686] Fix | Delete
[687] Fix | Delete
public function sendSuccessEmails($popupPostId, $subscriptionDetails)
[688] Fix | Delete
{
[689] Fix | Delete
global $wpdb;
[690] Fix | Delete
$popup = SGPopup::find($popupPostId);
[691] Fix | Delete
[692] Fix | Delete
if(!is_object($popup)) {
[693] Fix | Delete
return false;
[694] Fix | Delete
}
[695] Fix | Delete
$subscribersTableName = $wpdb->prefix.SGPB_SUBSCRIBERS_TABLE_NAME;
[696] Fix | Delete
[697] Fix | Delete
$count = $wpdb->get_row( $wpdb->prepare("SELECT COUNT(id) as countIds FROM $subscribersTableName WHERE subscriptionType = %d", $popupPostId), ARRAY_A);
[698] Fix | Delete
[699] Fix | Delete
$popupOptions = $popup->getOptions();
[700] Fix | Delete
$adminUserName = 'admin';
[701] Fix | Delete
[702] Fix | Delete
$adminEmail = get_option('admin_email');
[703] Fix | Delete
$userData = @get_user_by('email', $adminEmail);
[704] Fix | Delete
[705] Fix | Delete
if(!empty($userData)) {
[706] Fix | Delete
$adminUserName = $userData->display_name;
[707] Fix | Delete
}
[708] Fix | Delete
[709] Fix | Delete
$newSubscriberEmailHeader = AdminHelper::getEmailHeader($adminEmail);
[710] Fix | Delete
$takeReviewAfterFirstSubscription = get_option('sgpb-new-subscriber');
[711] Fix | Delete
[712] Fix | Delete
if($count['countIds'] == 1 && !$takeReviewAfterFirstSubscription) {
[713] Fix | Delete
// take review
[714] Fix | Delete
update_option('sgpb-new-subscriber', 1);
[715] Fix | Delete
$newSubscriberEmailTitle = __('Congrats! You have already 1 subscriber!', 'popup-builder');
[716] Fix | Delete
$reviewEmailTemplate = AdminHelper::getFileFromURL(SG_POPUP_EMAIL_TEMPLATES_URL.'takeReviewAfterSubscribe.html');
[717] Fix | Delete
$reviewEmailTemplate = preg_replace('/\[adminUserName]/', $adminUserName, $reviewEmailTemplate);
[718] Fix | Delete
$sendStatus = wp_mail($adminEmail, $newSubscriberEmailTitle, $reviewEmailTemplate, $newSubscriberEmailHeader); //return true or false
[719] Fix | Delete
}
[720] Fix | Delete
}
[721] Fix | Delete
[722] Fix | Delete
public function select2SearchData()
[723] Fix | Delete
{
[724] Fix | Delete
check_ajax_referer(SG_AJAX_NONCE, 'nonce_ajax');
[725] Fix | Delete
/**
[726] Fix | Delete
* We only allow administrator to do this action
[727] Fix | Delete
*/
[728] Fix | Delete
if ( ! current_user_can( 'manage_options' ) ) {
[729] Fix | Delete
wp_die(esc_html__('You do not have permission to do this action!', 'popup-builder'));
[730] Fix | Delete
}
[731] Fix | Delete
[732] Fix | Delete
$postTypeName = isset($_POST['searchKey']) ? sanitize_text_field($_POST['searchKey']) : ''; // TODO strongly validate postTypeName example: use ENUM
[733] Fix | Delete
$search = isset($_POST['searchTerm']) ? sanitize_text_field($_POST['searchTerm']) : '';
[734] Fix | Delete
[735] Fix | Delete
switch($postTypeName){
[736] Fix | Delete
case 'postCategories':
[737] Fix | Delete
$searchResults = SGPBConfigDataHelper::getPostsAllCategories('post', [], $search);
[738] Fix | Delete
break;
[739] Fix | Delete
case 'postTags':
[740] Fix | Delete
$searchResults = SGPBConfigDataHelper::getAllTags($search);
[741] Fix | Delete
break;
[742] Fix | Delete
default:
[743] Fix | Delete
$searchResults = $this->selectFromPost($postTypeName, $search);
[744] Fix | Delete
}
[745] Fix | Delete
[746] Fix | Delete
if(isset($_POST['searchCallback'])) {
[747] Fix | Delete
$searchCallback = sanitize_text_field($_POST['searchCallback']);
[748] Fix | Delete
$searchResults = apply_filters('sgpbSearchAdditionalData', $search, array());
[749] Fix | Delete
}
[750] Fix | Delete
[751] Fix | Delete
if(empty($searchResults)) {
[752] Fix | Delete
$results['items'] = array();
[753] Fix | Delete
}
[754] Fix | Delete
[755] Fix | Delete
/*Selected custom post type convert for select2 format*/
[756] Fix | Delete
foreach($searchResults as $id => $name) {
[757] Fix | Delete
$results['items'][] = array(
[758] Fix | Delete
'id' => $id,
[759] Fix | Delete
'text' => $name
[760] Fix | Delete
);
[761] Fix | Delete
}
[762] Fix | Delete
[763] Fix | Delete
wp_send_json($results);
[764] Fix | Delete
}
[765] Fix | Delete
[766] Fix | Delete
private function selectFromPost($postTypeName, $search)
[767] Fix | Delete
{
[768] Fix | Delete
$args = array(
[769] Fix | Delete
's' => $search,
[770] Fix | Delete
'post__in' => !empty($_REQUEST['include']) ? array_map('intval', $_REQUEST['include']) : null,
[771] Fix | Delete
'page' => !empty($_REQUEST['page']) ? absint($_REQUEST['page']) : null,
[772] Fix | Delete
'posts_per_page' => 100,
[773] Fix | Delete
'post_type' => $postTypeName
[774] Fix | Delete
);
[775] Fix | Delete
$searchResults = SGPBConfigDataHelper::getPostTypeData($args);
[776] Fix | Delete
[777] Fix | Delete
return $searchResults;
[778] Fix | Delete
}
[779] Fix | Delete
[780] Fix | Delete
public function addConditionGroupRow()
[781] Fix | Delete
{
[782] Fix | Delete
check_ajax_referer(SG_AJAX_NONCE, 'nonce_ajax');
[783] Fix | Delete
/**
[784] Fix | Delete
* We only allow administrator to do this action
[785] Fix | Delete
*/
[786] Fix | Delete
if ( ! current_user_can( 'manage_options' ) ) {
[787] Fix | Delete
wp_die(esc_html__('You do not have permission to do this action!', 'popup-builder'));
[788] Fix | Delete
}
[789] Fix | Delete
global $SGPB_DATA_CONFIG_ARRAY;
[790] Fix | Delete
[791] Fix | Delete
$groupId = isset($_POST['groupId']) ? (int)sanitize_text_field($_POST['groupId']) : '';
[792] Fix | Delete
$targetType = isset($_POST['conditionName']) ? sanitize_text_field($_POST['conditionName']) : '';
[793] Fix | Delete
$addedObj = array();
[794] Fix | Delete
[795] Fix | Delete
$builderObj = new ConditionBuilder();
[796] Fix | Delete
[797] Fix | Delete
$builderObj->setGroupId($groupId);
[798] Fix | Delete
$builderObj->setRuleId(SG_CONDITION_FIRST_RULE);
[799] Fix | Delete
$builderObj->setSavedData($SGPB_DATA_CONFIG_ARRAY[$targetType]['initialData'][0]);
[800] Fix | Delete
$builderObj->setConditionName($targetType);
[801] Fix | Delete
$addedObj[] = $builderObj;
[802] Fix | Delete
[803] Fix | Delete
$creator = new ConditionCreator($addedObj);
[804] Fix | Delete
echo wp_kses($creator->render(), AdminHelper::allowed_html_tags());
[805] Fix | Delete
wp_die();
[806] Fix | Delete
}
[807] Fix | Delete
[808] Fix | Delete
public function addConditionRuleRow()
[809] Fix | Delete
{
[810] Fix | Delete
check_ajax_referer(SG_AJAX_NONCE, 'nonce_ajax');
[811] Fix | Delete
/**
[812] Fix | Delete
* We only allow administrator to do this action
[813] Fix | Delete
*/
[814] Fix | Delete
if ( ! current_user_can( 'manage_options' ) ) {
[815] Fix | Delete
wp_die(esc_html__('You do not have permission to do this action!', 'popup-builder'));
[816] Fix | Delete
}
[817] Fix | Delete
$data = '';
[818] Fix | Delete
global $SGPB_DATA_CONFIG_ARRAY;
[819] Fix | Delete
$targetType = isset($_POST['conditionName']) ? sanitize_text_field($_POST['conditionName']) : '';
[820] Fix | Delete
$builderObj = new ConditionBuilder();
[821] Fix | Delete
[822] Fix | Delete
$groupId = isset($_POST['groupId']) ? (int)sanitize_text_field($_POST['groupId']) : '';
[823] Fix | Delete
$ruleId = isset($_POST['ruleId']) ? (int)sanitize_text_field($_POST['ruleId']) : '';
[824] Fix | Delete
[825] Fix | Delete
$builderObj->setGroupId($groupId);
[826] Fix | Delete
$builderObj->setRuleId($ruleId);
[827] Fix | Delete
$builderObj->setSavedData($SGPB_DATA_CONFIG_ARRAY[$targetType]['initialData'][0]);
[828] Fix | Delete
$builderObj->setConditionName($targetType);
[829] Fix | Delete
[830] Fix | Delete
$data .= ConditionCreator::createConditionRuleRow($builderObj);
[831] Fix | Delete
[832] Fix | Delete
echo wp_kses($data, AdminHelper::allowed_html_tags());
[833] Fix | Delete
wp_die();
[834] Fix | Delete
}
[835] Fix | Delete
[836] Fix | Delete
public function changeConditionRuleRow()
[837] Fix | Delete
{
[838] Fix | Delete
check_ajax_referer(SG_AJAX_NONCE, 'nonce_ajax');
[839] Fix | Delete
/**
[840] Fix | Delete
* We only allow administrator to do this action
[841] Fix | Delete
*/
[842] Fix | Delete
if ( ! current_user_can( 'manage_options' ) ) {
[843] Fix | Delete
wp_die(esc_html__('You do not have permission to do this action!', 'popup-builder'));
[844] Fix | Delete
}
[845] Fix | Delete
$data = '';
[846] Fix | Delete
global $SGPB_DATA_CONFIG_ARRAY;
[847] Fix | Delete
[848] Fix | Delete
$targetType = isset($_POST['conditionName']) ? sanitize_text_field($_POST['conditionName']) : '';
[849] Fix | Delete
$builderObj = new ConditionBuilder();
[850] Fix | Delete
$conditionConfig = $SGPB_DATA_CONFIG_ARRAY[$targetType];
[851] Fix | Delete
$groupId = isset($_POST['groupId']) ? (int)sanitize_text_field($_POST['groupId']) : '';
[852] Fix | Delete
$ruleId = isset($_POST['ruleId']) ? (int)sanitize_text_field($_POST['ruleId']) : '';
[853] Fix | Delete
$popupId = isset($_POST['popupId']) ? (int)sanitize_text_field($_POST['popupId']) : '';
[854] Fix | Delete
$paramName = isset($_POST['paramName']) ? sanitize_text_field($_POST['paramName']) : '';
[855] Fix | Delete
[856] Fix | Delete
$savedData = array(
[857] Fix | Delete
'param' => $paramName
[858] Fix | Delete
);
[859] Fix | Delete
[860] Fix | Delete
if($targetType == 'target' || $targetType == 'conditions') {
[861] Fix | Delete
$savedData['operator'] = '==';
[862] Fix | Delete
} else if($conditionConfig['specialDefaultOperator']) {
[863] Fix | Delete
$savedData['operator'] = $paramName;
[864] Fix | Delete
}
[865] Fix | Delete
[866] Fix | Delete
if(!empty($_POST['paramValue'])) {
[867] Fix | Delete
$savedData['tempParam'] = sanitize_text_field($_POST['paramValue']);
[868] Fix | Delete
$savedData['operator'] = $paramName;
[869] Fix | Delete
}
[870] Fix | Delete
// change operator value related to condition value
[871] Fix | Delete
if(!empty($conditionConfig['operatorAllowInConditions']) && in_array($paramName, $conditionConfig['operatorAllowInConditions'])) {
[872] Fix | Delete
$conditionConfig['paramsData']['operator'] = array();
[873] Fix | Delete
[874] Fix | Delete
if(!empty($conditionConfig['paramsData'][$paramName.'Operator'])) {
[875] Fix | Delete
$operatorData = $conditionConfig['paramsData'][$paramName.'Operator'];
[876] Fix | Delete
$SGPB_DATA_CONFIG_ARRAY[$targetType]['paramsData']['operator'] = $operatorData;
[877] Fix | Delete
// change take value related to condition value
[878] Fix | Delete
$operatorDataKeys = array_keys($operatorData);
[879] Fix | Delete
if(!empty($operatorDataKeys[0])) {
[880] Fix | Delete
$savedData['operator'] = $operatorDataKeys[0];
[881] Fix | Delete
$builderObj->setTakeValueFrom('operator');
[882] Fix | Delete
}
[883] Fix | Delete
}
[884] Fix | Delete
}
[885] Fix | Delete
// by default set empty value for users' role (adv. tar.)
[886] Fix | Delete
$savedData['value'] = array();
[887] Fix | Delete
$savedData['hiddenOption'] = isset($conditionConfig['hiddenOptionData'][$paramName]) ? $conditionConfig['hiddenOptionData'][$paramName] : '';
[888] Fix | Delete
[889] Fix | Delete
$builderObj->setPopupId($popupId);
[890] Fix | Delete
$builderObj->setGroupId($groupId);
[891] Fix | Delete
$builderObj->setRuleId($ruleId);
[892] Fix | Delete
$builderObj->setSavedData($savedData);
[893] Fix | Delete
$builderObj->setConditionName($targetType);
[894] Fix | Delete
[895] Fix | Delete
$data .= ConditionCreator::createConditionRuleRow($builderObj);
[896] Fix | Delete
[897] Fix | Delete
echo wp_kses($data, AdminHelper::allowed_html_tags());
[898] Fix | Delete
wp_die();
[899] Fix | Delete
}
[900] Fix | Delete
}
[901] Fix | Delete
[902] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function