| @@ -66,14 +66,14 @@ | ||
| 66 | 66 | |
| 67 | 67 | ?> |
| 68 | 68 | |
| 69 | 69 | <pre class="functions"> |
| 70 | - <div class="wrapper"><div>Template Tag:</div> </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></div> | |
| 71 | - <div class="wrapper"><div>Shortcode:</div> <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></div> | |
| 70 | + Template Tag: </span><span>wpgetapi_endpoint( '<?php esc_html_e( $field->args['api_id'] ); ?>', '<span class='endpoint_id'></span>', array('debug' => false) );</span><br> | |
| 71 | + Shortcode: <span>[wpgetapi_endpoint api_id='<?php esc_html_e( $field->args['api_id'] ); ?>' endpoint_id='<span class='endpoint_id'></span>' debug='false']</span> | |
| 72 | 72 | </pre> |
| 73 | 73 | |
| 74 | 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 | - <button class="test-button button-primary" <?php echo $test_disabled ? 'disabled' : ''; ?>><?php _e( 'Test Endpoint', 'wpgetapi' ); ?></button> | |
| 75 | + <a class="test-button button-primary" href="#" <?php echo $test_disabled ? 'disabled' : ''; ?>><?php _e( 'Test Endpoint', 'wpgetapi' ); ?></a> | |
| 76 | 76 | <span class="handle" style="display:none">Hide/Show Results</span> |
| 77 | 77 | |
| 78 | 78 | <?php do_action( 'wpgetapi_admin_before_test_result' ); ?> |
| 79 | 79 | |
| @@ -88,24 +88,4 @@ | ||
| 88 | 88 | |
| 89 | 89 | return $field_args; |
| 90 | 90 | |
| 91 | 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 | - | |