Changeset 3430425
- Timestamp:
- 01/01/2026 09:48:37 AM (3 months ago)
- Location:
- connect-wpform-to-any-api
- Files:
-
- 39 added
- 10 edited
-
tags/1.0.1 (added)
-
tags/1.0.1/LICENSE.txt (added)
-
tags/1.0.1/README.txt (added)
-
tags/1.0.1/admin (added)
-
tags/1.0.1/admin/class-wpform-to-any-api-admin.php (added)
-
tags/1.0.1/admin/css (added)
-
tags/1.0.1/admin/css/wpform-to-any-api-admin.css (added)
-
tags/1.0.1/admin/images (added)
-
tags/1.0.1/admin/images/contact-form-to-any-api-icon.svg (added)
-
tags/1.0.1/admin/images/loading_icon.gif (added)
-
tags/1.0.1/admin/images/logs.png (added)
-
tags/1.0.1/admin/index.php (added)
-
tags/1.0.1/admin/js (added)
-
tags/1.0.1/admin/js/wpform-to-any-api-admin.js (added)
-
tags/1.0.1/admin/partials (added)
-
tags/1.0.1/admin/partials/wpform-to-any-api-admin-display-docs.php (added)
-
tags/1.0.1/admin/partials/wpform-to-any-api-admin-display.php (added)
-
tags/1.0.1/includes (added)
-
tags/1.0.1/includes/class-wpform-to-any-api-activator.php (added)
-
tags/1.0.1/includes/class-wpform-to-any-api-deactivator.php (added)
-
tags/1.0.1/includes/class-wpform-to-any-api-i18n.php (added)
-
tags/1.0.1/includes/class-wpform-to-any-api-loader.php (added)
-
tags/1.0.1/includes/class-wpform-to-any-api-log-table.php (added)
-
tags/1.0.1/includes/class-wpform-to-any-api.php (added)
-
tags/1.0.1/includes/index.php (added)
-
tags/1.0.1/index.php (added)
-
tags/1.0.1/languages (added)
-
tags/1.0.1/languages/wpform-to-any-api.pot (added)
-
tags/1.0.1/public (added)
-
tags/1.0.1/public/class-wpform-to-any-api-public.php (added)
-
tags/1.0.1/public/css (added)
-
tags/1.0.1/public/css/wpform-to-any-api-public.css (added)
-
tags/1.0.1/public/index.php (added)
-
tags/1.0.1/public/js (added)
-
tags/1.0.1/public/js/wpform-to-any-api-public.js (added)
-
tags/1.0.1/public/partials (added)
-
tags/1.0.1/public/partials/wpform-to-any-api-public-display.php (added)
-
tags/1.0.1/uninstall.php (added)
-
tags/1.0.1/wpform-to-any-api.php (added)
-
trunk/README.txt (modified) (2 diffs)
-
trunk/admin/class-wpform-to-any-api-admin.php (modified) (11 diffs)
-
trunk/admin/css/wpform-to-any-api-admin.css (modified) (28 diffs)
-
trunk/admin/images/logs.png (modified) (previous)
-
trunk/admin/js/wpform-to-any-api-admin.js (modified) (3 diffs)
-
trunk/admin/partials/wpform-to-any-api-admin-display-docs.php (modified) (9 diffs)
-
trunk/admin/partials/wpform-to-any-api-admin-display.php (modified) (13 diffs)
-
trunk/includes/class-wpform-to-any-api-log-table.php (modified) (2 diffs)
-
trunk/includes/class-wpform-to-any-api.php (modified) (2 diffs)
-
trunk/wpform-to-any-api.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
connect-wpform-to-any-api/trunk/README.txt
r3420669 r3430425 1 1 === Connect WPForm to Any API === 2 Contributors: itpathsolutions, mayur8991, thakordarshil, wpeople, jaiminp 2 Contributors: itpathsolutions, mayur8991, thakordarshil, wpeople, jaiminp, drashti16 3 3 Tags: wpform to api, wpform. api, contact form, crm, lead 4 4 Requires at least: 6.0 5 5 Tested up to: 6.9 6 6 Requires PHP: 7.4 7 Stable tag: 1.0. 07 Stable tag: 1.0.1 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 93 93 == Changelog == 94 94 95 = 1.0.1 = 96 97 *Release Date 1 January 2026* 98 99 * New: Added support for form tags along with WPForms fields. 100 * Fix: Resolved duplicate entries in the Status column. 101 * Fix: Fixed compatibility issue with the CF7 to Any API plugin. 102 95 103 = 1.0.0 = 96 104 -
connect-wpform-to-any-api/trunk/admin/class-wpform-to-any-api-admin.php
r3420669 r3430425 141 141 add_submenu_page( 142 142 'wpform_api', 143 __(' Logs', 'connect-wpform-to-any-api'),144 __(' Logs', 'connect-wpform-to-any-api'),143 __('API Logs', 'connect-wpform-to-any-api'), 144 __('API Logs', 'connect-wpform-to-any-api'), 145 145 'manage_options', 146 146 'wpformapi_logs', … … 183 183 // --- Add the TOP-LEVEL menu item with a float position --- 184 184 add_menu_page( 185 ' WPForm to API',185 'All API Integrations', 186 186 'WPForm to API', 187 187 'manage_options', … … 197 197 add_submenu_page( 198 198 $parent_slug, 199 'Add New API Form',200 'Add New WPForm API',199 'Add New Integration', 200 'Add New Integration', 201 201 'manage_options', 202 202 'post-new.php?post_type=wpform_api' … … 226 226 227 227 $labels = array( 228 'name' => _x('WPForm to A ny API', 'plural', 'connect-wpform-to-any-api'),229 'singular_name' => _x('WPForm to api', 'singular', 'connect-wpform-to-any-api'),228 'name' => _x('WPForm to API', 'plural', 'connect-wpform-to-any-api'), 229 'singular_name' => _x('WPForm to API', 'singular', 'connect-wpform-to-any-api'), 230 230 'menu_name' => _x('WPForm to API', 'admin menu', 'connect-wpform-to-any-api'), 231 231 'name_admin_bar' => _x('WPForm to API', 'admin bar', 'connect-wpform-to-any-api'), 232 'add_new' => _x('Add New WPForm API', 'add new', 'connect-wpform-to-any-api'),233 'add_new_item' => __('Add New WPForm API', 'connect-wpform-to-any-api'),234 'new_item' => __('New WPForm API', 'connect-wpform-to-any-api'),235 'edit_item' => __('Edit WPForm to Any API', 'connect-wpform-to-any-api'),236 'view_item' => __('View WPForm to Any API', 'connect-wpform-to-any-api'),237 'all_items' => __('All WPForm API', 'connect-wpform-to-any-api'),238 'not_found' => __('No WPForm APIfound.', 'connect-wpform-to-any-api'),232 'add_new' => _x('Add New Integration', 'add new', 'connect-wpform-to-any-api'), 233 'add_new_item' => __('Add New Integration', 'connect-wpform-to-any-api'), 234 'new_item' => __('New Integration', 'connect-wpform-to-any-api'), 235 'edit_item' => __('Edit Integration', 'connect-wpform-to-any-api'), 236 'view_item' => __('View Integration', 'connect-wpform-to-any-api'), 237 'all_items' => __('All API Integrations', 'connect-wpform-to-any-api'), 238 'not_found' => __('No API Integrations found.', 'connect-wpform-to-any-api'), 239 239 'register_meta_box_cb' => 'aps_metabox', 240 240 ); … … 304 304 $response = update_post_meta( $post_id , $options_key, $options_value ); 305 305 } 306 306 307 if($response){ 307 308 $status = 'true'; … … 436 437 'title' => __('Title', 'connect-wpform-to-any-api'), 437 438 'wpform' => __('Form Name','connect-wpform-to-any-api'), 438 'wpform_status' => __('Status','connect-wpform-to-any-api'),439 439 'date' => __('Date','connect-wpform-to-any-api'), 440 440 ); … … 480 480 public static function wpformapi_send_data_to_api($fields, $entry, $form_data, $entry_id){ 481 481 global $wpdb; 482 483 $form_title = $form_data['settings']['form_title']; 482 484 $wpfromapi_uploads_dir = trailingslashit( wp_upload_dir()['basedir'] ) . 'wpform-api-uploads'; 483 485 $form_id = (int)stripslashes($form_data['id']); … … 502 504 'compare' => '=', 503 505 ), 504 ),506 ) 505 507 ); 508 509 $current_post_id = !empty($entry['post_id']) ? $entry['post_id'] : 0; 510 // $post_id = $form_data['id']; // Keep for form_id reference 506 511 507 512 $the_query = new WP_Query($args); … … 524 529 525 530 } 526 531 // Handle wpform special tags dynamically 532 $predefined_tags = [ 533 '_user_ip' => isset($_SERVER['REMOTE_ADDR']) ? sanitize_text_field($_SERVER['REMOTE_ADDR']) : '', 534 '_date' => date_i18n(get_option('date_format')), 535 '_time' => date_i18n(get_option('time_format')), 536 '_submitted_date_time' => date_i18n(get_option('date_format')). ' ' .date_i18n(get_option('time_format')), 537 '_site_url' => home_url(), 538 '_form_id' => $form_id, 539 '_form_name' => $form_title, 540 '_submission_source_url' => $current_post_id ? esc_url(get_permalink($current_post_id)) : '', 541 '_post_id' => $current_post_id, 542 '_post_slug' => $current_post_id ? basename(get_permalink($current_post_id)) : '', 543 '_post_title' => $current_post_id ? get_the_title($current_post_id) : '', 544 ]; 545 546 // Predefined tags mapping 547 foreach ( $wpformapi_form_field as $key => $value ) { 548 if ( isset( $predefined_tags[$key] ) ) { 549 $api_post_array[$value] = $predefined_tags[$key]; 550 } 551 } 552 // print_r($api_post_array);exit(); 527 553 self::wpformapi_send_data_to_lead($api_post_array, $wpformapi_base_url, $wpformapi_input_type, $wpformapi_method, $form_id, get_the_ID(), $wpformapi_header_request, $posted_data); 528 554 } … … 719 745 * 720 746 * An Enable/Disable toggle switch in the "wpformstoanyapi_status" column. 721 * The associated Contact Form 7 form link in the "wpformstoanyapi_form" column.722 747 * */ 723 748 public function wpformstoanyapi_posts_custom_column ($column, $post_id ){ … … 733 758 </label>'; 734 759 break; 735 case 'wpformstoanyapi_form':736 $form_name = get_post_meta($post_id,'wpformstoanyapi_selected_form',true);737 if($form_name){738 echo '<a href="' . esc_url( site_url() . '/wp-admin/admin.php?page=wpcf7&post=' . $form_name . '&action=edit' ) . '" target="_blank">' . esc_html( get_the_title( $form_name ) ) . '</a>';739 }740 break;741 760 } 742 761 } -
connect-wpform-to-any-api/trunk/admin/css/wpform-to-any-api-admin.css
r3420669 r3430425 113 113 114 114 115 /* CF7Entries CSS*/116 . cf7_to_any_api_page_wpformapi_entries #wpwrap{115 /*WPForms Entries CSS*/ 116 .wpforms_to_any_api_page_wpformapi_entries #wpwrap{ 117 117 background-color: #F0F0F1 !important; 118 118 } 119 . cf7toanyapi_entries{119 .wpformstoanyapi_entries{ 120 120 margin-top: 40px; 121 121 } 122 . cf7toanyapi_select_form{122 .wpformstoanyapi_select_form{ 123 123 margin-right: 40px !important; 124 124 font-weight: 600; … … 127 127 vertical-align: middle; 128 128 } 129 . cf7toanyapi_forms{129 .wpformstoanyapi_forms{ 130 130 background-color: #fff !important; 131 131 background-image: none !important; … … 142 142 width: 200px !important; 143 143 } 144 . cf_entries .buttons-csv, .cf_entries .buttons-excel, .cf_entries .buttons-pdf, .cf_entries .buttons-print, .cf7toanyapi-btn-delete{144 .wpforms_entries .buttons-csv, .wpforms_entries .buttons-excel, .wpforms_entries .buttons-pdf, .wpforms_entries .buttons-print, .wpformstoanyapi-btn-delete{ 145 145 border: 1px solid #0073aa; 146 146 background-color: #0073aa !important; … … 152 152 cursor: pointer; 153 153 } 154 . cf_entries .dataTables_length, .cf_entries .dataTables_info{154 .wpforms_entries .dataTables_length, .wpforms_entries .dataTables_info{ 155 155 display: inline-block; 156 156 margin: 15px; 157 157 padding: 0 !important; 158 158 } 159 . cf_entries .dataTables_length label{159 .wpforms_entries .dataTables_length label{ 160 160 word-spacing: 5px; 161 161 } 162 . cf_entries .dataTables_filter, .cf_entries .dataTables_paginate{162 .wpforms_entries .dataTables_filter, .wpforms_entries .dataTables_paginate{ 163 163 display: flex; 164 164 float: right; 165 165 margin: 15px !important; 166 166 } 167 . cf_entries .cf7toanyapi_table{167 .wpforms_entries .wpformstoanyapi_table{ 168 168 border: 1px solid #c3c4c7; 169 169 background: #fff; … … 172 172 overflow-x: scroll; 173 173 } 174 . cf_entries .cf7toanyapi_table thead{174 .wpforms_entries .wpformstoanyapi_table thead{ 175 175 border: 1px solid #c3c4c7 !important; 176 176 } 177 . cf_entries .cf7toanyapi_table tr, .cf_entries .cf7toanyapi_table th, .cf_entries .cf7toanyapi_table td{font-size: 15px;}178 179 . cf7toanyapi_table_wrap {display: flex; align-items: center;}180 . cf7toanyapi_table_wrap .dt-buttons{width: 80%;}181 . cf7toanyapi_table_wrap .dataTables_length, .cf7toanyapi_table_wrap .cf7toanyapi_table_filter{width: 10%;}177 .wpforms_entries .wpformstoanyapi_table tr, .wpforms_entries .wpformstoanyapi_table th, .wpforms_entries .wpformstoanyapi_table td{font-size: 15px;} 178 179 .wpformstoanyapi_table_wrap {display: flex; align-items: center;} 180 .wpformstoanyapi_table_wrap .dt-buttons{width: 80%;} 181 .wpformstoanyapi_table_wrap .dataTables_length, .wpformstoanyapi_table_wrap .wpformstoanyapi_table_filter{width: 10%;} 182 182 183 183 .wpformapi-bottom-image { … … 208 208 .dataTables_info .select-info{display: none;} 209 209 /* Admin Css Improved -by drashti */ 210 211 .wpformapi_wrap .button.button-white { 212 background: #fff; 213 color: #189b9b; 214 border-color: #189b9b; 215 padding: 2px 15px; 216 font-size: 14px; 217 line-height: 30px; 218 } 219 210 220 .wpformapi_log_button{ 211 221 display: inline; … … 271 281 padding: 0 20px; 272 282 } 273 . cf7anyapi-json-preview-modal h2 {283 .wpforms-json-preview-modal h2 { 274 284 font-weight: 600 !important; 275 285 padding: 0 0 15px !important; … … 278 288 } 279 289 /*json preview*/ 280 . cf7anyapi-form-mapping-header {290 .wpforms-form-mapping-header { 281 291 display: flex 282 292 ; … … 289 299 } 290 300 291 . cf7anyapi-form-mapping-header span {301 .wpforms-form-mapping-header span { 292 302 cursor: pointer; 293 303 font-size: 15px; … … 297 307 border-radius: 4px; 298 308 } 299 . cf7anyapi-json-preview-modal {309 .wpforms-json-preview-modal { 300 310 display: none; 301 311 position: fixed; … … 309 319 } 310 320 311 . cf7anyapi-json-preview-modal-content {321 .wpforms-json-preview-modal-content { 312 322 background: #fff; 313 323 padding: 20px 25px; … … 322 332 scrollbar-width: none; 323 333 } 324 . cf7anyapi-json-preview-close {334 .wpforms-json-preview-close { 325 335 position: absolute; 326 336 top: 12px; … … 332 342 transition: color 0.2s ease-in-out; 333 343 } 334 . cf7anyapi-json-preview-close:hover {344 .wpforms-json-preview-close:hover { 335 345 color: #e63946; 336 346 } 337 #jsonPreviewOutput {347 #jsonPreviewOutputWpform { 338 348 background: rgb(24 155 155 / 5%); 339 349 padding: 15px; … … 345 355 border: 1px solid #ddd; 346 356 } 347 #jsonPreviewOutput pre {357 #jsonPreviewOutputWpform pre { 348 358 background: #fff !important; 349 359 padding: 15px !important; … … 359 369 } 360 370 361 . cf7anyapi-json-preview-modal {371 .wpforms-json-preview-modal { 362 372 display: none; 363 373 position: fixed; … … 371 381 } 372 382 373 . cf7anyapi-json-preview-modal-content {383 .wpforms-json-preview-modal-content { 374 384 background: #fff; 375 385 padding: 20px 25px; … … 495 505 } 496 506 .wpformapi_tooltip::after { 497 content: attr(data- cf7apitooltip);507 content: attr(data-wpformsapitooltip); 498 508 visibility: hidden; 499 509 opacity: 0; … … 761 771 /*CF7 Entries CSS*/ 762 772 763 /* CF7documentation CSS */764 .wpform _api_page_wpformapi_docs .contact_us {773 /* WPForms documentation CSS */ 774 .wpform-to-api_page_wpformapi_docs .contact_us { 765 775 margin: 12px; 766 776 } … … 768 778 background-color: #2271b1 !important; 769 779 } */ 770 .wpform _api_page_wpformapi_docs .cf7anyapi_doc, .wpform_api_page_wpformapi_docs .cf7anyapi_doc p{780 .wpform-to-api_page_wpformapi_docs .wpforms_doc, .wpform-to-api_page_wpformapi_docs .wpforms_doc p{ 771 781 /* font-size: 17px;*/ 772 782 font-size:14px; 773 783 } 774 .wpform _api_page_wpformapi_docs .cf7anyapi_doc{784 .wpform-to-api_page_wpformapi_docs .wpforms_doc{ 775 785 padding: 40px; 776 786 } 777 .wpform _api_page_wpformapi_docs .row{787 .wpform-to-api_page_wpformapi_docs .row{ 778 788 margin-top: 25px; 779 789 border: 1px solid #ccc; 780 790 } 781 .wpform _api_page_wpformapi_docs .column-tab-nav.tab{791 .wpform-to-api_page_wpformapi_docs .column-tab-nav.tab{ 782 792 border: 1px solid #e0e0e0; 783 793 padding: 0px; … … 787 797 background-color: #ddd; 788 798 } */ 789 .wpform _api_page_wpformapi_docs .col-7.tab{799 .wpform-to-api_page_wpformapi_docs .col-7.tab{ 790 800 border: 1px solid #ccc; 791 801 padding: 20px; 792 802 } 793 .wpform _api_page_wpformapi_docs .col-3.image{803 .wpform-to-api_page_wpformapi_docs .col-3.image{ 794 804 padding-left: inherit; 795 805 padding-right: inherit; 796 806 } 797 .wpform _api_page_wpformapi_docs .contact_us.contact_image{807 .wpform-to-api_page_wpformapi_docs .contact_us.contact_image{ 798 808 margin: 0px; 799 809 } 800 .wpform _api_page_wpformapi_docs .contact_us.contact_image {810 .wpform-to-api_page_wpformapi_docs .contact_us.contact_image { 801 811 width: 100%; 802 812 } 803 813 804 814 805 .wpform _api_page_wpformapi_docs .cf7anyapi_full_width pre { margin:15px 15px; }806 .wpform _api_page_wpformapi_docs .cf7anyapi_full_width ol li{margin-bottom:15px; }807 808 . cf7-any-api-modal {815 .wpform-to-api_page_wpformapi_docs .wpforms_full_width pre { margin:15px 15px; } 816 .wpform-to-api_page_wpformapi_docs .wpforms_full_width ol li{margin-bottom:15px; } 817 818 .wpforms-any-api-modal { 809 819 position: fixed; 810 820 height: 100%; … … 816 826 background: rgba(0,0,0,.8); 817 827 } 818 . cf7-any-api-modal .cf7-any-api-modal-dialog {828 .wpforms-any-api-modal .wpforms-any-api-modal-dialog { 819 829 background: transparent; 820 830 position: absolute; … … 825 835 transform: translate(-50%, -50%); 826 836 } 827 . cf7-any-api-modal .cf7-any-api-modal-header {837 .wpforms-any-api-modal .wpforms-any-api-modal-header { 828 838 border-bottom: #eee solid 1px; 829 839 background: #fbfbfb; … … 832 842 margin-bottom: -10px; 833 843 } 834 . cf7-any-api-modal .cf7-any-api-modal-body, .cf7-any-api-modal .cf7-any-api-modal-footer {844 .wpforms-any-api-modal .wpforms-any-api-modal-body, .wpforms-any-api-modal .wpforms-any-api-modal-footer { 835 845 border: 0; 836 846 background: #fefefe; 837 847 padding: 20px; 838 848 } 839 . cf7-any-api-modal input[type="radio"]:checked ~ textarea {849 .wpforms-any-api-modal input[type="radio"]:checked ~ textarea { 840 850 display: block; 841 851 width: 100%; … … 844 854 height: 100px; 845 855 } 846 /* . cf7-any-api-modal .reason textarea{856 /* .wpforms-any-api-modal .reason textarea{ 847 857 display: none; 848 858 } */ 849 . cf7-any-api-modal .cf7-any-api-modal-header h4 {859 .wpforms-any-api-modal .wpforms-any-api-modal-header h4 { 850 860 margin: 0; 851 861 padding: 0; … … 858 868 -webkit-font-smoothing: antialiased; 859 869 } 860 . cf7-any-api-modal h3 {870 .wpforms-any-api-modal h3 { 861 871 margin-top: 0; 862 872 font-size: 15px; … … 865 875 color: #515962; 866 876 } 867 . cf7-any-api-modal h3 strong {877 .wpforms-any-api-modal h3 strong { 868 878 font-weight: 700; 869 879 } 870 . cf7-any-api-modal-footer {880 .wpforms-any-api-modal-footer { 871 881 border-top: #eee solid 1px !important; 872 882 text-align: right; 873 883 } 874 . cf7-any-api-modal .reason input[type="email"] {884 .wpforms-any-api-modal .reason input[type="email"] { 875 885 margin-top: 8px; 876 886 width: 100%; 877 887 } 878 ul# cf7-any-api-list li{888 ul#wpforms-any-api-list li{ 879 889 margin-bottom: 10px; 880 890 } 881 ul# cf7-any-api-list li label span {891 ul#wpforms-any-api-list li label span { 882 892 font-size: 13px; 883 893 color: #515962; 884 894 } 885 ul# cf7-any-api-list li.reason.email span {895 ul#wpforms-any-api-list li.reason.email span { 886 896 font-weight: 700; 887 897 margin-right: 32px; 888 898 } 889 ul# cf7-any-api-list li.reason.email {899 ul#wpforms-any-api-list li.reason.email { 890 900 margin-top: 20px; 891 901 } 892 ul# cf7-any-api-list {902 ul#wpforms-any-api-list { 893 903 margin-bottom: 13px; 894 904 } … … 944 954 border-radius: 5px; 945 955 } 946 . cf7anyapi_doc .nav.nav-pills .nav-link {956 .wpforms_doc .nav.nav-pills .nav-link { 947 957 color: #007cba; 948 958 background-color: transparent; … … 958 968 box-shadow: inset 5px 0 0 0 transparent; 959 969 } 960 . cf7anyapi_doc .nav.nav-pills .nav-link:hover{970 .wpforms_doc .nav.nav-pills .nav-link:hover{ 961 971 background-color: #f6f7f7; 962 972 } 963 . cf7anyapi_doc .nav.nav-pills .nav-link:focus {973 .wpforms_doc .nav.nav-pills .nav-link:focus { 964 974 box-shadow: none; 965 975 } 966 976 967 . cf7anyapi_doc .nav.nav-pills .nav-link.active {977 .wpforms_doc .nav.nav-pills .nav-link.active { 968 978 box-shadow: inset 5px 0 0 0 #007cba; 969 979 transition: box-shadow .1s linear; -
connect-wpform-to-any-api/trunk/admin/js/wpform-to-any-api-admin.js
r3420669 r3430425 31 31 $(document).ready(function(){ 32 32 33 jQuery('#wpformapi_predefined_tag_select option:disabled').prop('disabled', false); 33 34 // On click of Next button, trigger the main Update/Publish button 34 35 $(document).on('click', '#wpformapi_submit', function(e) { … … 75 76 76 77 // additional js for improved design - by drashti 78 79 80 // Add predefined tag 81 jQuery('#wpformapi_add_predefined_tag').on('click', function(){ 82 var tag = jQuery('#wpformapi_predefined_tag_select').val(); 83 if(tag && jQuery('#wpformapi-form-fields').find('[data-tag="'+tag+'"]').length === 0){ 84 var cleanLabel = tag.replace(/^_/, '').replace(/_/g, ' '); 85 var html = '<div class="wpformapi_field" data-tag="'+tag+'">' + 86 '<label for="wpformapi_'+tag+'">'+tag+'</label>' + 87 '<input type="text" ' + 88 'id="wpformapi_'+tag+'" ' + 89 'name="wpformapi_form_field['+tag+']" ' + 90 'data-basetype="textarea" ' + 91 'placeholder="Enter your API mapping key">' + 92 '<button type="button" class="button wpformapi_remove_predefined_tag"><svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" width="512" height="512" x="0" y="0" viewBox="0 0 511.76 511.76" style="enable-background:new 0 0 512 512" xml:space="preserve" class=""><g><path d="M436.896 74.869c-99.84-99.819-262.208-99.819-362.048 0-99.797 99.819-99.797 262.229 0 362.048 49.92 49.899 115.477 74.837 181.035 74.837s131.093-24.939 181.013-74.837c99.819-99.818 99.819-262.229 0-362.048zm-75.435 256.448c8.341 8.341 8.341 21.824 0 30.165a21.275 21.275 0 0 1-15.083 6.251 21.277 21.277 0 0 1-15.083-6.251l-75.413-75.435-75.392 75.413a21.348 21.348 0 0 1-15.083 6.251 21.277 21.277 0 0 1-15.083-6.251c-8.341-8.341-8.341-21.845 0-30.165l75.392-75.413-75.413-75.413c-8.341-8.341-8.341-21.845 0-30.165 8.32-8.341 21.824-8.341 30.165 0l75.413 75.413 75.413-75.413c8.341-8.341 21.824-8.341 30.165 0 8.341 8.32 8.341 21.824 0 30.165l-75.413 75.413 75.415 75.435z" fill="#189b9b" opacity="1" data-original="#189b9b" class=""></path></g></svg> Remove</button>' + 93 '</div>' 94 95 if( jQuery('#wpformapi-form-fields').text().trim() === 'No Fields Found for Selected Form.' || jQuery('#wpformapi-form-fields').text().trim() === 'Select Your Contact Form'){ 96 jQuery('#wpformapi-form-fields').empty(); 97 } 98 let lastField = jQuery('#wpformapi-form-fields .wpformapi_field:last'); 99 100 if (lastField.length) { 101 jQuery(html).insertAfter(lastField); 102 } else { 103 jQuery('#wpformapi-form-fields').append(html); 104 } 105 106 jQuery('#wpformapi_predefined_tag_select option[value="'+tag+'"]').prop('disabled', true); 107 } 108 }); 109 110 // Remove predefined tag 111 jQuery(document).on('click', '.wpformapi_remove_predefined_tag', function(){ 112 var tag = jQuery(this).parent('.wpformapi_field').data('tag'); 113 jQuery(this).closest('.wpformapi_field').remove(); 114 jQuery('#wpformapi_predefined_tag_select option[value="'+tag+'"]').prop('disabled', false); 115 if(jQuery('#wpformapi-form-fields').text().trim() == ''){ 116 jQuery('#wpformapi-form-fields').append("No Fields Found for Selected Form."); 117 } 118 }); 119 120 // Disable options on page load if tag already exists 121 jQuery('#wpformapi-form-fields .wpformapi_field').each(function(){ 122 var tag = jQuery(this).data('tag'); 123 if(tag){ 124 jQuery('#wpformapi_predefined_tag_select option[value="'+tag+'"]').prop('disabled', true); 125 } 126 }); 127 128 129 130 77 131 //json Preview Model 78 var modal =jQuery('#jsonPreviewModal ');79 jQuery('#jsonPreviewBtn ').on('click', function(){132 var modal =jQuery('#jsonPreviewModalWpform'); 133 jQuery('#jsonPreviewBtnWpform').on('click', function(){ 80 134 console.log('clicked'); 81 jQuery('#jsonPreviewOutput ').html('');135 jQuery('#jsonPreviewOutputWpform').html(''); 82 136 var apiUrl = jQuery('#wpformapi_base_url').val() || ''; 83 137 var method = jQuery('#wpformapi_method').val() || ''; … … 104 158 `; 105 159 106 jQuery('#jsonPreviewOutput ').html(html);160 jQuery('#jsonPreviewOutputWpform').html(html); 107 161 modal.show(); 108 162 }); 109 jQuery('. cf7anyapi-json-preview-close').on('click', function(){163 jQuery('.wpforms-json-preview-close').on('click', function(){ 110 164 modal.hide(); 111 165 }); -
connect-wpform-to-any-api/trunk/admin/partials/wpform-to-any-api-admin-display-docs.php
r3276754 r3430425 1 <!-- CF7 to any API Documentatiom-->1 <!-- WPForms to any API Documentation --> 2 2 <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/css/bootstrap.min.css" > 3 3 <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/js/bootstrap.min.js"></script> 4 <div class=" cf7anyapi_doc">4 <div class="wpforms_doc"> 5 5 <h3><?php esc_html_e( 'WP Form To Any API Documentation', 'connect-wpform-to-any-api' ); ?></h3> 6 6 <div class="row"> … … 11 11 <a class="nav-link tab-index-3" id="v-pills-logs-tab" data-toggle="pill" href="#v-pills-logs" role="tab" aria-controls="v-pills-logs" aria-selected="false"><div class="tab-index"></div><?php esc_html_e( 'Logs', 'connect-wpform-to-any-api' ); ?></a> 12 12 <a class="nav-link tab-index-4" id="v-pills-json-format-tab" data-toggle="pill" href="#v-pills-json-format" role="tab" aria-controls="v-pills-json-format" aria-selected="false"><div class="tab-index"></div><?php esc_html_e( 'Supported JSON Format', 'connect-wpform-to-any-api' ); ?></a> 13 <a class="nav-link tab-index-5" id="v-pills-contact-us-tab" data-toggle="pill" href="#v-pills-contact-us" role="tab" aria-controls="v-pills-contact-us" aria-selected="false"><div class="tab-index"></div><?php esc_html_e( 'Contact Us', 'connect-wpform-to-any-api' ); ?></a> 14 <a class="nav-link tab-index-6" id="v-pills-other-plugins-tab" data-toggle="pill" href="#v-pills-other-plugins" role="tab" aria-controls="v-pills-other-plugins" aria-selected="false"><div class="tab-index"></div><?php esc_html_e( 'Our Other Plugins', 'connect-wpform-to-any-api' ); ?></a> 13 <a class="nav-link tab-index-5" id="v-pills-pre-defined-tags-tab" data-toggle="pill" href="#v-pills-pre-defined-tags" role="tab" aria-controls="v-pills-pre-defined-tags" aria-selected="false"> 14 <div class="tab-index"></div> 15 <?php esc_html_e( 'Pre Defined Tags', 'connect-wpform-to-any-api' ); ?> 16 </a> 17 <a class="nav-link tab-index-6" id="v-pills-contact-us-tab" data-toggle="pill" href="#v-pills-contact-us" role="tab" aria-controls="v-pills-contact-us" aria-selected="false"><div class="tab-index"></div><?php esc_html_e( 'Contact Us', 'connect-wpform-to-any-api' ); ?></a> 18 <a class="nav-link tab-index-7" id="v-pills-other-plugins-tab" data-toggle="pill" href="#v-pills-other-plugins" role="tab" aria-controls="v-pills-other-plugins" aria-selected="false"><div class="tab-index"></div><?php esc_html_e( 'Our Other Plugins', 'connect-wpform-to-any-api' ); ?></a> 19 15 20 </div> 16 21 </div> … … 18 23 <div class="tab-content" id="v-pills-tabContent"> 19 24 <!-- cf7 API --> 20 <div class="tab-pane fade show active cf7anyapi_full_width" id="v-pills-home" role="tabpanel" aria-labelledby="v-pills-home-tab">25 <div class="tab-pane fade show active wpforms_full_width" id="v-pills-home" role="tabpanel" aria-labelledby="v-pills-home-tab"> 21 26 <h5 class="tab-title"><?php esc_html_e( 'Guide to Adding a New WP Form API Integration', 'connect-wpform-to-any-api' ); ?></h5> 22 27 … … 117 122 </div> 118 123 <!-- Logs --> 119 <div class="tab-pane fade cf7anyapi_full_width" id="v-pills-logs" role="tabpanel" aria-labelledby="v-pills-logs-tab">124 <div class="tab-pane fade wpforms_full_width" id="v-pills-logs" role="tabpanel" aria-labelledby="v-pills-logs-tab"> 120 125 <h5 class="tab-title"><?php esc_html_e( 'Logs', 'connect-wpform-to-any-api' ); ?></h5> 121 126 <ol> … … 130 135 131 136 <!-- Supported JSON Format --> 132 <div class="tab-pane fade cf7anyapi_full_width" id="v-pills-json-format" role="tabpanel" aria-labelledby="v-pills-json-format-tab">137 <div class="tab-pane fade wpforms_full_width" id="v-pills-json-format" role="tabpanel" aria-labelledby="v-pills-json-format-tab"> 133 138 <h5 class="tab-title"><?php esc_html_e( 'Supported JSON format', 'connect-wpform-to-any-api' ); ?></h5> 134 139 <ol> … … 145 150 </li> 146 151 147 <li><?php echo wp_kses(__( '<b>Nested JSON Format Required Plugin Customization! </b><a href="https://www.contactformtoapi.com/#contact_us" class=" cf7_to_any_api_doc_link" target="_blank"><strong>Connect Us For Paid Customization Service</strong></a>', 'connect-wpform-to-any-api' ), array('b' => array(), 'a' => array('href' => array(), 'class' => array(), 'target' => array() ), 'strong' => array() ) ); ?></br>152 <li><?php echo wp_kses(__( '<b>Nested JSON Format Required Plugin Customization! </b><a href="https://www.contactformtoapi.com/#contact_us" class="wpforms_to_any_api_doc_link" target="_blank"><strong>Connect Us For Paid Customization Service</strong></a>', 'connect-wpform-to-any-api' ), array('b' => array(), 'a' => array('href' => array(), 'class' => array(), 'target' => array() ), 'strong' => array() ) ); ?></br> 148 153 <pre> 149 154 { … … 164 169 <!-- CF7 Hidden field --> 165 170 171 <!-- Pre Defined Tags --> 172 <div class="tab-pane fade cf7anyapi_full_width" id="v-pills-pre-defined-tags" role="tabpanel" aria-labelledby="v-pills-pre-defined-tags"> 173 <h5 class="tab-title"><?php esc_html_e( 'Available Predefined Tags', 'connect-wpform-to-any-api' ); ?></h5> 174 <br> 175 <p> 176 <?php esc_html_e( 'These predefined tags can be used directly in your JSON payload. When the form is submitted, their values are automatically replaced with dynamic data (e.g., user IP, page URL, submission date, etc.). This ensures real-time data is passed without manual input.', 'connect-wpform-to-any-api' ); ?> 177 </p> 178 <ul> 179 <li><strong><?php esc_html_e( '[_user_ip]', 'connect-wpform-to-any-api' ); ?></strong> – <?php esc_html_e( 'Captures the visitor\'s IP address at the time of form submission.', 'connect-wpform-to-any-api' ); ?></li> 180 <li><strong><?php esc_html_e( '[_date]', 'connect-wpform-to-any-api' ); ?></strong> – <?php esc_html_e( 'Displays the submission date (based on your WordPress Settings → General → Date Format).', 'connect-wpform-to-any-api' ); ?></li> 181 <li><strong><?php esc_html_e( '[_time]', 'connect-wpform-to-any-api' ); ?></strong> – <?php esc_html_e( 'Displays the submission time (based on your WordPress Settings → General → Time Format).', 'connect-wpform-to-any-api' ); ?></li> 182 <li><strong><?php esc_html_e( '[_submitted_date_time]', 'connect-wpform-to-any-api' ); ?></strong> – <?php esc_html_e( 'Displays both date and time of submission (follows your WordPress Date & Time Settings).', 'connect-wpform-to-any-api' ); ?></li> 183 <li><strong><?php esc_html_e( '[_site_url]', 'connect-wpform-to-any-api' ); ?></strong> – <?php esc_html_e( 'The home URL of your website.', 'connect-wpform-to-any-api' ); ?></li> 184 <li><strong><?php esc_html_e( '[_submission_source_url]', 'connect-wpform-to-any-api' ); ?></strong> – <?php esc_html_e( 'The URL of the page where the form was submitted.', 'connect-wpform-to-any-api' ); ?></li> 185 <li><strong><?php esc_html_e( '[_post_id]', 'connect-wpform-to-any-api' ); ?></strong> – <?php esc_html_e( 'The ID of the current post or page where the form is placed.', 'connect-wpform-to-any-api' ); ?></li> 186 <li><strong><?php esc_html_e( '[_post_slug]', 'connect-wpform-to-any-api' ); ?></strong> – <?php esc_html_e( 'The slug (URL-friendly name) of the current post or page.', 'connect-wpform-to-any-api' ); ?></li> 187 <li><strong><?php esc_html_e( '[_post_title]', 'connect-wpform-to-any-api' ); ?></strong> – <?php esc_html_e( 'The title of the current post or page where the form is located.', 'connect-wpform-to-any-api' ); ?></li> 188 <li><strong><?php esc_html_e( '[_form_id]', 'connect-wpform-to-any-api' ); ?></strong> – <?php esc_html_e( 'The unique ID of the Wpform.', 'connect-wpform-to-any-api' ); ?></li> 189 <li><strong><?php esc_html_e( '[_form_name]', 'connect-wpform-to-any-api' ); ?></strong> – <?php esc_html_e( 'The name/title of the Wpform.', 'connect-wpform-to-any-api' ); ?></li> 190 <li><strong><?php esc_html_e( '[_http_referer]', 'connect-wpform-to-any-api' ); ?></strong> – <?php esc_html_e( 'The previous page URL that referred the user to the form page.', 'connect-wpform-to-any-api' ); ?></li> 191 <li><strong><?php esc_html_e( '[_browser_info]', 'connect-wpform-to-any-api' ); ?></strong> – <?php esc_html_e( 'Captures the user’s browser and operating system information (User Agent).', 'connect-wpform-to-any-api' ); ?></li> 192 <li><strong><?php esc_html_e( '[_server_name]', 'connect-wpform-to-any-api' ); ?></strong> – <?php esc_html_e( 'The server hostname where your WordPress website is hosted.', 'connect-wpform-to-any-api' ); ?></li> 193 </ul> 194 </div> 195 166 196 <!-- video tutorial --> 167 <div class="tab-pane fade cf7anyapi_full_width" id="v-pills-video" role="tabpanel" aria-labelledby="v-pills-video-tab">197 <div class="tab-pane fade wpforms_full_width" id="v-pills-video" role="tabpanel" aria-labelledby="v-pills-video-tab"> 168 198 <h5 class="tab-title"><?php esc_html_e( 'WP Form to any API Video Tutorial', 'connect-wpform-to-any-api' ); ?></h5> 169 199 <div class="iframe-wrap embed-responsive embed-responsive-16by9"> 170 <iframe class="embed-responsive-item" src="https://www.youtube.com/embed/ 1K-JdXwDH_k" title="<?php esc_attr_e( 'YouTube video player', 'connect-wpform-to-any-api' ); ?>" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>200 <iframe class="embed-responsive-item" src="https://www.youtube.com/embed/5mlvMXaWDC8?si=voIIWfAYnfGH0T1o" title="<?php esc_attr_e( 'YouTube video player', 'connect-wpform-to-any-api' ); ?>" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe> 171 201 </div> 172 202 </div> … … 175 205 176 206 <!-- contact us --> 177 <div class="tab-pane fade cf7anyapi_full_width" id="v-pills-contact-us" role="tabpanel" aria-labelledby="v-pills-contact-us-tab">207 <div class="tab-pane fade wpforms_full_width" id="v-pills-contact-us" role="tabpanel" aria-labelledby="v-pills-contact-us-tab"> 178 208 <h5 class="tab-title"><?php esc_html_e( 'Contact Us', 'connect-wpform-to-any-api' ); ?></h5><br> 179 209 <h5><?php echo wp_kses(__( 'Email : <a href="mailto:support@contactformtoapi.com">support@contactformtoapi.com</a>', 'connect-wpform-to-any-api' ), array('a' => array('href' => array() ) ) ); ?></h5> … … 182 212 183 213 <!-- other plugins --> 184 <div class="tab-pane fade cf7anyapi_full_width" id="v-pills-other-plugins" role="tabpanel" aria-labelledby="v-pills-other-plugins-tab">214 <div class="tab-pane fade wpforms_full_width" id="v-pills-other-plugins" role="tabpanel" aria-labelledby="v-pills-other-plugins-tab"> 185 215 <h5 class="tab-title"><?php esc_html_e( 'Our Other Plugins', 'connect-wpform-to-any-api' ); ?></h5><br> 186 216 -
connect-wpform-to-any-api/trunk/admin/partials/wpform-to-any-api-admin-display.php
r3420669 r3430425 18 18 $wpformapi_options = $wpformapi_object->wpform_to_any_api_get_options(); 19 19 20 21 20 $selected_form = (empty($wpformapi_options['wpformapi_selected_form']) ? '' : $wpformapi_options['wpformapi_selected_form']); 22 21 $wpformapi_base_url = (empty($wpformapi_options['wpformapi_base_url']) ? '' : $wpformapi_options['wpformapi_base_url']); … … 25 24 $wpformapi_form_field = (empty($wpformapi_options['wpformapi_form_field']) ? '' : $wpformapi_options['wpformapi_form_field']); 26 25 $wpformapi_header_request = (empty($wpformapi_options['wpformapi_header_request']) ? '' : $wpformapi_options['wpformapi_header_request']); 26 27 $predefined_tags = $wpformapi_object->get_predefined_tags(); 28 $predefined_keys = array_keys( $predefined_tags ); 27 29 28 30 if(!class_exists('WPForms')){ ?> … … 62 64 <li><a href="javascript:;"><?php esc_html_e( 'Map Form Fields', 'connect-wpform-to-any-api' ); ?></a></li> 63 65 </ul> 64 <a href="javascript:;" class="button button-primary json-preview" id="jsonPreviewBtn "><?php esc_html_e( 'Show API Payload', 'connect-wpform-to-any-api' ); ?></a>66 <a href="javascript:;" class="button button-primary json-preview" id="jsonPreviewBtnWpform"><?php esc_html_e( 'Show API Payload', 'connect-wpform-to-any-api' ); ?></a> 65 67 </div> 66 68 <!-- Step 1: API Setup --> … … 69 71 <div class="wpformapi_field"> 70 72 <label for="wpformapi_base_url"><?php esc_html_e( 'API Endpoint URL', 'connect-wpform-to-any-api' ); ?> 71 <div class="wpformapi_tooltip" data- cf7apitooltip="<?php esc_html_e( 'Provide the URL where requests will be sent', 'connect-wpform-to-any-api' ); ?>"> <svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" width="512" height="512" x="0" y="0" viewBox="0 0 20 20" xml:space="preserve" class=""><g><path d="M10 1a8.987 8.987 0 0 0-7.921 13.257l-1.037 3.455A1 1 0 0 0 2 19a1.019 1.019 0 0 0 .288-.042l3.455-1.037A9 9 0 1 0 10 1zm0 4a1 1 0 1 1-1 1 1 1 0 0 1 1-1zm1 10h-1a1 1 0 0 1-1-1v-4a1 1 0 0 1 0-2h1a1 1 0 0 1 1 1v4a1 1 0 0 1 0 2z" fill="#189b9b" opacity="1" data-original="#000000" class=""></path></g></svg></div>73 <div class="wpformapi_tooltip" data-wpformsapitooltip="<?php esc_html_e( 'Provide the URL where requests will be sent', 'connect-wpform-to-any-api' ); ?>"> <svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" width="512" height="512" x="0" y="0" viewBox="0 0 20 20" xml:space="preserve" class=""><g><path d="M10 1a8.987 8.987 0 0 0-7.921 13.257l-1.037 3.455A1 1 0 0 0 2 19a1.019 1.019 0 0 0 .288-.042l3.455-1.037A9 9 0 1 0 10 1zm0 4a1 1 0 1 1-1 1 1 1 0 0 1 1-1zm1 10h-1a1 1 0 0 1-1-1v-4a1 1 0 0 1 0-2h1a1 1 0 0 1 1 1v4a1 1 0 0 1 0 2z" fill="#189b9b" opacity="1" data-original="#000000" class=""></path></g></svg></div> 72 74 </label> 73 75 <input type="text" id="wpformapi_base_url" name="wpformapi_base_url" value="<?php echo esc_url($wpformapi_base_url); ?>" placeholder="<?php esc_attr_e( 'API Endpoint URL', 'connect-wpform-to-any-api' ); ?>" required> … … 76 78 <div class="wpformapi_full_width"> 77 79 <label for="wpformapi_header_request"><?php esc_html_e( 'Request Headers', 'connect-wpform-to-any-api' ); ?> 78 <div class="wpformapi_tooltip" data- cf7apitooltip="<?php esc_html_e( 'Custom headers to send with the API request.', 'connect-wpform-to-any-api' ); ?>"> <svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" width="512" height="512" x="0" y="0" viewBox="0 0 20 20" xml:space="preserve" class=""><g><path d="M10 1a8.987 8.987 0 0 0-7.921 13.257l-1.037 3.455A1 1 0 0 0 2 19a1.019 1.019 0 0 0 .288-.042l3.455-1.037A9 9 0 1 0 10 1zm0 4a1 1 0 1 1-1 1 1 1 0 0 1 1-1zm1 10h-1a1 1 0 0 1-1-1v-4a1 1 0 0 1 0-2h1a1 1 0 0 1 1 1v4a1 1 0 0 1 0 2z" fill="#189b9b" opacity="1" data-original="#000000" class=""></path></g></svg></div><span class="sample_header"><?php esc_html_e( 'Add sample header', 'connect-wpform-to-any-api' ); ?></span>80 <div class="wpformapi_tooltip" data-wpformsapitooltip="<?php esc_html_e( 'Custom headers to send with the API request.', 'connect-wpform-to-any-api' ); ?>"> <svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" width="512" height="512" x="0" y="0" viewBox="0 0 20 20" xml:space="preserve" class=""><g><path d="M10 1a8.987 8.987 0 0 0-7.921 13.257l-1.037 3.455A1 1 0 0 0 2 19a1.019 1.019 0 0 0 .288-.042l3.455-1.037A9 9 0 1 0 10 1zm0 4a1 1 0 1 1-1 1 1 1 0 0 1 1-1zm1 10h-1a1 1 0 0 1-1-1v-4a1 1 0 0 1 0-2h1a1 1 0 0 1 1 1v4a1 1 0 0 1 0 2z" fill="#189b9b" opacity="1" data-original="#000000" class=""></path></g></svg></div><span class="sample_header"><?php esc_html_e( 'Add sample header', 'connect-wpform-to-any-api' ); ?></span> 79 81 </label> 80 82 <textarea id="wpformapi_header_request" data-sample="<?php esc_attr_e( 'Authorization: Bearer YOUR_API_KEY … … 89 91 <div class="wpformapi_field"> 90 92 <label for="wpformapi_input_type"><?php esc_html_e( 'Request Body Type', 'connect-wpform-to-any-api' ); ?> 91 <div class="wpformapi_tooltip" data- cf7apitooltip="<?php esc_html_e( 'Choose how your form data is sent to the API.', 'connect-wpform-to-any-api' ); ?>"> <svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" width="512" height="512" x="0" y="0" viewBox="0 0 20 20" xml:space="preserve" class=""><g><path d="M10 1a8.987 8.987 0 0 0-7.921 13.257l-1.037 3.455A1 1 0 0 0 2 19a1.019 1.019 0 0 0 .288-.042l3.455-1.037A9 9 0 1 0 10 1zm0 4a1 1 0 1 1-1 1 1 1 0 0 1 1-1zm1 10h-1a1 1 0 0 1-1-1v-4a1 1 0 0 1 0-2h1a1 1 0 0 1 1 1v4a1 1 0 0 1 0 2z" fill="#189b9b" opacity="1" data-original="#000000" class=""></path></g></svg></div>93 <div class="wpformapi_tooltip" data-wpformsapitooltip="<?php esc_html_e( 'Choose how your form data is sent to the API.', 'connect-wpform-to-any-api' ); ?>"> <svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" width="512" height="512" x="0" y="0" viewBox="0 0 20 20" xml:space="preserve" class=""><g><path d="M10 1a8.987 8.987 0 0 0-7.921 13.257l-1.037 3.455A1 1 0 0 0 2 19a1.019 1.019 0 0 0 .288-.042l3.455-1.037A9 9 0 1 0 10 1zm0 4a1 1 0 1 1-1 1 1 1 0 0 1 1-1zm1 10h-1a1 1 0 0 1-1-1v-4a1 1 0 0 1 0-2h1a1 1 0 0 1 1 1v4a1 1 0 0 1 0 2z" fill="#189b9b" opacity="1" data-original="#000000" class=""></path></g></svg></div> 92 94 </label> 93 95 <select id="wpformapi_input_type" name="wpformapi_input_type" required> … … 98 100 <div class="wpformapi_field"> 99 101 <label for="wpformapi_method"><?php esc_html_e( 'Request Method', 'connect-wpform-to-any-api' ); ?> 100 <div class="wpformapi_tooltip" data- cf7apitooltip="<?php esc_html_e( 'Select the action for sending your form data.', 'connect-wpform-to-any-api' ); ?>"> <svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" width="512" height="512" x="0" y="0" viewBox="0 0 20 20" xml:space="preserve" class=""><g><path d="M10 1a8.987 8.987 0 0 0-7.921 13.257l-1.037 3.455A1 1 0 0 0 2 19a1.019 1.019 0 0 0 .288-.042l3.455-1.037A9 9 0 1 0 10 1zm0 4a1 1 0 1 1-1 1 1 1 0 0 1 1-1zm1 10h-1a1 1 0 0 1-1-1v-4a1 1 0 0 1 0-2h1a1 1 0 0 1 1 1v4a1 1 0 0 1 0 2z" fill="#189b9b" opacity="1" data-original="#000000" class=""></path></g></svg></div>102 <div class="wpformapi_tooltip" data-wpformsapitooltip="<?php esc_html_e( 'Select the action for sending your form data.', 'connect-wpform-to-any-api' ); ?>"> <svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" width="512" height="512" x="0" y="0" viewBox="0 0 20 20" xml:space="preserve" class=""><g><path d="M10 1a8.987 8.987 0 0 0-7.921 13.257l-1.037 3.455A1 1 0 0 0 2 19a1.019 1.019 0 0 0 .288-.042l3.455-1.037A9 9 0 1 0 10 1zm0 4a1 1 0 1 1-1 1 1 1 0 0 1 1-1zm1 10h-1a1 1 0 0 1-1-1v-4a1 1 0 0 1 0-2h1a1 1 0 0 1 1 1v4a1 1 0 0 1 0 2z" fill="#189b9b" opacity="1" data-original="#000000" class=""></path></g></svg></div> 101 103 </label> 102 104 <select id="wpformapi_method" name="wpformapi_method" required> … … 119 121 <div class="wpformapi_field"> 120 122 <label for="wpformapi_selected_form"><?php esc_html_e( 'Select WPForm', 'connect-wpform-to-any-api' ); ?> 121 <div class="wpformapi_tooltip" data- cf7apitooltip="<?php esc_html_e( 'Choose which WPForm should send data.', 'connect-wpform-to-any-api' ); ?>">123 <div class="wpformapi_tooltip" data-wpformsapitooltip="<?php esc_html_e( 'Choose which WPForm should send data.', 'connect-wpform-to-any-api' ); ?>"> 122 124 <svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" width="512" height="512" x="0" y="0" viewBox="0 0 20 20" xml:space="preserve" class=""><g><path d="M10 1a8.987 8.987 0 0 0-7.921 13.257l-1.037 3.455A1 1 0 0 0 2 19a1.019 1.019 0 0 0 .288-.042l3.455-1.037A9 9 0 1 0 10 1zm0 4a1 1 0 1 1-1 1 1 1 0 0 1 1-1zm1 10h-1a1 1 0 0 1-1-1v-4a1 1 0 0 1 0-2h1a1 1 0 0 1 1 1v4a1 1 0 0 1 0 2z" fill="#189b9b" opacity="1" data-original="#000000" class=""></path></g></svg> 123 125 </div> … … 145 147 <label style="font-size: 16px; font-weight: 500; text-transform: capitalize;"> 146 148 <?php esc_html_e( 'Map Form Fields to API Keys', 'connect-wpform-to-any-api' ); ?> 147 <div class="wpformapi_tooltip" data- cf7apitooltip="<?php esc_html_e( 'Match your form fields with the API’s fields.', 'connect-wpform-to-any-api' ); ?>">149 <div class="wpformapi_tooltip" data-wpformsapitooltip="<?php esc_html_e( 'Match your form fields with the API’s fields.', 'connect-wpform-to-any-api' ); ?>"> 148 150 <svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" width="512" height="512" x="0" y="0" viewBox="0 0 20 20" xml:space="preserve" class=""><g><path d="M10 1a8.987 8.987 0 0 0-7.921 13.257l-1.037 3.455A1 1 0 0 0 2 19a1.019 1.019 0 0 0 .288-.042l3.455-1.037A9 9 0 1 0 10 1zm0 4a1 1 0 1 1-1 1 1 1 0 0 1 1-1zm1 10h-1a1 1 0 0 1-1-1v-4a1 1 0 0 1 0-2h1a1 1 0 0 1 1 1v4a1 1 0 0 1 0 2z" fill="#189b9b" opacity="1" data-original="#000000" class=""></path></g></svg> 149 151 </div> … … 159 161 <?php 160 162 if($wpformapi_form_field){ 163 161 164 foreach($wpformapi_form_field as $key => $wpform_field_value){ 162 ?> 163 <div class="wpformapi_field"> 164 <label for="wpformapi_<?php echo esc_html($key); ?>"><?php echo esc_html($wpform_field_value['label']); ?> </label> 165 <input type="text" id="wpformapi_<?php echo esc_html($key); ?>" name="wpformapi_form_field[<?php echo esc_html($key); ?>]" value="<?php echo esc_html($wpform_field_value['value']); ?>" placeholder="<?php esc_attr_e('Enter your API mapping key', 'connect-wpform-to-any-api'); ?>" > 165 $is_predefined = in_array($key, $predefined_keys, true); 166 167 // Ensure $wpform_field_value is an array with label/value 168 if (!is_array($wpform_field_value)) { 169 $wpform_field_value = [ 170 'label' => is_numeric($key) ? 'Field ' . $key : $key, 171 'value' => $wpform_field_value 172 ]; 173 } 174 ?> 175 <div class="wpformapi_field" <?php echo $is_predefined ? 'data-tag="' . esc_attr($key) . '"' : ''; ?>> 176 <label for="wpform_<?php echo esc_attr($key); ?>"><?php echo esc_html($wpform_field_value['label']); ?></label> 177 <input type="text" id="wpform_<?php echo esc_attr($key); ?>" name="wpformapi_form_field[<?php echo esc_attr($key); ?>]" value="<?php echo esc_html($wpform_field_value['value']); ?>" placeholder="<?php esc_attr_e('Enter your API mapping key', 'connect-wpform-to-any-api'); ?>" > 178 <?php if ($is_predefined) : ?> 179 <button type="button" class="button wpformapi_remove_predefined_tag"> 180 <svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" width="512" height="512" x="0" y="0" viewBox="0 0 511.76 511.76" style="enable-background:new 0 0 512 512" xml:space="preserve" class=""><g><path d="M436.896 74.869c-99.84-99.819-262.208-99.819-362.048 0-99.797 99.819-99.797 262.229 0 362.048 49.92 49.899 115.477 74.837 181.035 74.837s131.093-24.939 181.013-74.837c99.819-99.818 99.819-262.229 0-362.048zm-75.435 256.448c8.341 8.341 8.341 21.824 0 30.165a21.275 21.275 0 0 1-15.083 6.251 21.277 21.277 0 0 1-15.083-6.251l-75.413-75.435-75.392 75.413a21.348 21.348 0 0 1-15.083 6.251 21.277 21.277 0 0 1-15.083-6.251c-8.341-8.341-8.341-21.845 0-30.165l75.392-75.413-75.413-75.413c-8.341-8.341-8.341-21.845 0-30.165 8.32-8.341 21.824-8.341 30.165 0l75.413 75.413 75.413-75.413c8.341-8.341 21.824-8.341 30.165 0 8.341 8.32 8.341 21.824 0 30.165l-75.413 75.413 75.415 75.435z" fill="#189b9b" opacity="1" data-original="#189b9b" class=""></path></g></svg> 181 <?php echo esc_html__('Remove', 'connect-wpform-to-any-api'); ?> 182 </button> 183 <?php endif; ?> 166 184 </div> 167 <?php185 <?php 168 186 } 169 187 } else { … … 174 192 </div> 175 193 </div> 194 195 <!-- Predefined Tags Functionality --> 196 <div class="wpformapi_col2"> 197 <div class="wpformapi_field"> 198 <label class="wpformapi_title" for="wpformapi_predefined_tags" ><?php echo esc_html__( 'Built-in form fields', 'connect-wpform-to-any-api' ); ?> 199 <div class="wpformapi_tooltip" data-wpformapitooltip="<?php esc_html_e( 'Use default tags to automatically include dynamic data (like time, date, post title, user IP etc) when sending information to your API. No hidden fields needed!', 'connect-wpform-to-any-api' ); ?>"> 200 <svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" width="512" height="512" x="0" y="0" viewBox="0 0 20 20" xml:space="preserve" class=""><g><path d="M10 1a8.987 8.987 0 0 0-7.921 13.257l-1.037 3.455A1 1 0 0 0 2 19a1.019 1.019 0 0 0 .288-.042l3.455-1.037A9 9 0 1 0 10 1zm0 4a1 1 0 1 1-1 1 1 1 0 0 1 1-1zm1 10h-1a1 1 0 0 1-1-1v-4a1 1 0 0 1 0-2h1a1 1 0 0 1 1 1v4a1 1 0 0 1 0 2z" fill="#189b9b" opacity="1" data-original="#000000" class=""></path></g></svg> 201 </div> 202 </label> 203 <div class="wpformapi_dynamic_tags"> 204 <select id="wpformapi_predefined_tag_select"> 205 <option value=""><?php echo esc_html__( '--Select Tag--', 'connect-wpform-to-any-api' ); ?></option> 206 <?php 207 foreach ( $predefined_tags as $tag_key => $tag_label ) {?> 208 <option value="<?php echo esc_attr( $tag_key ); ?>"> 209 <?php echo esc_html( $tag_label ); ?> 210 </option> 211 <?php } ?> 212 </select> 213 <button type="button" id="wpformapi_add_predefined_tag" class="button button-white"><?php echo esc_html__( 'Add Tag', 'connect-wpform-to-any-api' ); ?></button> 214 </div> 215 </div> 216 </div> 217 218 176 219 <div class="bottom-button"> 177 220 <button type="button" id="wpformapi_prev_btn" class="button button-white" style="margin-top:20px;">← <?php echo esc_html__( 'Previous', 'connect-wpform-to-any-api' ); ?></button> … … 180 223 </div> 181 224 225 182 226 <!-- Popup Modal For the JSON--> 183 <div id="jsonPreviewModal " class="cf7anyapi-json-preview-modal" style="display: none;">184 <div class=" cf7anyapi-json-preview-modal-content">185 <span class=" cf7anyapi-json-preview-close">×</span>227 <div id="jsonPreviewModalWpform" class="wpforms-json-preview-modal" style="display: none;"> 228 <div class="wpforms-json-preview-modal-content"> 229 <span class="wpforms-json-preview-close">×</span> 186 230 <h2><?php echo esc_html__( 'Preview API Request', 'connect-wpform-to-any-api' ); ?></h2> 187 <div id="jsonPreviewOutput "></div>231 <div id="jsonPreviewOutputWpform"></div> 188 232 189 233 </div> … … 192 236 193 237 194 <!-- <div class=" cf7anyapi_loader" style="display: none;">238 <!-- <div class="anyapi_loader" style="display: none;"> 195 239 <img class="" src="<?php echo esc_url( plugin_dir_url( __DIR__ ) . 'images/loader.gif' ); ?>" alt="loader" > 196 240 </div> --> -
connect-wpform-to-any-api/trunk/includes/class-wpform-to-any-api-log-table.php
r3420669 r3430425 230 230 if ( $which === 'top' ) { 231 231 $selected_form = isset($_GET['wpform_filter']) ? absint($_GET['wpform_filter']) : ''; 232 $ cf7_forms = get_posts( array(232 $wp_forms = get_posts( array( 233 233 'post_type' => 'wpforms', 234 234 'posts_per_page' => -1, … … 240 240 <select name="wpform_filter" id="wpform_filter"> 241 241 <option value=""><?php esc_html_e( 'All Forms', 'connect-wpform-to-any-api' ); ?></option> 242 <?php foreach ( $ cf7_forms as $form ) : ?>242 <?php foreach ( $wp_forms as $form ) : ?> 243 243 <option value="<?php echo esc_attr( $form->ID ); ?>" <?php selected( $selected_form, $form->ID ); ?>> 244 244 <?php echo esc_html( $form->post_title ); ?> -
connect-wpform-to-any-api/trunk/includes/class-wpform-to-any-api.php
r3420669 r3430425 273 273 } 274 274 } 275 276 // Add Predefined Tags (if available) 277 if ( method_exists( $this, 'get_predefined_tags' ) ) { 278 $predefined_tags = array_keys( $this->get_predefined_tags() ); 279 foreach ( $predefined_tags as $tag_key ) { 280 281 if ( isset( $options['wpformapi_form_field'][ $tag_key ] ) ) { 282 // print_r($tag_key); 283 $form_fields_list[ $tag_key ] = $options['wpformapi_form_field'][ $tag_key ]; 284 } 285 } 286 } 275 287 $options['wpformapi_form_field'] = $form_fields_list; 288 // print_r($options['wpformapi_form_field'] ); 276 289 } 277 290 return $options; … … 326 339 } 327 340 341 /** 342 * Get all predefined tags with labels. 343 * @since 2.0.1 344 * @return array 345 */ 346 public static function get_predefined_tags() { 347 return array( 348 '_user_ip' => __( 'User IP', 'connect-wpform-to-any-api' ), 349 '_date' => __( 'Date', 'connect-wpform-to-any-api' ), 350 '_time' => __( 'Time', 'connect-wpform-to-any-api' ), 351 '_submitted_date_time' => __( 'Submitted Date & Time', 'connect-wpform-to-any-api' ), 352 '_site_url' => __( 'Site URL', 'connect-wpform-to-any-api' ), 353 '_submission_source_url' => __( 'Submission Source URL', 'connect-wpform-to-any-api' ), 354 '_post_id' => __( 'Post ID', 'connect-wpform-to-any-api' ), 355 '_post_slug' => __( 'Post Slug', 'connect-wpform-to-any-api' ), 356 '_post_title' => __( 'Post Title', 'connect-wpform-to-any-api' ), 357 '_form_id' => __( 'Form ID', 'connect-wpform-to-any-api' ), 358 '_form_name' => __( 'Form Name', 'connect-wpform-to-any-api' ), 359 '_http_referer' => __( 'HTTP Referer', 'connect-wpform-to-any-api' ), 360 '_browser_info' => __( 'Browser Info', 'connect-wpform-to-any-api' ), 361 '_server_name' => __( 'Server Name', 'connect-wpform-to-any-api' ), 362 ); 363 } 364 365 328 366 } -
connect-wpform-to-any-api/trunk/wpform-to-any-api.php
r3420669 r3430425 17 17 * Plugin URI: https://wordpress.org/plugins/connect-wpform-to-any-api 18 18 * Description: Send WPForms Lead/Data to Any CRM or Third Party APIs 19 * Version: 1.0. 019 * Version: 1.0.1 20 20 * Author: IT Path Solutions 21 21 * Author URI: https://www.itpathsolutions.com/ … … 36 36 * Rename this for your plugin and update it as you release new versions. 37 37 */ 38 define( 'WPFORM_TO_ANY_API_VERSION', '1.0. 0' );38 define( 'WPFORM_TO_ANY_API_VERSION', '1.0.1' ); 39 39 40 40 /**
Note: See TracChangeset
for help on using the changeset viewer.