WordPress.org

Forums

User Access Manager
Suggestion, filter to hardcoded output after edit post links (2 posts)

  1. Jonas Lundman
    Member
    Posted 1 year ago #

    Hi, We have trouble to get the responsive design to fall in place.

    in class/UserAccessManager.class.php. the filter to edit post link adds " | " hardcoded.

    WP default let ya use like:

    edit_post_link( __( 'Edit', 'twentytwelve' ), '<span>|</span>', '' );

    ...or whatever devided / char you want/ or none. I suggest a similar filter would be added in UAM:s function.

    http://wordpress.org/extend/plugins/user-access-manager/

  2. Jonas Lundman
    Member
    Posted 1 year ago #

    This works fine, should be coded in to core: line 1812
    Template output functions fexibility!

    /**
         * The function for the edit_post_link filter.
         *
         * @param string  $sLink   The edit link.
         * @param integer $iPostId The _iId of the post.
         *
         * @return string / filters 4 args : (1)string, (2)groups only, (3)uam textstring, (4)original editlink
         */
        public function showGroupMembership($sLink, $iPostId)
        {
            $oUamAccessHandler = $this->getAccessHandler();
            $aGroups = $oUamAccessHandler->getUserGroupsForObject('post', $iPostId);
            $groups = '';
            if (count($aGroups) > 0) {
                foreach ($aGroups as $oGroup) {
                    $groups .= $oGroup->getGroupName().', ';
                }
                $groups = rtrim($groups, ', ');
            }
    
            return apply_filters('showGroupMembershipEditlink', $sLink.' | '.TXT_UAM_ASSIGNED_GROUPS.': '.$groups, $groups, TXT_UAM_ASSIGNED_GROUPS, $sLink);
        }

    And this example rebuild the original output:

    function ua_showGroupMembershipEditlink($uamLink, $groups, $txt, $editlink){
    	return $editlink.'<span>|</span>'.$txt.': '.$groups;
      }
      add_filter('showGroupMembershipEditlink', ua_showGroupMembershipEditlink, 10, 4);

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • User Access Manager
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.