Problem/Motivation

When implementing hook_plugin(), function does not receive any parameter, so it's difficult to perform operations based on the plugin definition.
In my case, I want to centralize the plugin definition in a single hook instead of implementing a different hook per plugin. It is impossible, given that I can't determine which plugin is being executed each time.

Proposed resolution

Pass an extra parameter to hook_plugin(), including the plugin info array.

Remaining tasks

Patch
Approve

User interface changes

None

API changes

hook_plugin() will receive an extra parameter, including the full plugin info array.

CommentFileSizeAuthor
#1 hook_info-2396171-1.patch447 bytesplopesc

Comments

plopesc’s picture

Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new447 bytes

Attaching patch.

I think it is a simple one and will help developers implementing these hooks.

Regards

plopesc’s picture

Title: Pass Plugin info array plugin hook implementation » Pass Plugin info array to hook_plugin() implementations
e0ipso’s picture

Status: Needs review » Reviewed & tested by the community

+1 on getting this in.

mrjmd’s picture

japerry’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: +SprintWeekend2015

Thats fine, shouldn't cause any regressions. (didn't for me) Fixed.

  • japerry committed c00a139 on 7.x-1.x authored by plopesc
    Issue #2396171 by plopesc: Pass Plugin info array to hook_plugin()...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.