| 1 |
<?php |
| 2 |
/** |
| 3 |
* Returns an array of all the default campaign fields. |
| 4 |
* |
| 5 |
* @package Charitable/Campaign Fields |
| 6 |
* @author Eric Daams |
| 7 |
* @copyright Copyright (c) 2018, Studio 164a |
| 8 |
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License |
| 9 |
* @since 1.6.0 |
| 10 |
* @version 1.6.0 |
| 11 |
*/ |
| 12 |
|
| 13 |
// Exit if accessed directly. |
| 14 |
if ( ! defined( 'ABSPATH' ) ) { |
| 15 |
exit; |
| 16 |
} |
| 17 |
|
| 18 |
/** |
| 19 |
* Filter the set of default campaign fields. |
| 20 |
* |
| 21 |
* This filter is provided primarily for internal use by Charitable |
| 22 |
* extensions, as it allows us to add to the registered campaign fields |
| 23 |
* as soon as possible. |
| 24 |
* |
| 25 |
* @since 1.6.0 |
| 26 |
* |
| 27 |
* @param array $fields The multi-dimensional array of keys in $key => $args format. |
| 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, |
| 46 |
), |
| 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 ongoing campaigns.', 'charitable' ), |
| 59 |
), |
| 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', |
| 72 |
), |
| 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 campaigns without a fundraising goal.', 'charitable' ), |
| 84 |
), |
| 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' ) ), |
| 89 |
), |
| 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, |
| 100 |
), |
| 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, |
| 111 |
), |
| 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' ), |
| 124 |
), |
| 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, |
| 144 |
), |
| 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, |
| 157 |
), |
| 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', |
| 170 |
), |
| 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' => 'harry@example.com', |
| 181 |
), |
| 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' ), |
| 193 |
), |
| 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', |
| 213 |
), |
| 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%', |
| 225 |
), |
| 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, |
| 245 |
), |
| 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', |
| 265 |
), |
| 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 ), |
| 277 |
), |
| 278 |
'show_in_export' => false, |
| 279 |
), |
| 280 |
) ); |
| 281 |
|