Closed JDGrimes closed 8 years ago
I really like this idea, but I don't think that it is something that we should try to pursue in the initial version at this point. It is a nice feature, but it isn't absolutely necessary for the operation of the how-to-get-points shortcode.
Oh, and yes, it would kind of be nice to have this API in the initial version, just because it looses some of its potency if it isn't complete. But we might be migrating away from the hooks API and toward the possessions API in the future anyway, so perhaps we'll wait until then for this (though it would still be a useful feature in the hooks API as well as long as it stays around in some form).
Closing in favor of https://github.com/WordPoints/wordpoints/issues/465.
57 introduces an issue related to #51 that has been tucked away at the back of my mind for quite some time:
What I've been thinking is that we should build into the API a means of determining whether a particular entity would be a valid target for a particular reaction. That way we could just get the reactions that would apply to a specific user, like we need to do in the how-to-get-points shortcode.
We'd probably introduce a
can_target()
method or something like that to the extension class.Just to be clear, this is different than just checking that the entity is of a type supported by the reactor (although of course that is necessary), it involves, for example, checking that any conditions that apply to the target would match that particular user (e.g., they'd have to have a specific role, etc.).