← All changes
|
includes/fields/default-fields/campaign-fields.php
+316
-237
1.6.8
→
1.8.13
View file →
| @@ -2,13 +2,13 @@ | ||
| 2 | 2 | /** |
| 3 | 3 | * Returns an array of all the default campaign fields. |
| 4 | 4 | * |
| 5 | 5 | * @package Charitable/Campaign Fields |
| 6 | - * @author Eric Daams | |
| 7 | - * @copyright Copyright (c) 2019, Studio 164a | |
| 6 | + * @author David Bisset | |
| 7 | + * @copyright Copyright (c) 2023, WP Charitable LLC | |
| 8 | 8 | * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License |
| 9 | 9 | * @since 1.6.0 |
| 10 | - * @version 1.6.0 | |
| 10 | + * @version 1.8.9.1 | |
| 11 | 11 | */ |
| 12 | 12 | |
| 13 | 13 | // Exit if accessed directly. |
| 14 | 14 | if ( ! defined( 'ABSPATH' ) ) { |
| @@ -25,256 +25,335 @@ | ||
| 25 | 25 | * @since 1.6.0 |
| 26 | 26 | * |
| 27 | 27 | * @param array $fields The multi-dimensional array of keys in $key => $args format. |
| 28 | 28 | */ |
| 29 | -return apply_filters( 'charitable_default_campaign_fields', array( | |
| 30 | - 'ID' => array( | |
| 31 | - 'label' => __( 'Campaign ID', 'charitable' ), | |
| 32 | - 'data_type' => 'core', | |
| 33 | - 'value_callback' => 'charitable_get_campaign_post_field', | |
| 34 | - 'admin_form' => false, | |
| 35 | - 'email_tag' => false, | |
| 36 | - 'show_in_export' => true, | |
| 37 | - ), | |
| 38 | - 'description' => array( | |
| 39 | - 'label' => __( 'Description', 'charitable' ), | |
| 40 | - 'data_type' => 'meta', | |
| 41 | - 'admin_form' => array( | |
| 42 | - 'section' => 'campaign-top', | |
| 43 | - 'type' => 'textarea', | |
| 44 | - 'view' => 'metaboxes/campaign-description', | |
| 45 | - 'priority' => 4, | |
| 29 | +return apply_filters( | |
| 30 | + 'charitable_default_campaign_fields', | |
| 31 | + array( | |
| 32 | + 'ID' => array( | |
| 33 | + 'label' => __( 'Campaign ID', 'charitable' ), | |
| 34 | + 'data_type' => 'core', | |
| 35 | + 'value_callback' => 'charitable_get_campaign_post_field', | |
| 36 | + 'admin_form' => false, | |
| 37 | + 'email_tag' => false, | |
| 38 | + 'show_in_export' => true, | |
| 46 | 39 | ), |
| 47 | - 'email_tag' => false, | |
| 48 | - 'show_in_export' => true, | |
| 49 | - ), | |
| 50 | - 'goal' => array( | |
| 51 | - 'label' => __( 'Goal', 'charitable' ), | |
| 52 | - 'data_type' => 'meta', | |
| 53 | - 'admin_form' => array( | |
| 54 | - 'section' => 'campaign-top', | |
| 55 | - 'type' => 'number', | |
| 56 | - 'view' => 'metaboxes/campaign-goal', | |
| 57 | - 'priority' => 6, | |
| 58 | - 'description' => __( 'Leave empty for campaigns without a fundraising goal.', 'charitable' ), | |
| 40 | + 'description' => array( | |
| 41 | + 'label' => __( 'Description', 'charitable' ), | |
| 42 | + 'data_type' => 'meta', | |
| 43 | + 'admin_form' => array( | |
| 44 | + 'section' => 'campaign-top', | |
| 45 | + 'type' => 'textarea', | |
| 46 | + 'view' => 'metaboxes/campaign-description', | |
| 47 | + 'priority' => 4, | |
| 48 | + ), | |
| 49 | + 'email_tag' => false, | |
| 50 | + 'show_in_export' => true, | |
| 59 | 51 | ), |
| 60 | - 'email_tag' => false, | |
| 61 | - 'show_in_export' => true, | |
| 62 | - ), | |
| 63 | - 'monetary_goal' => array( | |
| 64 | - 'label' => __( 'Goal ($)', 'charitable' ), | |
| 65 | - 'data_type' => 'core', | |
| 66 | - 'value_callback' => false, | |
| 67 | - 'admin_form' => false, | |
| 68 | - 'email_tag' => array( | |
| 69 | - 'tag' => 'campaign_goal', | |
| 70 | - 'description' => __( 'Display the campaign\'s fundraising goal', 'charitable' ), | |
| 71 | - 'preview' => '$15,000', | |
| 52 | + 'goal' => array( | |
| 53 | + 'label' => __( 'Goal', 'charitable' ), | |
| 54 | + 'data_type' => 'meta', | |
| 55 | + 'admin_form' => array( | |
| 56 | + 'section' => 'campaign-top', | |
| 57 | + 'type' => 'number', | |
| 58 | + 'view' => 'metaboxes/campaign-goal', | |
| 59 | + 'priority' => 6, | |
| 60 | + 'description' => __( 'Leave empty for campaigns without a fundraising goal.', 'charitable' ), | |
| 61 | + ), | |
| 62 | + 'email_tag' => false, | |
| 63 | + 'show_in_export' => true, | |
| 72 | 64 | ), |
| 73 | - 'show_in_export' => false, | |
| 74 | - ), | |
| 75 | - 'end_date' => array( | |
| 76 | - 'label' => __( 'End Date', 'charitable' ), | |
| 77 | - 'data_type' => 'meta', | |
| 78 | - 'admin_form' => array( | |
| 79 | - 'section' => 'campaign-top', | |
| 80 | - 'type' => 'date', | |
| 81 | - 'view' => 'metaboxes/campaign-end-date', | |
| 82 | - 'priority' => 8, | |
| 83 | - 'description' => __( 'Leave empty for ongoing campaigns.', 'charitable' ), | |
| 65 | + 'monetary_goal' => array( | |
| 66 | + 'label' => __( 'Goal ($)', 'charitable' ), | |
| 67 | + 'data_type' => 'core', | |
| 68 | + 'value_callback' => false, | |
| 69 | + 'admin_form' => false, | |
| 70 | + 'email_tag' => array( | |
| 71 | + 'tag' => 'campaign_goal', | |
| 72 | + 'description' => __( 'Display the campaign\'s fundraising goal', 'charitable' ), | |
| 73 | + 'preview' => '$15,000', | |
| 74 | + ), | |
| 75 | + 'show_in_export' => false, | |
| 84 | 76 | ), |
| 85 | - 'email_tag' => array( | |
| 86 | - 'tag' => 'campaign_end_date', | |
| 87 | - 'description' => __( 'The end date of the campaign', 'charitable' ), | |
| 88 | - 'preview' => date( get_option( 'date_format', 'd/m/Y' ) ), | |
| 77 | + 'end_date' => array( | |
| 78 | + 'label' => __( 'End Date', 'charitable' ), | |
| 79 | + 'data_type' => 'meta', | |
| 80 | + 'admin_form' => array( | |
| 81 | + 'section' => 'campaign-top', | |
| 82 | + 'type' => 'date', | |
| 83 | + 'view' => 'metaboxes/campaign-end-date', | |
| 84 | + 'priority' => 8, | |
| 85 | + 'description' => __( 'Leave empty for ongoing campaigns.', 'charitable' ), | |
| 86 | + ), | |
| 87 | + 'email_tag' => array( | |
| 88 | + 'tag' => 'campaign_end_date', | |
| 89 | + 'description' => __( 'The end date of the campaign', 'charitable' ), | |
| 90 | + 'preview' => date( get_option( 'date_format', 'd/m/Y' ) ), // phpcs:ignore WordPress.DateTime.RestrictedFunctions.date_date | |
| 91 | + ), | |
| 92 | + 'show_in_export' => true, | |
| 89 | 93 | ), |
| 90 | - 'show_in_export' => true, | |
| 91 | - ), | |
| 92 | - 'suggested_donations' => array( | |
| 93 | - 'label' => __( 'Suggested Donation Amounts', 'charitable' ), | |
| 94 | - 'data_type' => 'meta', | |
| 95 | - 'admin_form' => array( | |
| 96 | - 'section' => 'campaign-donation-options', | |
| 97 | - 'type' => 'array', | |
| 98 | - 'view' => 'metaboxes/campaign-donation-options/suggested-amounts', | |
| 99 | - 'priority' => 4, | |
| 94 | + 'end_time' => array( | |
| 95 | + 'label' => __( 'End Date Timestamp', 'charitable' ), | |
| 96 | + 'data_type' => 'core', | |
| 97 | + 'value_callback' => false, | |
| 98 | + 'donation_form' => false, | |
| 99 | + 'admin_form' => false, | |
| 100 | + 'email_tag' => false, | |
| 101 | + 'show_in_export' => false, | |
| 100 | 102 | ), |
| 101 | - 'email_tag' => false, | |
| 102 | - 'show_in_export' => false, | |
| 103 | - ), | |
| 104 | - 'allow_custom_donations' => array( | |
| 105 | - 'label' => __( 'Allow Custom Donations', 'charitable' ), | |
| 106 | - 'data_type' => 'meta', | |
| 107 | - 'admin_form' => array( | |
| 108 | - 'section' => 'campaign-donation-options', | |
| 109 | - 'type' => 'checkbox', | |
| 110 | - 'priority' => 6, | |
| 103 | + 'suggested_donations' => array( | |
| 104 | + 'label' => __( 'Suggested Donation Amounts', 'charitable' ), | |
| 105 | + 'data_type' => 'meta', | |
| 106 | + 'admin_form' => array( | |
| 107 | + 'section' => 'campaign-donation-options', | |
| 108 | + 'type' => 'array', | |
| 109 | + 'view' => 'metaboxes/campaign-donation-options/suggested-amounts', | |
| 110 | + 'priority' => 4, | |
| 111 | + ), | |
| 112 | + 'email_tag' => false, | |
| 113 | + 'show_in_export' => false, | |
| 111 | 114 | ), |
| 112 | - 'email_tag' => false, | |
| 113 | - 'show_in_export' => false, | |
| 114 | - ), | |
| 115 | - 'post_title' => array( | |
| 116 | - 'label' => __( 'Title', 'charitable' ), | |
| 117 | - 'data_type' => 'core', | |
| 118 | - 'value_callback' => 'charitable_get_campaign_post_field', | |
| 119 | - 'admin_form' => false, | |
| 120 | - 'email_tag' => array( | |
| 121 | - 'tag' => 'campaign_title', | |
| 122 | - 'description' => __( 'The title of the campaign', 'charitable' ), | |
| 123 | - 'preview' => __( 'Fake Campaign', 'charitable' ), | |
| 115 | + 'allow_custom_donations' => array( | |
| 116 | + 'label' => __( 'Allow Custom Donations', 'charitable' ), | |
| 117 | + 'data_type' => 'meta', | |
| 118 | + 'admin_form' => array( | |
| 119 | + 'section' => 'campaign-donation-options', | |
| 120 | + 'type' => 'checkbox', | |
| 121 | + 'priority' => 6, | |
| 122 | + ), | |
| 123 | + 'email_tag' => false, | |
| 124 | + 'show_in_export' => false, | |
| 124 | 125 | ), |
| 125 | - 'show_in_export' => true, | |
| 126 | - ), | |
| 127 | - 'post_date' => array( | |
| 128 | - 'label' => __( 'Date Created', 'charitable' ), | |
| 129 | - 'data_type' => 'core', | |
| 130 | - 'value_callback' => 'charitable_get_campaign_post_field', | |
| 131 | - 'admin_form' => false, | |
| 132 | - 'email_tag' => false, | |
| 133 | - 'show_in_export' => true, | |
| 134 | - ), | |
| 135 | - 'post_author' => array( | |
| 136 | - 'label' => __( 'Campaign Creator ID', 'charitable' ), | |
| 137 | - 'data_type' => 'core', | |
| 138 | - 'value_callback' => 'charitable_get_campaign_post_field', | |
| 139 | - 'admin_form' => array( | |
| 140 | - 'section' => 'campaign-creator', | |
| 141 | - 'type' => 'text', | |
| 142 | - 'view' => 'metaboxes/campaign-creator', | |
| 143 | - 'priority' => 2, | |
| 126 | + 'minimum_donation_amount' => array( | |
| 127 | + 'label' => __( 'Minimum Donation Amount', 'charitable' ), | |
| 128 | + 'data_type' => 'meta', | |
| 129 | + 'value_callback' => false, | |
| 130 | + 'admin_form' => array( | |
| 131 | + 'section' => 'campaign-donation-options', | |
| 132 | + 'type' => 'number', | |
| 133 | + 'title' => __( 'Minimum Donation Amount', 'charitable' ), | |
| 134 | + 'view' => 'metaboxes/campaign-minimum-donation-amount', | |
| 135 | + 'description' => __( 'Leave empty to allow no restrictions on how small the donation can be.', 'charitable' ), | |
| 136 | + 'priority' => 11, | |
| 137 | + ), | |
| 138 | + 'email_tag' => false, | |
| 139 | + 'show_in_export' => true, | |
| 144 | 140 | ), |
| 145 | - 'email_tag' => false, | |
| 146 | - 'show_in_export' => true, | |
| 147 | - ), | |
| 148 | - 'post_content' => array( | |
| 149 | - 'label' => __( 'Extended Description', 'charitable' ), | |
| 150 | - 'data_type' => 'core', | |
| 151 | - 'value_callback' => 'charitable_get_campaign_post_field', | |
| 152 | - 'admin_form' => array( | |
| 153 | - 'section' => 'campaign-extended-description', | |
| 154 | - 'type' => 'text', | |
| 155 | - 'view' => 'metaboxes/campaign-extended-description', | |
| 156 | - 'priority' => 2, | |
| 141 | + 'post_title' => array( | |
| 142 | + 'label' => __( 'Title', 'charitable' ), | |
| 143 | + 'data_type' => 'core', | |
| 144 | + 'value_callback' => 'charitable_get_campaign_post_field', | |
| 145 | + 'admin_form' => false, | |
| 146 | + 'email_tag' => array( | |
| 147 | + 'tag' => 'campaign_title', | |
| 148 | + 'description' => __( 'The title of the campaign', 'charitable' ), | |
| 149 | + 'preview' => __( 'Fake Campaign', 'charitable' ), | |
| 150 | + ), | |
| 151 | + 'show_in_export' => true, | |
| 157 | 152 | ), |
| 158 | - 'email_tag' => false, | |
| 159 | - 'show_in_export' => false, | |
| 160 | - ), | |
| 161 | - 'campaign_creator_name' => array( | |
| 162 | - 'label' => __( 'Campaign Creator', 'charitable' ), | |
| 163 | - 'data_type' => 'core', | |
| 164 | - 'value_callback' => false, | |
| 165 | - 'admin_form' => false, | |
| 166 | - 'email_tag' => array( | |
| 167 | - 'tag' => 'campaign_creator', | |
| 168 | - 'description' => __( 'The name of the campaign creator', 'charitable' ), | |
| 169 | - 'preview' => 'Harry Ferguson', | |
| 153 | + 'post_date' => array( | |
| 154 | + 'label' => __( 'Date Created', 'charitable' ), | |
| 155 | + 'data_type' => 'core', | |
| 156 | + 'value_callback' => 'charitable_get_campaign_post_field', | |
| 157 | + 'admin_form' => false, | |
| 158 | + 'email_tag' => false, | |
| 159 | + 'show_in_export' => true, | |
| 170 | 160 | ), |
| 171 | - 'show_in_export' => true, | |
| 172 | - ), | |
| 173 | - 'campaign_creator_email' => array( | |
| 174 | - 'label' => __( 'Campaign Creator Email', 'charitable' ), | |
| 175 | - 'data_type' => 'core', | |
| 176 | - 'value_callback' => false, | |
| 177 | - 'admin_form' => false, | |
| 178 | - 'email_tag' => array( | |
| 179 | - 'description' => __( 'The email address of the campaign creator', 'charitable' ), | |
| 180 | - 'preview' => '[email protected]', | |
| 161 | + 'timestamp' => array( | |
| 162 | + 'label' => __( 'Date Created as Timestamp', 'charitable' ), | |
| 163 | + 'data_type' => 'core', | |
| 164 | + 'value_callback' => 'charitable_get_campaign_date_as_timestamp', | |
| 165 | + 'donation_form' => false, | |
| 166 | + 'admin_form' => false, | |
| 167 | + 'show_in_export' => false, | |
| 168 | + 'email_tag' => false, | |
| 181 | 169 | ), |
| 182 | - 'show_in_export' => true, | |
| 183 | - ), | |
| 184 | - 'goal_achieved_message' => array( | |
| 185 | - 'label' => __( 'Achieved Goal?', 'charitable' ), | |
| 186 | - 'data_type' => 'core', | |
| 187 | - 'value_callback' => false, | |
| 188 | - 'admin_form' => false, | |
| 189 | - 'email_tag' => array( | |
| 190 | - 'tag' => 'campaign_achieved_goal', | |
| 191 | - 'description' => __( 'Display whether the campaign reached its goal. Add a `success` parameter as the message when the campaign was successful, and a `failure` parameter as the message when the campaign is not successful', 'charitable' ), | |
| 192 | - 'preview' => __( 'The campaign achieved its fundraising goal.', 'charitable' ), | |
| 170 | + 'post_author' => array( | |
| 171 | + 'label' => __( 'Campaign Creator ID', 'charitable' ), | |
| 172 | + 'data_type' => 'core', | |
| 173 | + 'value_callback' => 'charitable_get_campaign_post_field', | |
| 174 | + 'admin_form' => array( | |
| 175 | + 'section' => 'campaign-creator', | |
| 176 | + 'type' => 'text', | |
| 177 | + 'view' => 'metaboxes/campaign-creator', | |
| 178 | + 'priority' => 2, | |
| 179 | + ), | |
| 180 | + 'email_tag' => false, | |
| 181 | + 'show_in_export' => true, | |
| 193 | 182 | ), |
| 194 | - 'show_in_export' => false, | |
| 195 | - ), | |
| 196 | - 'donated_amount' => array( | |
| 197 | - 'label' => __( 'Amount Donated', 'charitable' ), | |
| 198 | - 'data_type' => 'core', | |
| 199 | - 'value_callback' => false, | |
| 200 | - 'admin_form' => false, | |
| 201 | - 'email_tag' => false, | |
| 202 | - 'show_in_export' => true, | |
| 203 | - ), | |
| 204 | - 'donated_amount_formatted' => array( | |
| 205 | - 'label' => __( 'Amount Donated', 'charitable' ), | |
| 206 | - 'data_type' => 'core', | |
| 207 | - 'value_callback' => false, | |
| 208 | - 'admin_form' => false, | |
| 209 | - 'email_tag' => array( | |
| 210 | - 'tag' => 'campaign_donated_amount', | |
| 211 | - 'description' => __( 'Display the total amount donated to the campaign', 'charitable' ), | |
| 212 | - 'preview' => '$16,523', | |
| 183 | + 'post_content' => array( | |
| 184 | + 'label' => __( 'Extended Description', 'charitable' ), | |
| 185 | + 'data_type' => 'core', | |
| 186 | + 'value_callback' => 'charitable_get_campaign_post_field', | |
| 187 | + 'admin_form' => array( | |
| 188 | + 'section' => 'campaign-extended-description', | |
| 189 | + 'type' => 'text', | |
| 190 | + 'view' => 'metaboxes/campaign-extended-description', | |
| 191 | + 'priority' => 2, | |
| 192 | + ), | |
| 193 | + 'email_tag' => false, | |
| 194 | + 'show_in_export' => false, | |
| 213 | 195 | ), |
| 214 | - 'show_in_export' => false, | |
| 215 | - ), | |
| 216 | - 'percent_donated' => array( | |
| 217 | - 'label' => __( 'Percent Donated', 'charitable' ), | |
| 218 | - 'data_type' => 'core', | |
| 219 | - 'value_callback' => false, | |
| 220 | - 'admin_form' => false, | |
| 221 | - 'email_tag' => array( | |
| 222 | - 'tag' => 'campaign_percent_donated', | |
| 223 | - 'description' => __( 'Display the percentage donated to the campaign', 'charitable' ), | |
| 224 | - 'preview' => '34%', | |
| 196 | + 'page_settings' => array( | |
| 197 | + 'label' => __( 'Campaign Summary', 'charitable' ), | |
| 198 | + 'data_type' => 'core', | |
| 199 | + 'value_callback' => 'charitable_get_campaign_post_field', | |
| 200 | + 'admin_form' => array( | |
| 201 | + 'section' => 'campaign-page-settings', | |
| 202 | + 'type' => 'text', | |
| 203 | + 'view' => 'metaboxes/campaign-page-settings', | |
| 204 | + 'priority' => 2, | |
| 205 | + ), | |
| 206 | + 'email_tag' => false, | |
| 207 | + 'show_in_export' => false, | |
| 225 | 208 | ), |
| 226 | - 'show_in_export' => false, | |
| 227 | - ), | |
| 228 | - 'percent_donated_raw' => array( | |
| 229 | - 'label' => __( 'Percent Donated', 'charitable' ), | |
| 230 | - 'data_type' => 'core', | |
| 231 | - 'value_callback' => false, | |
| 232 | - 'admin_form' => false, | |
| 233 | - 'email_tag' => false, | |
| 234 | - 'show_in_export' => true, | |
| 235 | - ), | |
| 236 | - 'donor_count' => array( | |
| 237 | - 'label' => __( 'Number of Donors', 'charitable' ), | |
| 238 | - 'data_type' => 'core', | |
| 239 | - 'value_callback' => false, | |
| 240 | - 'admin_form' => false, | |
| 241 | - 'email_tag' => array( | |
| 242 | - 'tag' => 'campaign_donor_count', | |
| 243 | - 'description' => __( 'Display the number of campaign donors', 'charitable' ), | |
| 244 | - 'preview' => 23, | |
| 209 | + 'image' => array( | |
| 210 | + 'label' => __( 'Featured Image', 'charitable' ), | |
| 211 | + 'data_type' => 'meta', | |
| 212 | + 'value_callback' => 'charitable_get_campaign_featured_image', | |
| 213 | + 'admin_form' => false, | |
| 214 | + 'email_tag' => false, | |
| 215 | + 'show_in_export' => false, | |
| 245 | 216 | ), |
| 246 | - 'show_in_export' => true, | |
| 247 | - ), | |
| 248 | - 'status' => array( | |
| 249 | - 'label' => __( 'Campaign Status', 'charitable' ), | |
| 250 | - 'data_type' => 'core', | |
| 251 | - 'value_callback' => false, | |
| 252 | - 'admin_form' => false, | |
| 253 | - 'email_tag' => false, | |
| 254 | - 'show_in_export' => true, | |
| 255 | - ), | |
| 256 | - 'permalink' => array( | |
| 257 | - 'label' => __( 'Campaign Permalink', 'charitable' ), | |
| 258 | - 'data_type' => 'core', | |
| 259 | - 'value_callback' => false, | |
| 260 | - 'admin_form' => false, | |
| 261 | - 'email_tag' => array( | |
| 262 | - 'tag' => 'campaign_url', | |
| 263 | - 'description' => __( 'Display the campaign\'s URL', 'charitable' ), | |
| 264 | - 'preview' => 'http://www.example.com/campaigns/fake-campaign', | |
| 217 | + 'campaign_creator_name' => array( | |
| 218 | + 'label' => __( 'Campaign Creator', 'charitable' ), | |
| 219 | + 'data_type' => 'core', | |
| 220 | + 'value_callback' => false, | |
| 221 | + 'admin_form' => false, | |
| 222 | + 'email_tag' => array( | |
| 223 | + 'tag' => 'campaign_creator', | |
| 224 | + 'description' => __( 'The name of the campaign creator', 'charitable' ), | |
| 225 | + 'preview' => 'Harry Ferguson', | |
| 226 | + ), | |
| 227 | + 'show_in_export' => true, | |
| 265 | 228 | ), |
| 266 | - 'show_in_export' => true, | |
| 267 | - ), | |
| 268 | - 'admin_edit_link' => array( | |
| 269 | - 'label' => __( 'Campaign Edit Link', 'charitable' ), | |
| 270 | - 'data_type' => 'core', | |
| 271 | - 'value_callback' => false, | |
| 272 | - 'admin_form' => false, | |
| 273 | - 'email_tag' => array( | |
| 274 | - 'tag' => 'campaign_dashboard_url', | |
| 275 | - 'description' => __( 'Display a link to the campaign in the dashboard', 'charitable' ), | |
| 276 | - 'preview' => get_edit_post_link( 1 ), | |
| 229 | + 'campaign_creator_email' => array( | |
| 230 | + 'label' => __( 'Campaign Creator Email', 'charitable' ), | |
| 231 | + 'data_type' => 'core', | |
| 232 | + 'value_callback' => false, | |
| 233 | + 'admin_form' => false, | |
| 234 | + 'email_tag' => array( | |
| 235 | + 'description' => __( 'The email address of the campaign creator', 'charitable' ), | |
| 236 | + 'preview' => '[email protected]', | |
| 237 | + ), | |
| 238 | + 'show_in_export' => true, | |
| 277 | 239 | ), |
| 278 | - 'show_in_export' => false, | |
| 279 | - ), | |
| 280 | -) ); | |
| 240 | + 'goal_achieved_message' => array( | |
| 241 | + 'label' => __( 'Achieved Goal?', 'charitable' ), | |
| 242 | + 'data_type' => 'core', | |
| 243 | + 'value_callback' => false, | |
| 244 | + 'admin_form' => false, | |
| 245 | + 'email_tag' => array( | |
| 246 | + 'tag' => 'campaign_achieved_goal', | |
| 247 | + 'description' => __( 'Display whether the campaign reached its goal. Add a `success` parameter as the message when the campaign was successful, and a `failure` parameter as the message when the campaign is not successful', 'charitable' ), | |
| 248 | + 'preview' => __( 'The campaign achieved its fundraising goal.', 'charitable' ), | |
| 249 | + ), | |
| 250 | + 'show_in_export' => false, | |
| 251 | + ), | |
| 252 | + 'donated_amount' => array( | |
| 253 | + 'label' => __( 'Amount Donated', 'charitable' ), | |
| 254 | + 'data_type' => 'core', | |
| 255 | + 'value_callback' => false, | |
| 256 | + 'admin_form' => false, | |
| 257 | + 'email_tag' => false, | |
| 258 | + 'show_in_export' => true, | |
| 259 | + ), | |
| 260 | + 'donated_amount_formatted' => array( | |
| 261 | + 'label' => __( 'Amount Donated', 'charitable' ), | |
| 262 | + 'data_type' => 'core', | |
| 263 | + 'value_callback' => false, | |
| 264 | + 'admin_form' => false, | |
| 265 | + 'email_tag' => array( | |
| 266 | + 'tag' => 'campaign_donated_amount', | |
| 267 | + 'description' => __( 'Display the total amount donated to the campaign', 'charitable' ), | |
| 268 | + 'preview' => '$16,523', | |
| 269 | + ), | |
| 270 | + 'show_in_export' => false, | |
| 271 | + ), | |
| 272 | + 'percent_donated' => array( | |
| 273 | + 'label' => __( 'Percent Donated', 'charitable' ), | |
| 274 | + 'data_type' => 'core', | |
| 275 | + 'value_callback' => false, | |
| 276 | + 'admin_form' => false, | |
| 277 | + 'email_tag' => array( | |
| 278 | + 'tag' => 'campaign_percent_donated', | |
| 279 | + 'description' => __( 'Display the percentage donated to the campaign', 'charitable' ), | |
| 280 | + 'preview' => '34%', | |
| 281 | + ), | |
| 282 | + 'show_in_export' => false, | |
| 283 | + ), | |
| 284 | + 'percent_donated_raw' => array( | |
| 285 | + 'label' => __( 'Percent Donated', 'charitable' ), | |
| 286 | + 'data_type' => 'core', | |
| 287 | + 'value_callback' => false, | |
| 288 | + 'admin_form' => false, | |
| 289 | + 'email_tag' => false, | |
| 290 | + 'show_in_export' => true, | |
| 291 | + ), | |
| 292 | + 'donor_count' => array( | |
| 293 | + 'label' => __( 'Number of Donors', 'charitable' ), | |
| 294 | + 'data_type' => 'core', | |
| 295 | + 'value_callback' => false, | |
| 296 | + 'admin_form' => false, | |
| 297 | + 'email_tag' => array( | |
| 298 | + 'tag' => 'campaign_donor_count', | |
| 299 | + 'description' => __( 'Display the number of campaign donors', 'charitable' ), | |
| 300 | + 'preview' => 23, | |
| 301 | + ), | |
| 302 | + 'show_in_export' => true, | |
| 303 | + ), | |
| 304 | + 'status' => array( | |
| 305 | + 'label' => __( 'Campaign Status', 'charitable' ), | |
| 306 | + 'data_type' => 'core', | |
| 307 | + 'value_callback' => false, | |
| 308 | + 'admin_form' => false, | |
| 309 | + 'email_tag' => false, | |
| 310 | + 'show_in_export' => true, | |
| 311 | + ), | |
| 312 | + 'permalink' => array( | |
| 313 | + 'label' => __( 'Campaign Permalink', 'charitable' ), | |
| 314 | + 'data_type' => 'core', | |
| 315 | + 'value_callback' => false, | |
| 316 | + 'admin_form' => false, | |
| 317 | + 'email_tag' => array( | |
| 318 | + 'tag' => 'campaign_url', | |
| 319 | + 'description' => __( 'Display the campaign\'s URL', 'charitable' ), | |
| 320 | + 'preview' => 'http://www.example.com/campaigns/fake-campaign', | |
| 321 | + ), | |
| 322 | + 'show_in_export' => true, | |
| 323 | + ), | |
| 324 | + 'admin_edit_link' => array( | |
| 325 | + 'label' => __( 'Campaign Edit Link', 'charitable' ), | |
| 326 | + 'data_type' => 'core', | |
| 327 | + 'value_callback' => false, | |
| 328 | + 'admin_form' => false, | |
| 329 | + 'email_tag' => array( | |
| 330 | + 'tag' => 'campaign_dashboard_url', | |
| 331 | + 'description' => __( 'Display a link to the campaign in the dashboard', 'charitable' ), | |
| 332 | + 'preview' => admin_url( 'post.php?post=1&action=edit' ), | |
| 333 | + ), | |
| 334 | + 'show_in_export' => false, | |
| 335 | + ), | |
| 336 | + 'categories' => array( | |
| 337 | + 'label' => __( 'Categories', 'charitable' ), | |
| 338 | + 'data_type' => 'taxonomy', | |
| 339 | + 'value_callback' => 'charitable_get_campaign_taxonomy_terms_list', | |
| 340 | + 'admin_form' => false, | |
| 341 | + 'email_tag' => array( | |
| 342 | + 'description' => __( 'Display a comma-separated list of campaign categories', 'charitable' ), | |
| 343 | + 'preview' => 'Category 1, Category 2', | |
| 344 | + ), | |
| 345 | + 'show_in_export' => true, | |
| 346 | + ), | |
| 347 | + 'tags' => array( | |
| 348 | + 'label' => __( 'Tags', 'charitable' ), | |
| 349 | + 'data_type' => 'taxonomy', | |
| 350 | + 'value_callback' => 'charitable_get_campaign_taxonomy_terms_list', | |
| 351 | + 'admin_form' => false, | |
| 352 | + 'email_tag' => array( | |
| 353 | + 'description' => __( 'Display a comma-separated list of campaign tags', 'charitable' ), | |
| 354 | + 'preview' => 'Tag 1, Tag 2, Tag 3', | |
| 355 | + ), | |
| 356 | + 'show_in_export' => true, | |
| 357 | + ), | |
| 358 | + ) | |
| 359 | +); | |