PluginProbe
WPGet API – Connect to any external REST API / 1.9.0
WPGet API – Connect to any external REST API v1.9.0
1.9.2 1.9.3 1.9.4 1.9.5 1.9.6 1.9.7 1.9.8 1.9.9 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.1.0 2.1.1 2.1.3 2.1.4 2.1.5 2.2.0 2.2.1 2.2.10 2.2.2 2.2.3 All 97 releases
← All changes | frontend/functions.php +4 -10 2.2.21.9.0 View file →
@@ -34,15 +34,12 @@
34 34 'html_url' => '',
35 35 'html_to_link' => '',
36 36 'img_key' => '',
37 37 'img_prepend' => '',
38 - 'img_link' => '',
39 38 'on' => '',
40 39 'button_text' => '',
41 40 'hide_button' => '',
42 41 'button_spinner' => '',
43 - 'button_id' => '',
44 - 'ajax_output' => '.wpgetapi_ajax_output',
45 42 'chain' => '',
46 43 'chain_delay' => '0',
47 44 ), $atts );
48 45
@@ -81,16 +78,13 @@
81 78 $a['args']['html_url'] = $a['html_url'];
82 79 $a['args']['html_to_link'] = $a['html_to_link'];
83 80 $a['args']['img_key'] = $a['img_key'];
84 81 $a['args']['img_prepend'] = $a['img_prepend'];
85 - $a['args']['img_link'] = $a['img_link'];
86 82 $a['args']['shortcode'] = true;
87 83 $a['args']['on'] = $a['on'];
88 84 $a['args']['button_text'] = $a['button_text'];
89 85 $a['args']['hide_button'] = $a['hide_button'];
90 86 $a['args']['button_spinner'] = $a['button_spinner'];
91 - $a['args']['button_id'] = $a['button_id'];
92 - $a['args']['ajax_output'] = $a['ajax_output'];
93 87 $a['args']['chain'] = $a['chain'];
94 88 $a['args']['chain_delay'] = $a['chain_delay'];
95 89
96 90
@@ -107,9 +101,8 @@
107 101
108 102 <div class="wpgetapi_ajax_wrap" data-id="<?php esc_html_e( $a['api_id'] ); ?>-<?php esc_html_e( $a['endpoint_id'] ); ?>">
109 103 <button
110 104 class="button btn btn-primary wpgetapi_ajax_request"
111 - id="<?php esc_html_e( $a['button_id'] ); ?>"
112 105 data-api="<?php esc_html_e( $a['api_id'] ); ?>"
113 106 data-endpoint="<?php esc_html_e( $a['endpoint_id'] ); ?>"
114 107 data-args="<?php esc_html_e( json_encode( $a['args'] ) ); ?>"
115 108 data-keys="<?php esc_html_e( json_encode( $a['keys'] ) ); ?>"
@@ -115,11 +108,9 @@
115 108 data-keys="<?php esc_html_e( json_encode( $a['keys'] ) ); ?>"
116 109 data-post_id="<?php esc_html_e( get_the_ID() ); ?>">
117 110 <span class="button_text"><?php esc_html_e( $button_text ); ?></span>
118 111 </button>
119 -
120 112 <div class="wpgetapi_ajax_output"></div>
121 -
122 113 </div>
123 114
124 115 <?php
125 116 $result = ob_get_contents();
@@ -132,8 +123,11 @@
132 123 }
133 124
134 125 } else {
135 126
127 + // [wpgetapi_endpoint api_id='livelearn' endpoint_id='dezzp1' chain='start' keys='UUID']
128 + // [wpgetapi_endpoint api_id='livelearn' endpoint_id='dezzp2' chain='end']
129 +
136 130 // if we are starting the chain
137 131 if( ! empty( $a['args']['chain'] ) ) {
138 132
139 133 $delay = absint( $a['args']['chain_delay'] );
@@ -159,9 +153,9 @@
159 153
160 154 if( is_array( $result ) ) {
161 155 $result = sprintf(
162 156 __( 'The <b>Results Format</b> for this endpoint is set to \'PHP array data\' - shortcodes are unable to output this type of data.<br>Please change the Results Format to \'JSON string\' in the endpoint settings page.<br>Alternatively, please see our tutorial on %1s.', 'wpgetapi' ),
163 - '<a target="_blank" href="https://wpgetapi.com/docs/format-api-data-as-html/?utm_campaign=Shortcode JSON&utm_medium=Admin&utm_source=User">how to format your API data as HTML</a>.'
157 + '<a target="_blank" href="https://wpgetapi.com/docs/format-api-data-as-html/?utm_campaign=Shortcode JSON&utm_medium=Admin&utm_source=User">how to format your API data as HTML</a>'
164 158 );
165 159 }
166 160
167 161 if( $a['args']['format'] !== 'no_display' )