# give/4.16.9/src/Promotions/InPluginUpsells/LegacyFormEditor.php

GiveWP – Donation Plugin and Fundraising Platform, version 4.16.9. 63 lines.

- Page: https://pluginprobe.com/plugins/give/4.16.9/code/src/Promotions/InPluginUpsells/LegacyFormEditor.php
- Raw: https://pluginprobe.com/plugins/give/4.16.9/raw/src/Promotions/InPluginUpsells/LegacyFormEditor.php
- Modified: 2025-03-31T19:17:16+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/give/4.16.9/code/src/Promotions/InPluginUpsells/LegacyFormEditor.php#L10-L20`.

```php
<?php

namespace Give\Promotions\InPluginUpsells;

use Give\Helpers\EnqueueScript;
use Give\Helpers\Utils;

class LegacyFormEditor
{

    /**
     * Load scripts
     *
     * @since 2.27.1
     */
    public function loadScripts()
    {
        $data = [
            'apiRoot' => esc_url_raw(rest_url('give-api/v2')),
            'apiNonce' => wp_create_nonce('wp_rest'),
        ];

        EnqueueScript::make(
            'give-in-plugin-upsells-legacy-form-editor',
            'build/assets/dist/js/donation-options.js'
        )
            ->loadInFooter()
            ->registerTranslations()
            ->registerLocalizeData('GiveLegacyFormEditor', $data)
            ->enqueue();
    }

    /**
     *
     * @since 2.27.1
     *
     */
    public function renderDonationOptionsRecurringRecommendation()
    {
        $isDismissed = get_option('givewp_form_editor_donation_options_recurring_recommendation', false);
        $recurringAddonIsActive = Utils::isPluginActive('give-recurring/give-recurring.php');

        if ($recurringAddonIsActive | $isDismissed) {
            return;
        }

        require_once GIVE_PLUGIN_DIR . 'src/Promotions/InPluginUpsells/resources/views/donation-options-form-editor.php';
    }

    /**
     * @since 3.2.1 replaced logic to be give_forms post_type specific
     * @since 2.27.1
     */
    public static function isShowing(): bool
    {
        global $post, $pagenow;

        return $post &&
            in_array($pagenow, ['post-new.php', 'post.php'], true) &&
            'give_forms' === get_post_type($post);
    }
}

```
