Forum Replies Created

Viewing 106 replies (of 106 total)
  • Texiwill

    (@texiwill)

    I made two changes to make coauthors plus work for ‘pages’ as well as ‘posts’…

    In ‘add_coauthor_cap’ modify the first if statement to read:
    if(in_array(‘edit_page’,$args) || in_array(‘edit_post’, $args) || in_array(‘edit_others_posts’, $args) || in_array(‘edit_others_pages’, $args))

    Next since ‘current_user_can’ does not send a post_id add the following after the line “$post_id = $args[2]” to ensure you have a post id when appropriate.

    if (!isset($post_id)) {
    // current_user_can does not pass a post_id
    // but it is within the referer
    preg_match(“/&post=(.*)/”,$_SERVER[‘HTTP_REFERER’],$match);
    $post_id=$match[1];
    }

    Perhaps a kludgy way to do this but it does work with 2.9.2.

    –Edward

Viewing 106 replies (of 106 total)