public static function SaveCustomFields($postId)
{
global $flag;
if ($flag == 0) {
//with this the save_post action don't will be execute twice
$flag = 1;
//security
if (!wp_verify_nonce(@$_REQUEST['rc-custom-write-panel-verify-key'], 'rc-custom-write-panel')) {
return $postId;
}
//the user can edit posts?
if (!(current_user_can('edit_posts', $postId) || current_user_can('edit_published_pages', $postId))) {
return $postId;
}
RCCWP_Post::SetCustomWritePanel($postId);
RCCWP_Post::PrepareFieldsValues($postId);
RCCWP_Post::SetMetaValues($postId);
return $postId;
}
}