Skip to content

Commit

Permalink
Merge branch 'release/hot-fixes-embed-redirect-title-prefixes' into d…
Browse files Browse the repository at this point in the history
…evelop
  • Loading branch information
angelablake committed Nov 3, 2023
2 parents 1b2c573 + b20e3bb commit 13ccbfb
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 11 deletions.
4 changes: 2 additions & 2 deletions give.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Description: The most robust, flexible, and intuitive way to accept donations on WordPress.
* Author: GiveWP
* Author URI: https://givewp.com/
* Version: 3.1.0
* Version: 3.1.1
* Requires at least: 6.0
* Requires PHP: 7.2
* Text Domain: give
Expand Down Expand Up @@ -391,7 +391,7 @@ private function setup_constants()
{
// Plugin version.
if (!defined('GIVE_VERSION')) {
define('GIVE_VERSION', '3.1.0');
define('GIVE_VERSION', '3.1.1');
}

// Plugin Root File.
Expand Down
6 changes: 5 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Tags: donation, donate, recurring donations, fundraising, crowdfunding
Requires at least: 6.0
Tested up to: 6.4
Requires PHP: 7.2
Stable tag: 3.1.0
Stable tag: 3.1.1
License: GPLv3
License URI: http://www.gnu.org/licenses/gpl-3.0.html

Expand Down Expand Up @@ -262,6 +262,10 @@ The 2% fee on Stripe donations only applies to donations taken via our free Stri
10. Use almost any payment gateway integration with GiveWP through our add-ons or by creating your own add-on.

== Changelog ==
= 3.1.1: November 3rd, 2023 =
* Fix: Embedded forms created with the Visual Builder now redirect to the confirmation page after a completed donation.
* Fix: Donor title prefixes are now formatted as strings (like Mr or Ms) instead of numbers.

= 3.1.0: October 25th, 2023 =
* Feature: Design Mode changes in the Form Builder are now instant and awesome! Instant gratification!
* Feature: Donor prefixes can now easily be reordered in the Donor Name block
Expand Down
10 changes: 9 additions & 1 deletion src/DonationForms/Shortcodes/GiveFormShortcode.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,18 @@
class GiveFormShortcode
{
/**
* @var int $instance
*/
public static $instance = 0;

/**
* @since 3.1.1 use static instance ID to simulate blockId attribute
* @since 3.0.0
*/
public function __invoke(string $output, array $atts): string
{
self::$instance++;

$formId = absint($atts['id']);
$isV3Form = (bool) give()->form_meta->get_meta($formId, 'formBuilderSettings', true);

Expand All @@ -22,7 +30,7 @@ public function __invoke(string $output, array $atts): string
$controller = new BlockRenderController();
$blockAttributes = [
'formId' => $formId,
'blockId' => 'give-form-shortcode-' . uniqid(),
'blockId' => 'give-form-shortcode-' . self::$instance,
];

$output = $controller->render($blockAttributes);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,15 @@ export default function Edit({
}: BlockEditProps<any>) {

const [selectedTitle, setSelectedTitle] = useState<string>(Object.values(honorifics)[0] as string ?? '');
const [honorificOptions, setHonorificOptions] = useState<OptionProps[]>(Object.keys(honorifics).map((token) => {
return {
label: titleLabelTransform(token),
value: titleValueTransform(token),
checked: selectedTitle === token,
} as OptionProps;
}));
const [honorificOptions, setHonorificOptions] = useState<OptionProps[]>(
Object.values(honorifics).map((token: string) => {
return {
label: titleLabelTransform(token),
value: titleValueTransform(token),
checked: selectedTitle === token,
} as OptionProps;
})
);

const setOptions = (options: OptionProps[]) => {
setHonorificOptions(options);
Expand Down

0 comments on commit 13ccbfb

Please sign in to comment.