user_has_cap filter allows edit but will not allow save

I’ve been struggling with the same problem…when args[0] is publish, args[2] is not populated. You have to get it from the url.

if(substr($args[0],0,7)=="publish"){
    $postid=$_GET["post"];
    if(!isset($postid))return $allcaps;
}
else $postid=$args[2];

Leave a Comment