Changeset 2787143
- Timestamp:
- 09/19/2022 04:49:36 PM (3 years ago)
- Location:
- lct-useful-shortcodes-functions/trunk
- Files:
-
- 4 edited
-
code/plugins/acf/api/form.php (modified) (7 diffs)
-
code/plugins/acf/form.php (modified) (5 diffs)
-
lct-useful-shortcodes-functions.php (modified) (1 diff)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
lct-useful-shortcodes-functions/trunk/code/plugins/acf/api/form.php
r2782154 r2787143 52 52 ** => 'form_container' => null //the id of the form container 53 53 ** => 'empty_form_container_on_submit' => true //the id of the form container 54 ** => 'save_now' => false //bool 55 ** => 'save_sess' => false //bool 54 56 ** => 'theme_chunk_iframe_json' => null //Used in KWSystem 55 57 * => ], … … 68 70 *** 'form_data' => alias to form_attributes['data'], //Format: key : value :: key2 : value2; Don't use this if possible; //TODO: cs - Need to get this removed - 1/17/2022 4:40 PM 69 71 *** 'instant' => false //force the field(s) to save to the DB instantly via ajax 72 *** 'save_now' => false //force the field(s) to save to the DB instantly via ajax 73 *** 'save_sess' => false //force the field(s) to save to the DB instantly via ajax 70 74 * //CUSTOM - Field atts 71 75 * 'lct_viewonly' => null … … 79 83 * @return bool|string 80 84 * @since 7.49 81 * @verified 2022.0 8.2285 * @verified 2022.09.15 82 86 */ 83 87 function lct_acf_form2( $a ) { … … 108 112 'form_data' => null, 109 113 'instant' => false, 114 'save_now' => false, 115 'save_sess' => false, 110 116 'lct_pdf_view' => true, //true, false, hide_form (only, show on the PDF) 111 117 'lct_pdf_layout' => '{value}', //{value}, {label}, {instructions} … … 241 247 242 248 //for backwards compatibility 243 if ( strpos( $a['form_class'], 'lct_instant' ) !== false ) { //only if class contains LCT instant 249 if ( 250 ! $a['save_now'] && 251 ! $a['save_sess'] && 252 strpos( $a['form_class'], 'lct_instant' ) !== false 253 ) { //only if class contains LCT instant 244 254 $a['instant'] = true; 245 255 … … 296 306 * CUSTOM 297 307 * Set the instant 298 */ 299 $a['instant'] = filter_var( $a['instant'], FILTER_VALIDATE_BOOLEAN ); 300 301 302 if ( $a['instant'] ) { 303 $a['honeypot'] = false; 304 $a['form_attributes']['class'] .= ' ' . 'lct_instant'; 308 * Set the save_now 309 * Set the save_sess 310 */ 311 $a['instant'] = filter_var( $a['instant'], FILTER_VALIDATE_BOOLEAN ); 312 $a['save_now'] = filter_var( $a['save_now'], FILTER_VALIDATE_BOOLEAN ); 313 $a['save_sess'] = filter_var( $a['save_sess'], FILTER_VALIDATE_BOOLEAN ); 314 315 316 if ( 317 $a['save_now'] || 318 $a['save_sess'] || 319 $a['instant'] 320 ) { 321 $a['honeypot'] = false; 322 if ( ! $a['save_now'] && ! $a['save_sess'] ) 323 $a['form_attributes']['class'] .= ' ' . 'lct_instant'; 305 324 306 325 … … 438 457 * _form_data_lct 439 458 */ 440 if ( isset( $a['_form_data_lct'] ) ) { 441 $a['_form_data_lct'] = afwp_acf_maybe_json_decode( $a['_form_data_lct'] ); 442 443 444 /** 445 * ACF API Form Variables 446 */ 447 if ( isset( $a['_form_data_lct']['wp_api'] ) ) { 448 /** 449 * wp_api 450 */ 451 $a['_form_data_lct']['wp_api'] = filter_var( $a['_form_data_lct']['wp_api'], FILTER_VALIDATE_BOOLEAN ); 452 453 454 /** 455 * wp_api_submit_ready 456 */ 457 if ( ! isset( $a['_form_data_lct']['wp_api_submit_ready'] ) ) 458 $a['_form_data_lct']['wp_api_submit_ready'] = true; 459 460 $a['_form_data_lct']['wp_api_submit_ready'] = filter_var( $a['_form_data_lct']['wp_api_submit_ready'], FILTER_VALIDATE_BOOLEAN ); 461 462 463 /** 464 * print_response_container 465 */ 466 if ( ! isset( $a['_form_data_lct']['print_response_container'] ) ) 467 $a['_form_data_lct']['print_response_container'] = true; 468 else if ( $a['_form_data_lct']['print_response_container'] !== 'below' ) 469 $a['_form_data_lct']['print_response_container'] = filter_var( $a['_form_data_lct']['print_response_container'], FILTER_VALIDATE_BOOLEAN ); 470 471 472 /** 473 * empty_form_container_on_submit 474 */ 475 if ( ! isset( $a['_form_data_lct']['empty_form_container_on_submit'] ) ) 476 $a['_form_data_lct']['empty_form_container_on_submit'] = true; 477 478 $a['_form_data_lct']['empty_form_container_on_submit'] = filter_var( $a['_form_data_lct']['empty_form_container_on_submit'], FILTER_VALIDATE_BOOLEAN ); 479 } 480 } 459 if ( ! isset( $a['_form_data_lct'] ) ) 460 $a['_form_data_lct'] = []; 461 $a['_form_data_lct'] = afwp_acf_maybe_json_decode( $a['_form_data_lct'] ); 462 463 464 /** 465 * ACF API Form Variables 466 */ 467 if ( isset( $a['_form_data_lct']['wp_api'] ) ) { 468 /** 469 * wp_api 470 */ 471 $a['_form_data_lct']['wp_api'] = filter_var( $a['_form_data_lct']['wp_api'], FILTER_VALIDATE_BOOLEAN ); 472 473 474 /** 475 * wp_api_submit_ready 476 */ 477 if ( ! isset( $a['_form_data_lct']['wp_api_submit_ready'] ) ) 478 $a['_form_data_lct']['wp_api_submit_ready'] = true; 479 480 $a['_form_data_lct']['wp_api_submit_ready'] = filter_var( $a['_form_data_lct']['wp_api_submit_ready'], FILTER_VALIDATE_BOOLEAN ); 481 482 483 /** 484 * print_response_container 485 */ 486 if ( ! isset( $a['_form_data_lct']['print_response_container'] ) ) 487 $a['_form_data_lct']['print_response_container'] = true; 488 else if ( $a['_form_data_lct']['print_response_container'] !== 'below' ) 489 $a['_form_data_lct']['print_response_container'] = filter_var( $a['_form_data_lct']['print_response_container'], FILTER_VALIDATE_BOOLEAN ); 490 491 492 /** 493 * empty_form_container_on_submit 494 */ 495 if ( ! isset( $a['_form_data_lct']['empty_form_container_on_submit'] ) ) 496 $a['_form_data_lct']['empty_form_container_on_submit'] = true; 497 498 $a['_form_data_lct']['empty_form_container_on_submit'] = filter_var( $a['_form_data_lct']['empty_form_container_on_submit'], FILTER_VALIDATE_BOOLEAN ); 499 } 500 501 502 /** 503 * save_now Variables 504 */ 505 if ( $a['save_now'] ) 506 $a['_form_data_lct']['save_now'] = true; 507 508 509 /** 510 * save_sess Variables 511 */ 512 if ( $a['save_sess'] ) 513 $a['_form_data_lct']['save_sess'] = true; 481 514 482 515 -
lct-useful-shortcodes-functions/trunk/code/plugins/acf/form.php
r2679272 r2787143 165 165 * @return bool|string 166 166 * @since 7.49 167 * @verified 2022.0 1.18167 * @verified 2022.09.15 168 168 */ 169 169 function form_shortcode( $a ) { … … 173 173 $a = shortcode_atts( 174 174 /** 175 * @date 2022.01.07176 * @since 2022.1177 * @verified 2022.01.07175 * @date 2022.01.07 176 * @since 2022.1 177 * @verified 2022.01.07 178 178 */ 179 179 apply_filters( 'lct/acf_form/shortcode_atts', … … 219 219 'form_data' => null, 220 220 'instant' => null, 221 'save_now' => null, 222 'save_sess' => null, 221 223 //CUSTOM - Field atts 222 224 zxzu( 'viewonly' ) => null, … … 231 233 232 234 233 if ( $a['instant'] )235 if ( $a['instant'] || $a['save_now'] || $a['save_sess'] ) 234 236 $a['honeypot'] = false; 235 237 … … 582 584 * @param array $data The form data. 583 585 * 584 * @date 2022.01.07585 * @since 2022.1586 * @date 2022.01.07 587 * @since 2022.1 586 588 * @verified 2022.01.21 587 589 */ -
lct-useful-shortcodes-functions/trunk/lct-useful-shortcodes-functions.php
r2784778 r2787143 4 4 * Plugin URI: https://www.simplesmithmedia.com 5 5 * Description: Shortcodes & Functions that will help make your life easier. 6 * Version: 2022. 76 * Version: 2022.8 7 7 * Author: SimpleSmithMedia 8 8 * Author URI: https://www.simplesmithmedia.com -
lct-useful-shortcodes-functions/trunk/readme.txt
r2784778 r2787143 33 33 34 34 == Changelog == 35 = 2022.8 = 36 *Release Date - 19 September 2022* 37 38 * Updated: 39 * [lct_acf_form2] 40 * lct_acf_form2() 41 35 42 = 2022.7 = 36 43 *Release Date - 14 September 2022*
Note: See TracChangeset
for help on using the changeset viewer.