Skip to content

Standardize hook callbacks #63

@jakewrfoster

Description

@jakewrfoster

Description

the vip search adapter uses a filter__* namespacing for filter callbacks, but the SearchPress adapter uses a different approach that names the callbacks according to their purpose (rather than naming according to the hook that they hook into).

For readability, maintainability, and consistency across adapters these hooks and callbacks should be standardized. I would propose that the callbacks use the filter__* namespacing convention for filter callbacks, but within the callbacks there are only function calls and minimal logic (opposed to all of the logic for each feature that uses the hook). By abstracting the feature functionality from the callbacks, we get the best of both worlds: we get the connective clarity offered by the filter__*/action__* convention, and we get the functional clarity offered by the approach that the SearchPress adapter is currently taking.

Use Case

When a developer is building a new feature that exists across adapters, the approach to using hooks should be consistent between the adapters.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestphpRequires understanding PHP

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions