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