-
Notifications
You must be signed in to change notification settings - Fork 64
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
Missing "$achievement_id" and "$user_id" arguments in "badgeos_submission_form_language" filter #716
Comments
Here is the Pull Request for the above enhancement. |
Hi @ckaklamanos We will surely update the mentioned filter in our next update. |
Hello @the-wooninjas Thanks for letting me know. |
Hello. I have seen that you added the above arguments in the recent plugin updates. However, it seems that they have been added to the wrong position and still, those arguments cannot be "caught" by the filter. Here is what I mean: In the new plugin called "badgeos-nomination-submission-add-on" (https://wordpress.org/plugins/badgeos-nomination-submission-add-on/), in the following position: File: badgeos-nomination-submission-add-on/includes/submission-actions.php You have added the following code:
The problem is that the above code comes after the "badgeos_submission_form_language" filter, therefore it is useless. In order for the above code to be functional, it should be moved before the Line 1747, in other words before:
In this way, we will be able to make use of the new filter arguments. Please let me know if the above is clear. Is there a Github repository for this new plugin in order to create a Pull Request? Thanks in advance. |
In our implementation of BadgeOS, we need to customize the language strings of submission forms, depending on the achievement context.
For example, if our submission is about submitting a "project", we want the submission button value to be "Send project". Or, another example, if our submission is about submitting a specific "thing", we want the submission button value to be "Send your thing".
In order to achieve the above, I propose a simple enhancement that adds the passes $achievement_id and $user_id as arguments to the corresponding filter.
This filter is located here:
badgeos/includes/submission-actions.php
Line 1483 in 0e5b22d
I propose replacing:
$defaults = apply_filters( 'badgeos_submission_form_language', $defaults );
With:
$defaults = apply_filters( 'badgeos_submission_form_language', $defaults , $achievement_id , $user_id );
I will create a pull request very soon.
The text was updated successfully, but these errors were encountered: