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 2 arguments in "badgeos_submission_form_language" filter #717

Conversation

ckaklamanos
Copy link

Add 2 arguments in "badgeos_submission_form_language" filter: "$achievement_id" and "$user_ID"

@ckaklamanos
Copy link
Author

Hello.

This is an issue that is not resolved yet.

Although you have added the 2 arguments in the filter, they are being added after the filter declaration. Therefore, it is impossible to override them with the filter.

Please look at

badgeos-nomination-submission-add-on/includes/submission-actions.php, Line 1771.

// Available filter for changing the language
$defaults = apply_filters( 'badgeos_submission_form_language', $defaults );

// Patch in our achievement and user IDs
$defaults['achievement_id'] = isset( $args["achievement_id"] ) ? absint( $args["achievement_id"] ) : "";
$defaults['user_id']        = $user_ID;

The line

$defaults = apply_filters( 'badgeos_submission_form_language', $defaults );

Should go after the "achivement_id" and "user_id" declaration, so that a developer will be able to override them.

This is a hack I always do when I update your plugin, otherwise, my customizations will not work.

Thanks for re-considering it.

PS: Is there s Github repo for this plugin, so that I can provide a Pull Request? Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants