| Conditions | 1 |
| Paths | 1 |
| Total Lines | 479 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
| 1 | <?php |
||
| 88 | function get_settings() { |
||
| 89 | $post_id = give_get_admin_post_id(); |
||
| 90 | $price_placeholder = give_format_decimal( '1.00', false, false ); |
||
| 91 | |||
| 92 | // Start with an underscore to hide fields from custom fields list |
||
| 93 | $prefix = '_give_'; |
||
| 94 | |||
| 95 | $settings = array( |
||
| 96 | /** |
||
| 97 | * Repeatable Field Groups |
||
| 98 | */ |
||
| 99 | 'form_field_options' => apply_filters( 'give_forms_field_options', array( |
||
| 100 | 'id' => 'form_field_options', |
||
| 101 | 'title' => __( 'Donation Options', 'give' ), |
||
| 102 | 'icon-html' => '<span class="give-icon give-icon-heart"></span>', |
||
| 103 | 'fields' => apply_filters( 'give_forms_donation_form_metabox_fields', array( |
||
| 104 | // Donation Option. |
||
| 105 | array( |
||
| 106 | 'name' => __( 'Donation Option', 'give' ), |
||
| 107 | 'description' => __( 'Do you want this form to have one set donation price or multiple levels (for example, $10, $20, $50)?', 'give' ), |
||
| 108 | 'id' => $prefix . 'price_option', |
||
| 109 | 'type' => 'radio_inline', |
||
| 110 | 'default' => 'multi', |
||
| 111 | 'options' => apply_filters( 'give_forms_price_options', array( |
||
| 112 | 'multi' => __( 'Multi-level Donation', 'give' ), |
||
| 113 | 'set' => __( 'Set Donation', 'give' ), |
||
| 114 | ) ), |
||
| 115 | ), |
||
| 116 | array( |
||
| 117 | 'name' => __( 'Set Donation', 'give' ), |
||
| 118 | 'description' => __( 'This is the set donation amount for this form. If you have a "Custom Amount Minimum" set, make sure it is less than this amount.', 'give' ), |
||
| 119 | 'id' => $prefix . 'set_price', |
||
| 120 | 'type' => 'text_small', |
||
| 121 | 'data_type' => 'price', |
||
| 122 | 'attributes' => array( |
||
| 123 | 'placeholder' => $price_placeholder, |
||
| 124 | 'class' => 'give-money-field', |
||
| 125 | ), |
||
| 126 | ), |
||
| 127 | // Display Style. |
||
| 128 | array( |
||
| 129 | 'name' => __( 'Display Style', 'give' ), |
||
| 130 | 'description' => __( 'Set how the donations levels will display on the form.', 'give' ), |
||
| 131 | 'id' => $prefix . 'display_style', |
||
| 132 | 'type' => 'radio_inline', |
||
| 133 | 'default' => 'buttons', |
||
| 134 | 'options' => array( |
||
| 135 | 'buttons' => __( 'Buttons', 'give' ), |
||
| 136 | 'radios' => __( 'Radios', 'give' ), |
||
| 137 | 'dropdown' => __( 'Dropdown', 'give' ), |
||
| 138 | ), |
||
| 139 | 'wrapper_class' => 'give-hidden', |
||
| 140 | ), |
||
| 141 | // Custom Amount. |
||
| 142 | array( |
||
| 143 | 'name' => __( 'Custom Amount', 'give' ), |
||
| 144 | 'description' => __( 'Do you want the user to be able to input their own donation amount?', 'give' ), |
||
| 145 | 'id' => $prefix . 'custom_amount', |
||
| 146 | 'type' => 'radio_inline', |
||
| 147 | 'default' => 'disabled', |
||
| 148 | 'options' => array( |
||
| 149 | 'enabled' => __( 'Enabled', 'give' ), |
||
| 150 | 'disabled' => __( 'Disabled', 'give' ), |
||
| 151 | ), |
||
| 152 | ), |
||
| 153 | array( |
||
| 154 | 'name' => __( 'Max/Min. Amount', 'give' ), |
||
| 155 | 'description' => __( 'Set minimum and maximum amount limit.', 'give' ), |
||
| 156 | 'id' => $prefix . 'custom_amount_range', |
||
| 157 | 'type' => 'range_slider', |
||
| 158 | 'wrapper_class' => 'give-hidden', |
||
| 159 | 'data_type' => 'price', |
||
| 160 | 'attributes' => array( |
||
| 161 | 'placeholder' => $price_placeholder, |
||
| 162 | 'class' => 'give-money-field', |
||
| 163 | ), |
||
| 164 | 'options' => array( |
||
| 165 | 'display_label' => __( 'Donation Limits: ', 'give' ), |
||
| 166 | 'minimum' => 1.00, |
||
| 167 | 'maximum' => 999999.99, |
||
| 168 | ), |
||
| 169 | ), |
||
| 170 | array( |
||
| 171 | 'name' => __( 'Custom Amount Text', 'give' ), |
||
| 172 | 'description' => __( 'This text appears as a label below the custom amount field for set donation forms. For multi-level forms the text will appear as it\'s own level (ie button, radio, or select option).', 'give' ), |
||
| 173 | 'id' => $prefix . 'custom_amount_text', |
||
| 174 | 'type' => 'text_medium', |
||
| 175 | 'attributes' => array( |
||
| 176 | 'rows' => 3, |
||
| 177 | 'placeholder' => __( 'Give a Custom Amount', 'give' ), |
||
| 178 | ), |
||
| 179 | 'wrapper_class' => 'give-hidden', |
||
| 180 | ), |
||
| 181 | // Donation Levels. |
||
| 182 | array( |
||
| 183 | 'id' => $prefix . 'donation_levels', |
||
| 184 | 'type' => 'group', |
||
| 185 | 'options' => array( |
||
| 186 | 'add_button' => __( 'Add Level', 'give' ), |
||
| 187 | 'header_title' => __( 'Donation Level', 'give' ), |
||
| 188 | 'remove_button' => '<span class="dashicons dashicons-no"></span>', |
||
| 189 | ), |
||
| 190 | 'wrapper_class' => 'give-hidden', |
||
| 191 | // Fields array works the same, except id's only need to be unique for this group. |
||
| 192 | // Prefix is not needed. |
||
| 193 | 'fields' => apply_filters( 'give_donation_levels_table_row', array( |
||
| 194 | array( |
||
| 195 | 'name' => __( 'ID', 'give' ), |
||
| 196 | 'id' => $prefix . 'id', |
||
| 197 | 'type' => 'levels_id', |
||
| 198 | ), |
||
| 199 | array( |
||
| 200 | 'name' => __( 'Amount', 'give' ), |
||
| 201 | 'id' => $prefix . 'amount', |
||
| 202 | 'type' => 'text_small', |
||
| 203 | 'data_type' => 'price', |
||
| 204 | 'attributes' => array( |
||
| 205 | 'placeholder' => $price_placeholder, |
||
| 206 | 'class' => 'give-money-field', |
||
| 207 | ), |
||
| 208 | ), |
||
| 209 | array( |
||
| 210 | 'name' => __( 'Text', 'give' ), |
||
| 211 | 'id' => $prefix . 'text', |
||
| 212 | 'type' => 'text', |
||
| 213 | 'attributes' => array( |
||
| 214 | 'placeholder' => __( 'Donation Level', 'give' ), |
||
| 215 | 'class' => 'give-multilevel-text-field', |
||
| 216 | ), |
||
| 217 | ), |
||
| 218 | array( |
||
| 219 | 'name' => __( 'Default', 'give' ), |
||
| 220 | 'id' => $prefix . 'default', |
||
| 221 | 'type' => 'give_default_radio_inline', |
||
| 222 | ), |
||
| 223 | ) ), |
||
| 224 | ), |
||
| 225 | array( |
||
| 226 | 'name' => 'donation_options_docs', |
||
| 227 | 'type' => 'docs_link', |
||
| 228 | 'url' => 'http://docs.givewp.com/form-donation-options', |
||
| 229 | 'title' => __( 'Donation Options', 'give' ), |
||
| 230 | ), |
||
| 231 | ), |
||
| 232 | $post_id |
||
| 233 | ), |
||
| 234 | ) ), |
||
| 235 | |||
| 236 | /** |
||
| 237 | * Display Options |
||
| 238 | */ |
||
| 239 | 'form_display_options' => apply_filters( 'give_form_display_options', array( |
||
| 240 | 'id' => 'form_display_options', |
||
| 241 | 'title' => __( 'Form Display', 'give' ), |
||
| 242 | 'icon-html' => '<span class="give-icon give-icon-display"></span>', |
||
| 243 | 'fields' => apply_filters( 'give_forms_display_options_metabox_fields', array( |
||
| 244 | array( |
||
| 245 | 'name' => __( 'Display Options', 'give' ), |
||
| 246 | 'desc' => sprintf( __( 'How would you like to display donation information for this form?', 'give' ), '#' ), |
||
| 247 | 'id' => $prefix . 'payment_display', |
||
| 248 | 'type' => 'radio_inline', |
||
| 249 | 'options' => array( |
||
| 250 | 'onpage' => __( 'All Fields', 'give' ), |
||
| 251 | 'modal' => __( 'Modal', 'give' ), |
||
| 252 | 'reveal' => __( 'Reveal', 'give' ), |
||
| 253 | 'button' => __( 'Button', 'give' ), |
||
| 254 | ), |
||
| 255 | 'default' => 'onpage', |
||
| 256 | ), |
||
| 257 | array( |
||
| 258 | 'id' => $prefix . 'reveal_label', |
||
| 259 | 'name' => __( 'Continue Button', 'give' ), |
||
| 260 | 'desc' => __( 'The button label for displaying the additional payment fields.', 'give' ), |
||
| 261 | 'type' => 'text_small', |
||
| 262 | 'attributes' => array( |
||
| 263 | 'placeholder' => __( 'Donate Now', 'give' ), |
||
| 264 | ), |
||
| 265 | 'wrapper_class' => 'give-hidden', |
||
| 266 | ), |
||
| 267 | array( |
||
| 268 | 'id' => $prefix . 'checkout_label', |
||
| 269 | 'name' => __( 'Submit Button', 'give' ), |
||
| 270 | 'desc' => __( 'The button label for completing a donation.', 'give' ), |
||
| 271 | 'type' => 'text_small', |
||
| 272 | 'attributes' => array( |
||
| 273 | 'placeholder' => __( 'Donate Now', 'give' ), |
||
| 274 | ), |
||
| 275 | ), |
||
| 276 | array( |
||
| 277 | 'name' => __( 'Default Gateway', 'give' ), |
||
| 278 | 'desc' => __( 'By default, the gateway for this form will inherit the global default gateway (set under Give > Settings > Payment Gateways). This option allows you to customize the default gateway for this form only.', 'give' ), |
||
| 279 | 'id' => $prefix . 'default_gateway', |
||
| 280 | 'type' => 'default_gateway', |
||
| 281 | ), |
||
| 282 | array( |
||
| 283 | 'name' => __( 'Company Donations', 'give' ), |
||
| 284 | 'desc' => __( 'Do you want a Company field to appear after First Name and Last Name?', 'give' ), |
||
| 285 | 'id' => $prefix . 'company_field', |
||
| 286 | 'type' => 'radio_inline', |
||
| 287 | 'default' => 'global', |
||
| 288 | 'options' => array( |
||
| 289 | 'global' => __( 'Global Option', 'give' ), |
||
| 290 | 'required' => __( 'Required', 'give' ), |
||
| 291 | 'optional' => __( 'Optional', 'give' ), |
||
| 292 | 'disabled' => __( 'Disabled', 'give' ), |
||
| 293 | |||
| 294 | ), |
||
| 295 | ), |
||
| 296 | array( |
||
| 297 | 'name' => __( 'Guest Donations', 'give' ), |
||
| 298 | 'desc' => __( 'Do you want to allow non-logged-in users to make donations?', 'give' ), |
||
| 299 | 'id' => $prefix . 'logged_in_only', |
||
| 300 | 'type' => 'radio_inline', |
||
| 301 | 'default' => 'enabled', |
||
| 302 | 'options' => array( |
||
| 303 | 'enabled' => __( 'Enabled', 'give' ), |
||
| 304 | 'disabled' => __( 'Disabled', 'give' ), |
||
| 305 | ), |
||
| 306 | ), |
||
| 307 | array( |
||
| 308 | 'name' => __( 'Registration', 'give' ), |
||
| 309 | 'desc' => __( 'Display the registration and login forms in the payment section for non-logged-in users.', 'give' ), |
||
| 310 | 'id' => $prefix . 'show_register_form', |
||
| 311 | 'type' => 'radio', |
||
| 312 | 'options' => array( |
||
| 313 | 'none' => __( 'None', 'give' ), |
||
| 314 | 'registration' => __( 'Registration', 'give' ), |
||
| 315 | 'login' => __( 'Login', 'give' ), |
||
| 316 | 'both' => __( 'Registration + Login', 'give' ), |
||
| 317 | ), |
||
| 318 | 'default' => 'none', |
||
| 319 | ), |
||
| 320 | array( |
||
| 321 | 'name' => __( 'Floating Labels', 'give' ), |
||
| 322 | /* translators: %s: forms http://docs.givewp.com/form-floating-labels */ |
||
| 323 | 'desc' => sprintf( __( 'Select the <a href="%s" target="_blank">floating labels</a> setting for this Give form. Be aware that if you have the "Disable CSS" option enabled, you will need to style the floating labels yourself.', 'give' ), esc_url( 'http://docs.givewp.com/form-floating-labels' ) ), |
||
| 324 | 'id' => $prefix . 'form_floating_labels', |
||
| 325 | 'type' => 'radio_inline', |
||
| 326 | 'options' => array( |
||
| 327 | 'global' => __( 'Global Option', 'give' ), |
||
| 328 | 'enabled' => __( 'Enabled', 'give' ), |
||
| 329 | 'disabled' => __( 'Disabled', 'give' ), |
||
| 330 | ), |
||
| 331 | 'default' => 'global', |
||
| 332 | ), |
||
| 333 | array( |
||
| 334 | 'name' => 'form_display_docs', |
||
| 335 | 'type' => 'docs_link', |
||
| 336 | 'url' => 'http://docs.givewp.com/form-display-options', |
||
| 337 | 'title' => __( 'Form Display', 'give' ), |
||
| 338 | ), |
||
| 339 | ), |
||
| 340 | $post_id |
||
| 341 | ), |
||
| 342 | ) |
||
| 343 | ), |
||
| 344 | |||
| 345 | /** |
||
| 346 | * Donation Goals |
||
| 347 | */ |
||
| 348 | 'donation_goal_options' => apply_filters( 'give_donation_goal_options', array( |
||
| 349 | 'id' => 'donation_goal_options', |
||
| 350 | 'title' => __( 'Donation Goal', 'give' ), |
||
| 351 | 'icon-html' => '<span class="give-icon give-icon-target"></span>', |
||
| 352 | 'fields' => apply_filters( 'give_forms_donation_goal_metabox_fields', array( |
||
| 353 | // Goals |
||
| 354 | array( |
||
| 355 | 'name' => __( 'Donation Goal', 'give' ), |
||
| 356 | 'description' => __( 'Do you want to set a donation goal for this form?', 'give' ), |
||
| 357 | 'id' => $prefix . 'goal_option', |
||
| 358 | 'type' => 'radio_inline', |
||
| 359 | 'default' => 'disabled', |
||
| 360 | 'options' => array( |
||
| 361 | 'enabled' => __( 'Enabled', 'give' ), |
||
| 362 | 'disabled' => __( 'Disabled', 'give' ), |
||
| 363 | ), |
||
| 364 | ), |
||
| 365 | |||
| 366 | array( |
||
| 367 | 'name' => __( 'Goal Format', 'give' ), |
||
| 368 | 'description' => __( 'Do you want to display the total amount raised based on your monetary goal or a percentage? For instance, "$500 of $1,000 raised" or "50% funded" or "1 of 5 donations". You can also display a donor-based goal, such as "100 of 1,000 donors have given".', 'give' ), |
||
| 369 | 'id' => $prefix . 'goal_format', |
||
| 370 | 'type' => 'radio', |
||
| 371 | 'default' => 'amount', |
||
| 372 | 'options' => array( |
||
| 373 | 'amount' => __( 'Amount Raised', 'give' ), |
||
| 374 | 'percentage' => __( 'Percentage Raised', 'give' ), |
||
| 375 | 'donation' => __( 'Number of Donations', 'give' ), |
||
| 376 | 'donors' => __( 'Number of Donors', 'give' ), |
||
| 377 | ), |
||
| 378 | ), |
||
| 379 | |||
| 380 | array( |
||
| 381 | 'name' => __( 'Goal Amount', 'give' ), |
||
| 382 | 'description' => __( 'This is the monetary goal amount you want to reach for this form.', 'give' ), |
||
| 383 | 'id' => $prefix . 'set_goal', |
||
| 384 | 'type' => 'text_small', |
||
| 385 | 'data_type' => 'price', |
||
| 386 | 'attributes' => array( |
||
| 387 | 'placeholder' => $price_placeholder, |
||
| 388 | 'class' => 'give-money-field', |
||
| 389 | ), |
||
| 390 | 'wrapper_class' => 'give-hidden', |
||
| 391 | ), |
||
| 392 | array( |
||
| 393 | 'id' => $prefix . 'number_of_donation_goal', |
||
| 394 | 'name' => __( 'Donation Goal', 'give' ), |
||
| 395 | 'desc' => __( 'Set the total number of donations as a goal.', 'give' ), |
||
| 396 | 'type' => 'number', |
||
| 397 | 'default' => 1, |
||
| 398 | 'attributes' => array( |
||
| 399 | 'placeholder' => 1, |
||
| 400 | ), |
||
| 401 | ), |
||
| 402 | array( |
||
| 403 | 'id' => $prefix . 'number_of_donor_goal', |
||
| 404 | 'name' => __( 'Donor Goal', 'give' ), |
||
| 405 | 'desc' => __( 'Set the total number of donors as a goal.', 'give' ), |
||
| 406 | 'type' => 'number', |
||
| 407 | 'default' => 1, |
||
| 408 | 'attributes' => array( |
||
| 409 | 'placeholder' => 1, |
||
| 410 | ), |
||
| 411 | ), |
||
| 412 | array( |
||
| 413 | 'name' => __( 'Progress Bar Color', 'give' ), |
||
| 414 | 'desc' => __( 'Customize the color of the goal progress bar.', 'give' ), |
||
| 415 | 'id' => $prefix . 'goal_color', |
||
| 416 | 'type' => 'colorpicker', |
||
| 417 | 'default' => '#2bc253', |
||
| 418 | 'wrapper_class' => 'give-hidden', |
||
| 419 | ), |
||
| 420 | |||
| 421 | array( |
||
| 422 | 'name' => __( 'Close Form', 'give' ), |
||
| 423 | 'desc' => __( 'Do you want to close the donation forms and stop accepting donations once this goal has been met?', 'give' ), |
||
| 424 | 'id' => $prefix . 'close_form_when_goal_achieved', |
||
| 425 | 'type' => 'radio_inline', |
||
| 426 | 'default' => 'disabled', |
||
| 427 | 'options' => array( |
||
| 428 | 'enabled' => __( 'Enabled', 'give' ), |
||
| 429 | 'disabled' => __( 'Disabled', 'give' ), |
||
| 430 | ), |
||
| 431 | 'wrapper_class' => 'give-hidden', |
||
| 432 | ), |
||
| 433 | array( |
||
| 434 | 'name' => __( 'Goal Achieved Message', 'give' ), |
||
| 435 | 'desc' => __( 'Do you want to display a custom message when the goal is closed?', 'give' ), |
||
| 436 | 'id' => $prefix . 'form_goal_achieved_message', |
||
| 437 | 'type' => 'wysiwyg', |
||
| 438 | 'default' => __( 'Thank you to all our donors, we have met our fundraising goal.', 'give' ), |
||
| 439 | 'wrapper_class' => 'give-hidden', |
||
| 440 | ), |
||
| 441 | array( |
||
| 442 | 'name' => 'donation_goal_docs', |
||
| 443 | 'type' => 'docs_link', |
||
| 444 | 'url' => 'http://docs.givewp.com/form-donation-goal', |
||
| 445 | 'title' => __( 'Donation Goal', 'give' ), |
||
| 446 | ), |
||
| 447 | ), |
||
| 448 | $post_id |
||
| 449 | ), |
||
| 450 | ) ), |
||
| 451 | |||
| 452 | /** |
||
| 453 | * Content Field |
||
| 454 | */ |
||
| 455 | 'form_content_options' => apply_filters( 'give_forms_content_options', array( |
||
| 456 | 'id' => 'form_content_options', |
||
| 457 | 'title' => __( 'Form Content', 'give' ), |
||
| 458 | 'icon-html' => '<span class="give-icon give-icon-edit"></span>', |
||
| 459 | 'fields' => apply_filters( 'give_forms_content_options_metabox_fields', array( |
||
| 460 | |||
| 461 | // Donation content. |
||
| 462 | array( |
||
| 463 | 'name' => __( 'Display Content', 'give' ), |
||
| 464 | 'description' => __( 'Do you want to add custom content to this form?', 'give' ), |
||
| 465 | 'id' => $prefix . 'display_content', |
||
| 466 | 'type' => 'radio_inline', |
||
| 467 | 'options' => array( |
||
| 468 | 'enabled' => __( 'Enabled', 'give' ), |
||
| 469 | 'disabled' => __( 'Disabled', 'give' ), |
||
| 470 | ), |
||
| 471 | 'default' => 'disabled', |
||
| 472 | ), |
||
| 473 | |||
| 474 | // Content placement. |
||
| 475 | array( |
||
| 476 | 'name' => __( 'Content Placement', 'give' ), |
||
| 477 | 'description' => __( 'This option controls where the content appears within the donation form.', 'give' ), |
||
| 478 | 'id' => $prefix . 'content_placement', |
||
| 479 | 'type' => 'radio_inline', |
||
| 480 | 'options' => apply_filters( 'give_forms_content_options_select', array( |
||
| 481 | 'give_pre_form' => __( 'Above fields', 'give' ), |
||
| 482 | 'give_post_form' => __( 'Below fields', 'give' ), |
||
| 483 | ) |
||
| 484 | ), |
||
| 485 | 'default' => 'give_pre_form', |
||
| 486 | 'wrapper_class' => 'give-hidden', |
||
| 487 | ), |
||
| 488 | array( |
||
| 489 | 'name' => __( 'Content', 'give' ), |
||
| 490 | 'description' => __( 'This content will display on the single give form page.', 'give' ), |
||
| 491 | 'id' => $prefix . 'form_content', |
||
| 492 | 'type' => 'wysiwyg', |
||
| 493 | 'wrapper_class' => 'give-hidden', |
||
| 494 | ), |
||
| 495 | array( |
||
| 496 | 'name' => 'form_content_docs', |
||
| 497 | 'type' => 'docs_link', |
||
| 498 | 'url' => 'http://docs.givewp.com/form-content', |
||
| 499 | 'title' => __( 'Form Content', 'give' ), |
||
| 500 | ), |
||
| 501 | ), |
||
| 502 | $post_id |
||
| 503 | ), |
||
| 504 | ) ), |
||
| 505 | |||
| 506 | /** |
||
| 507 | * Terms & Conditions |
||
| 508 | */ |
||
| 509 | 'form_terms_options' => apply_filters( 'give_forms_terms_options', array( |
||
| 510 | 'id' => 'form_terms_options', |
||
| 511 | 'title' => __( 'Terms & Conditions', 'give' ), |
||
| 512 | 'icon-html' => '<span class="give-icon give-icon-checklist"></span>', |
||
| 513 | 'fields' => apply_filters( 'give_forms_terms_options_metabox_fields', array( |
||
| 514 | // Donation Option |
||
| 515 | array( |
||
| 516 | 'name' => __( 'Terms and Conditions', 'give' ), |
||
| 517 | 'description' => __( 'Do you want to require the donor to accept terms prior to being able to complete their donation?', 'give' ), |
||
| 518 | 'id' => $prefix . 'terms_option', |
||
| 519 | 'type' => 'radio_inline', |
||
| 520 | 'options' => apply_filters( 'give_forms_content_options_select', array( |
||
| 521 | 'global' => __( 'Global Option', 'give' ), |
||
| 522 | 'enabled' => __( 'Customize', 'give' ), |
||
| 523 | 'disabled' => __( 'Disable', 'give' ), |
||
| 524 | ) |
||
| 525 | ), |
||
| 526 | 'default' => 'global', |
||
| 527 | ), |
||
| 528 | array( |
||
| 529 | 'id' => $prefix . 'agree_label', |
||
| 530 | 'name' => __( 'Agreement Label', 'give' ), |
||
| 531 | 'desc' => __( 'The label shown next to the agree to terms check box. Add your own to customize or leave blank to use the default text placeholder.', 'give' ), |
||
| 532 | 'type' => 'text', |
||
| 533 | 'size' => 'regular', |
||
| 534 | 'attributes' => array( |
||
| 535 | 'placeholder' => __( 'Agree to Terms?', 'give' ), |
||
| 536 | ), |
||
| 537 | 'wrapper_class' => 'give-hidden', |
||
| 538 | ), |
||
| 539 | array( |
||
| 540 | 'id' => $prefix . 'agree_text', |
||
| 541 | 'name' => __( 'Agreement Text', 'give' ), |
||
| 542 | 'desc' => __( 'This is the actual text which the user will have to agree to in order to make a donation.', 'give' ), |
||
| 543 | 'default' => give_get_option( 'agreement_text' ), |
||
| 544 | 'type' => 'wysiwyg', |
||
| 545 | 'wrapper_class' => 'give-hidden', |
||
| 546 | ), |
||
| 547 | array( |
||
| 548 | 'name' => 'terms_docs', |
||
| 549 | 'type' => 'docs_link', |
||
| 550 | 'url' => 'http://docs.givewp.com/form-terms', |
||
| 551 | 'title' => __( 'Terms and Conditions', 'give' ), |
||
| 552 | ), |
||
| 553 | ), |
||
| 554 | $post_id |
||
| 555 | ), |
||
| 556 | ) ), |
||
| 557 | ); |
||
| 558 | |||
| 559 | /** |
||
| 560 | * Filter the metabox tabbed panel settings. |
||
| 561 | */ |
||
| 562 | $settings = apply_filters( 'give_metabox_form_data_settings', $settings, $post_id ); |
||
| 563 | |||
| 564 | // Output. |
||
| 565 | return $settings; |
||
| 566 | } |
||
| 567 | |||
| 1273 |
Adding explicit visibility (
private,protected, orpublic) is generally recommend to communicate to other developers how, and from where this method is intended to be used.