Forum Replies Created

Viewing 7 replies - 1 through 7 (of 7 total)
  • The information I gave was only for the function named:
    function edit_post_link()

    Not the function following for comments. I’m not exactly sure what the problem is there, probably a problem in the WordPress control panel. Maybe you need to select an option under the tab OPTIONS. Then there is a subtab called DISCUSSION. And under the option ‘Before a comment appears:’

    You can get the edit buttons to disappear by making the following edits to “template-functions-links.php” in “wp-includes”:
    Locate the function “edit_post_link”. Replace the whole thing with this:

    function edit_post_link($link = ‘Edit This’, $before = ”, $after = ”) {
    global $user_level,$post,$user_login;

    get_currentuserinfo();

    if ($user_level > 0) {
    $authordata = get_userdata($post->post_author);
    if ($user_level <= $authordata->user_level && $user_login != $authordata->user_login) {
    return;
    }
    } else {
    return;
    }

    $location = get_settings(‘siteurl’) . “/wp-admin/post.php?action=edit&post=$post->ID”;
    echo “$before $link $after”;
    }

    This makes it so that only the person who posted the post can edit their post, unless your a higher level. E.g. Admin see’s ‘Edit This’ for all posts, but level 1 user only see’s ‘Edit This’ for their own posts and level 2 users can see ‘Edit This’ for their own posts as well as all level 1 user’s posts.

    Oh, and this is secure. If you change the link, it won’t let you edit the post unless you’re logged in as the user.

    You can get the edit buttons to disappear by making the following edits to “template-functions-links.php” in “wp-includes”:
    Locate the function “edit_post_link”. Replace the whole thing with this:

    function edit_post_link($link = ‘Edit This’, $before = ”, $after = ”) {
    global $user_level,$post,$user_login;

    get_currentuserinfo();

    if ($user_level > 0) {
    $authordata = get_userdata($post->post_author);
    if ($user_level <= $authordata->user_level && $user_login != $authordata->user_login) {
    return;
    }
    } else {
    return;
    }

    $location = get_settings(‘siteurl’) . “/wp-admin/post.php?action=edit&post=$post->ID”;
    echo “$before $link $after”;
    }

    This makes it so that only the person who posted the post can edit their post, unless your a higher level. E.g. Admin see’s ‘Edit This’ for all posts, but level 1 user only see’s ‘Edit This’ for their own posts and level 2 users can see ‘Edit This’ for their own posts as well as all level 1 user’s posts.

    Oh, and this is secure. If you change the link, it won’t let you edit the post unless you’re logged in as the user.

    You can get the edit buttons to disappear by making the following edits to “template-functions-links.php” in “wp-includes”:
    Locate the function “edit_post_link”. Replace the whole thing with this:

    function edit_post_link($link = ‘Edit This’, $before = ”, $after = ”) {
    global $user_level,$post,$user_login;

    get_currentuserinfo();

    if ($user_level > 0) {
    $authordata = get_userdata($post->post_author);
    if ($user_level <= $authordata->user_level && $user_login != $authordata->user_login) {
    return;
    }
    } else {
    return;
    }

    $location = get_settings(‘siteurl’) . “/wp-admin/post.php?action=edit&post=$post->ID”;
    echo “$before $link $after”;
    }

    This makes it so that only the person who posted the post can edit their post, unless your a higher level. E.g. Admin see’s ‘Edit This’ for all posts, but level 1 user only see’s ‘Edit This’ for their own posts and level 2 users can see ‘Edit This’ for their own posts as well as all level 1 user’s posts.

    Oh, and this is secure. If you change the link, it won’t let you edit the post unless you’re logged in as the user.

    You can get the edit buttons to disappear too by making the following edits to “template-functions-links.php” in “wp-includes”:
    Locate the function “edit_post_link”. Replace the whole thing with this:

    function edit_post_link($link = ‘Edit This’, $before = ”, $after = ”) {
    global $user_level,$post,$user_login;

    get_currentuserinfo();

    if ($user_level > 0) {
    $authordata = get_userdata($post->post_author);
    if ($user_level <= $authordata->user_level && $user_login != $authordata->user_login) {
    return;
    }
    } else {
    return;
    }

    $location = get_settings(‘siteurl’) . “/wp-admin/post.php?action=edit&post=$post->ID”;
    echo “$before $link $after”;
    }

    This makes it so that only the person who posted the post can edit their post, unless your a higher level. E.g. Admin see’s ‘Edit This’ for all posts, but level 1 user only see’s ‘Edit This’ for their own posts and level 2 users can see ‘Edit This’ for their own posts as well as all level 1 user’s posts. This is different from the code above but, and I believe works better. I really want to thank whoever posted that above because it really helped me to set this up.

    Oh, and this is secure. If you change the link, it won’t let you edit the post unless you’re logged in as the user.

    I have to agree with dherren. You do not implement multiple user levels and let them edit the same level. The levels below them, yes, but not the same level. That doesn’t make sense. The article listed above is very helpful, and just a side point. If you were really meant to be able to edit anyone’s post that is of the same level, why can’t you edit it(another users post while you are same level) in the WordPress panel, but you can on the mainpage. Its not consistent.

    I’m having the same problem

Viewing 7 replies - 1 through 7 (of 7 total)