PluginProbe
WPGet API – Connect to any external REST API / 1.4.0
WPGet API – Connect to any external REST API v1.4.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 | includes/functions.php +3 -63 2.0.61.4.0 View file →
@@ -18,10 +18,10 @@
18 18 *
19 19 */
20 20 function wpgetapi_results_format_options( $field ) {
21 21 $options = apply_filters( 'wpgetapi_results_format_options', array(
22 - 'json_string' => __( 'JSON string', 'wpgetapi' ),
23 - 'json_decoded' => __( 'PHP array data', 'wpgetapi' ),
22 + 'json_string' => 'JSON (as string)',
23 + 'json_decoded' => 'JSON (as array data)',
24 24 ) );
25 25 return $options;
26 26 }
27 27
@@ -47,65 +47,5 @@
47 47 }
48 48 }
49 49
50 50 return $array_or_string;
51 -}
52 -
53 -
54 -/**
55 - * wpgetapi_output_endpoint_test_area
56 - *
57 - */
58 -function wpgetapi_output_top_of_endpoint( $field_args, $field ) {
59 -
60 - ob_start();
61 -
62 - $test_disabled = true;
63 -
64 - if( $field->value )
65 - $test_disabled = false;
66 -
67 - ?>
68 -
69 - <pre class="functions">
70 - Template Tag: </span><span class="wpgetapi-template-tag wpgetapi-copy">wpgetapi_endpoint( '<?php esc_html_e( $field->args['api_id'] ); ?>', '<span class='endpoint_id'></span>', array('debug' => false) );</span> <span title="Copy Template Tag" class="copy-this dashicons dashicons-admin-page"></span><br>
71 - Shortcode: <span class="wpgetapi-shortcode wpgetapi-copy">[wpgetapi_endpoint api_id='<?php esc_html_e( $field->args['api_id'] ); ?>' endpoint_id='<span class='endpoint_id'></span>' debug='false']</span> <span title="Copy Shortcode" class="copy-this dashicons dashicons-admin-page"></span>
72 - </pre>
73 -
74 - <div class="wpgetapi-test-area" data-endpoint="<?php esc_attr_e( $field->value ); ?>" data-api="<?php esc_attr_e( $field->args['api_id'] ); ?>">
75 - <a class="test-button button-primary" href="#" <?php echo $test_disabled ? 'disabled' : ''; ?>><?php _e( 'Test Endpoint', 'wpgetapi' ); ?></a>
76 - <span class="handle" style="display:none">Hide/Show Results</span>
77 -
78 - <?php do_action( 'wpgetapi_admin_before_test_result' ); ?>
79 -
80 - <div class="wpgetapi-result"></div>
81 - </div>
82 -
83 - <?php
84 -
85 - $content = ob_get_contents();
86 - ob_end_clean();
87 - return $content;
88 -
89 - return $field_args;
90 -
91 -}
92 -
93 -
94 -/**
95 - * Ensure our unique ID's are only lowercase and underscores
96 - *
97 - * @param mixed $value The unsanitized value from the form.
98 - * @param array $field_args Array of field arguments.
99 - * @param CMB2_Field $field The field object
100 - *
101 - * @return mixed Sanitized value to be stored.
102 - */
103 -function wpgetapi_sanitize_unique_id( $value, $field_args, $field ) {
104 - $sanitized_value = sanitize_file_name( $value );
105 - $sanitized_value = str_replace("-", "_", $sanitized_value );
106 - $sanitized_value = str_replace(".", "_", $sanitized_value );
107 - $sanitized_value = str_replace("^", "_", $sanitized_value );
108 - $sanitized_value = str_replace("@", "_", $sanitized_value );
109 - return $sanitized_value;
110 -}
111 -
51 +}