Hi @iron13 ,
I’m glad to hear you are enjoying the plugin! Thanks for your suggestion and providing a screenshot to help. An all-in-one form is interesting.
There would be a few things I would need to consider and I have a few other ideas/suggestions to work through before I look at this however I have added it to my list of things to investigate!
Kind regards,
Mike
Thread Starter
iron13
(@iron13)
Hi Mike, is there a ‘hook script’ or something similar to achieve this result in the meantime? I look forward to your response and thank you for your quick reply.”
Hi @iron13,
At the moment there are no hooks or actions that can be used to achieve this layout since it requires some code changes to get working. As I have no finished my major admin pages update I will now be able to look into how to implement this (and making recurring default) so keep an eye out for updates in the near future.
Please feel free to get in touch with any other questions or comments.
Kind regards,
Mike
Thread Starter
iron13
(@iron13)
Hey Mike,
I’m looking for a way to modify the second choice screen. Since we want to focus on recruiting recurring donors, we’d like to set “Continuous” as the (only) default option, without offering choices like 1 year, 2 years, up to 10 years.
Is there a way to adjust that as a default option via a script?
Hi @iron13,
At the moment there is no official way to change these values. I am planning to change how this all works soon, but that could take a bit of time since I am already working on other features that will affect how this works in the future. For the time being I have created a quick patch to allow the use of a filter for modifying the duration. Since I will almost certainly change how this works I don’t want to make it official so I have uploaded it to my cloud storage for you to download. It has the same version number as the current version.
You can download it here: https://nextcloud.iseard.media/s/cisX9NrYwx9SMS9
The filter I added to it can be used by adding this code to your theme’s functions.php file:
add_filter(
'wp_head',
function () {
?>
<script>
window.addEventListener('load', function () {
wp.hooks.addFilter(
'kudosFormDuration',
'kudos-donations/modify-duration',
function (duration) {
return [duration[0]];
}
);
});
</script>
<?php
}
);
Doing this will restrict the duration option to only “Continuous”.
Let me know how it goes!
Mike
Hi @iron13,
Did you manage to try my solution? I am curious if it worked for you.
Kind regards,
Mike