Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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.

share|improve this question
    
Exactly what you want to edit in this code? –  Mamaduka Aug 23 '11 at 16:33
    
wanted it to stop adding the text to my edit the post output which it laches onto... –  daniel Crabbe Aug 23 '11 at 16:55
add comment

1 Answer

up vote 0 down vote accepted

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.
share|improve this answer
    
ah - ok well thanks for your input. Will make a fork of it... –  daniel Crabbe Aug 23 '11 at 16:56
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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