'parent', 'id' => 'term_id'); function start_lvl(&$output, $depth, $args) { $output .= "
Options have been updated successfully.'; echo 'Close
';
foreach ($arrpostids as $ap) {
if ($preserve) {
$res = wp_get_object_terms($ap, 'category', array('fields'=>'ids'));
$res = array_unique(array_merge($res, $arrids));
$pdata = array('ID'=>$ap, 'post_category'=>$res);
} else {
$pdata = array('ID'=>$ap, 'post_category'=>$arrids);
}
if (is_numeric(wp_update_post($pdata))) $suc .= $ap . ", ";
else $fai .= $ap . ", ";
}
if (strlen($suc) > 0) echo "Categories have been successfully for the posts: " . substr($suc, 0, strlen($suc)-2) . "
";
if (strlen($fai) > 0) echo "Categories have NOT been applied for the posts: " . substr($fai, 0, strlen($fai)-2);
echo '';
echo '