array( 'path' => 'js/address.js', 'dependencies' => array( 'jquery' ), 'version' => SAP_VERSION, 'footer' => true, ), ); public $sanitize_callback = 'sanitize_text_field'; /** * Translateable strings required for this component * @since 2.0.a.8 */ public $strings = array( 'sep-action-links' => null, // _x( ' | ', 'separator between admin action links in address component', 'textdomain' ), 'sep-lat-lon' => null, // _x( ', ', 'separates latitude and longitude', 'textdomain' ), 'no-setting' => null, // __( 'No map coordinates set.', 'textdomain' ), 'retrieving' => null, // __( 'Requesting new coordinates', 'textdomain' ), 'select' => null, // __( 'Select a match below', 'textdomain' ), 'view' => null, // __( 'View', 'textdomain' ), 'retrieve' => null, // __( 'Retrieve map coordinates', 'textdomain' ), 'remove' => null, // __( 'Remove map coordinates', 'textdomain' ), 'try_again' => null, // __( 'Try again?', 'textdomain' ), 'result_error' => null, // __( 'Error', 'textdomain' ), 'result_invalid' => null, // __( 'Invalid request. Be sure to fill out the address field before retrieving coordinates.', 'textdomain' ), 'result_denied' => null, // __( 'Request denied.', 'textdomain' ), 'result_limit' => null, // __( 'Request denied because you are over your request quota.', 'textdomain' ), 'result_empty' => null, // __( 'Nothing was found at that address', 'textdomain' ), ); /** * Escape the value to display it safely HTML textarea fields * @since 2.0.a.5 */ public function esc_value( $val ) { $escaped = array(); $escaped['text'] = empty( $val['text'] ) ? '' : esc_textarea( $val['text'] ); $escaped['lat'] = empty( $val['lat'] ) ? '' : esc_textarea( $val['lat'] ); $escaped['lon'] = empty( $val['lon'] ) ? '' : esc_textarea( $val['lon'] ); return $escaped; } /** * Set the size of this textarea field * @since 1.0 */ public function set_size( $size ) { $this->size = esc_attr( $size ); } /** * Wrapper for the sanitization callback function. * * This just reduces code duplication for child classes that need a custom * callback function. * @since 2.0.a.5 */ public function sanitize_callback_wrapper( $value ) { $sanitized = array(); $sanitized['text'] = empty( $value['text'] ) ? '' : wp_kses_post( $value['text'] ); $sanitized['lat'] = empty( $value['lat'] ) ? '' : sanitize_text_field( $value['lat'] ); $sanitized['lon'] = empty( $value['lon'] ) ? '' : sanitize_text_field( $value['lon'] ); return $sanitized; } /** * Display this setting * @since 2.0.a.5 */ public function display_setting() { wp_localize_script( 'sap-address', 'sap_address', array( 'strings' => $this->strings, 'api_key' => $this->api_key, 'api_key_selector' => $this->api_key_selector, ) ); $this->display_description(); ?>
print_conditional_data(); ?>>

value['lat'] ) || empty( $this->value['lon'] ) ) : ?> strings['no-setting'] ); ?> value['lat'] . $this->strings['sep-lat-lon'] . $this->value['lon'] ); ?> strings['view'] ); ?>

strings['retrieve'] ); ?> strings['sep-action-links'] ); ?> strings['remove'] ); ?>