major issue with posts and user roles after upgrading to 3.5.1 (2 posts)

  1. sdawson26
    Posted 3 years ago #

    This is a really strange situation and I don't know how to retrace my steps. I've already disabled a crap load of plugins.

    First of all, this is a wordpress multisite.

    I have one big problem that is creating 3 issues:

    1) When I'm looking at a post in the subdomain and i click "edit post" in the admin toolbar, the link is pointing to the www. instead of the subdomain, and since that post does not exist on the master site, it tells me the post has been deleted or does not exist (until i put the subdomain in place of the www. in the link).

    2) I can't say "is_admin" or "is_user_logged_in" because it will always come back false, regardless of whether I'm logged in or not. Therefore, I cannot use edit post links.

    3) All posts, whether private, password protected, draft, in review, etc.. show up as public and will not disappear unless I permanently delete them.

    Please help! Any advice would be greatly appreciated.

  2. sdawson26
    Posted 3 years ago #

    Problem is still not solved, but I hacked it by doing a global check for a user_login. If that variable comes up empty, the edit link will not show.

    global $current_user;
    	$admincheck = $current_user->user_login;
    	$editlink = '';
    	if($admincheck != ''){
    		$editlink = '<a href="https://sub.site.com/wp-admin/post.php?post=' . $postid . '&action=edit" class="post-edit-link" target="_blank">Edit This</a>';

Topic Closed

This topic has been closed to new replies.

About this Topic