Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add short-circuit hook in GP_Original::closest_original #1204

Closed
gedex opened this issue Nov 11, 2020 · 0 comments · Fixed by #1207
Closed

Add short-circuit hook in GP_Original::closest_original #1204

gedex opened this issue Nov 11, 2020 · 0 comments · Fixed by #1207
Labels
[Type] Enhancement A suggestion for improvement.
Milestone

Comments

@gedex
Copy link
Contributor

gedex commented Nov 11, 2020

This would allow us to swap string similarity algorithm. The hook can be placed early in the closes_original()

https://github.com/GlotPress/GlotPress-WP/blob/6d86cc2c37515a482633220b1501bd588fefd43c/gp-includes/things/original.php#L397-L401

with something like:

$pre = apply_filters( 'pre_gp_original_closest_original'false$input, $other_strings ); 
if ( false !== $pre ) {
    return $pre;
}
gedex added a commit to gedex/GlotPress-WP that referenced this issue Nov 24, 2020
@ocean90 ocean90 added the [Type] Enhancement A suggestion for improvement. label Nov 25, 2020
@ocean90 ocean90 added this to the 3.0 milestone Nov 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants