0

need to customise a plugin function but would rather not edit the plugin itself so updates wont remove the custom changes.

function iss in a class called UserAccessManager and the function is;

public function showGroupMembership($link, $postId)
{
    $uamAccessHandler = &$this->getAccessHandler();
    $groups = $uamAccessHandler->getUserGroupsForObject('post', $postId);

    if (count($groups) > 0) {
        $link .= ' | '.TXT_UAM_ASSIGNED_GROUPS.': ';

        foreach ($groups as $group) {
            $link .= $group->getGroupName().', ';
        }

        $link = rtrim($link, ', ');
    }

    return $link;
}

is this possible? OR can i affect it with a filter?

Any help appreciated! Dc.

2
  • Exactly what you want to edit in this code?
    – Mamaduka
    Aug 23, 2011 at 16:33
  • wanted it to stop adding the text to my edit the post output which it laches onto...
    – v3nt
    Aug 23, 2011 at 16:55

1 Answer 1

0

I'm afraid you cannot alter the output of this function unless you directly modify the plugin code. The plugin author hasn't given you any filter to use.

So what can you do about it?

  1. Continue to alter the plugin file and update each time the plugin updates.
  2. Ask the plugin author nicely to add a filter to this function.
  3. Make a fork of the plugin.
1
  • ah - ok well thanks for your input. Will make a fork of it...
    – v3nt
    Aug 23, 2011 at 16:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.