Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions app/Form/Listeners/BaseHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,20 @@ public function __construct()
protected function setData()
{
$this->nonce = sanitize_text_field($_POST['nonce']);
$data = [];
$this->data = [];
foreach( $_POST as $key => $value ){
$data[$key] = $value;
if ( $key == 'jsondata' ) {
$jsondata = @json_decode( wp_unslash($value), true );
if ( json_last_error() == JSON_ERROR_NONE ) {
foreach ( $jsondata as $json_key => &$json_value) {
$this->data[$json_key] = $json_value;
}
unset($jsonvalue);
}
} else {
$this->data[$key] = $value;
}
}
$this->data = $data;
}

/**
Expand Down Expand Up @@ -165,4 +174,4 @@ protected function redirect()
{
wp_safe_redirect($this->url);
}
}
}
4 changes: 2 additions & 2 deletions assets/js/lib/nestedpages.nesting.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ NestedPages.Nesting = function()
data: {
action : NestedPages.formActions.syncNesting,
nonce : NestedPages.jsData.nonce,
list : list,
jsondata: JSON.stringify({list : list }),
post_type : NestedPages.jsData.posttype,
syncmenu : syncmenu,
filtered : filtered
Expand Down Expand Up @@ -166,4 +166,4 @@ NestedPages.Nesting = function()
return currentItem;
}
}
}
}
2 changes: 1 addition & 1 deletion assets/js/nestedpages.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/js/nestedpages.min.js

Large diffs are not rendered by default.