| @@ -3,9 +3,9 @@ | ||
| 3 | 3 | * The [give_form] Shortcode Generator class |
| 4 | 4 | * |
| 5 | 5 | * @package Give |
| 6 | 6 | * @subpackage Admin |
| 7 | - * @copyright Copyright (c) 2016, WordImpress | |
| 7 | + * @copyright Copyright (c) 2016, GiveWP | |
| 8 | 8 | * @license https://opensource.org/licenses/gpl-license GNU Public License |
| 9 | 9 | * @since 1.3.0 |
| 10 | 10 | */ |
| 11 | 11 | |
| @@ -32,16 +32,18 @@ | ||
| 32 | 32 | |
| 33 | 33 | /** |
| 34 | 34 | * Define the shortcode attribute fields |
| 35 | 35 | * |
| 36 | - * @return array | |
| 36 | + * @since 4.0.0 Replace "new form" with "new campaign form" link | |
| 37 | + * | |
| 38 | + * @return array | |
| 37 | 39 | */ |
| 38 | 40 | public function define_fields() { |
| 39 | 41 | |
| 40 | 42 | $create_form_link = sprintf( |
| 41 | - /* translators: %s: create new form URL */ | |
| 42 | - __( '<a href="%s">Create</a> a new Donation Form.', 'give' ), | |
| 43 | - admin_url( 'post-new.php?post_type=give_forms' ) | |
| 43 | + /* translators: %s: create new form URL */ | |
| 44 | + __('<a href="%s">Create</a> a new Campaign Form.', 'give'), | |
| 45 | + admin_url('edit.php?post_type=give_forms&page=give-campaigns&new=campaign') | |
| 44 | 46 | ); |
| 45 | 47 | |
| 46 | 48 | return array( |
| 47 | 49 | array( |
| @@ -50,12 +52,13 @@ | ||
| 50 | 52 | 'post_type' => 'give_forms', |
| 51 | 53 | ), |
| 52 | 54 | 'name' => 'id', |
| 53 | 55 | 'tooltip' => esc_attr__( 'Select a Donation Form', 'give' ), |
| 54 | - 'placeholder' => '- ' . esc_attr__( 'Select a Donation Form', 'give' ) . ' -', | |
| 56 | + 'placeholder' => '- ' . esc_attr__('Select a Campaign Form', 'give') . ' -', | |
| 55 | 57 | 'required' => array( |
| 56 | - 'alert' => esc_html__( 'You must first select a Form!', 'give' ), | |
| 57 | - 'error' => sprintf( '<p class="strong">%s</p><p class="no-margin">%s</p>', esc_html__( 'No forms found.', 'give' ), $create_form_link ), | |
| 58 | + 'alert' => esc_html__('You must first select a Campaign Form!', 'give'), | |
| 59 | + 'error' => sprintf('<p class="strong">%s</p><p class="no-margin">%s</p>', | |
| 60 | + esc_html__('No campaign forms found.', 'give'), $create_form_link), | |
| 58 | 61 | ), |
| 59 | 62 | ), |
| 60 | 63 | array( |
| 61 | 64 | 'type' => 'container', |
| @@ -112,9 +115,19 @@ | ||
| 112 | 115 | 'name' => 'continue_button_title', |
| 113 | 116 | 'label' => esc_attr__( 'Button Text', 'give' ), |
| 114 | 117 | 'tooltip' => esc_attr__( 'The button label for displaying the additional payment fields.', 'give' ), |
| 115 | 118 | ), |
| 119 | + array( | |
| 120 | + 'type' => 'docs_link', | |
| 121 | + 'text' => esc_html__( 'Learn more about the Donation Form Shortcode', 'give' ), | |
| 122 | + 'link' => 'http://docs.givewp.com/shortcode-give-forms', | |
| 123 | + ), | |
| 116 | 124 | ); |
| 117 | 125 | } |
| 118 | 126 | } |
| 119 | 127 | |
| 120 | -new Give_Shortcode_Donation_Form(); | |
| 128 | +/** | |
| 129 | + * @since 4.3.0 use init action | |
| 130 | + */ | |
| 131 | +add_action( 'init', static function () { | |
| 132 | + new Give_Shortcode_Donation_Form(); | |
| 133 | +}); | |