PHP Class Jetpack_Contact_Info_Widget, jetpack

Inheritance: extends WP_Widget
Exibir arquivo Open project: automattic/jetpack

Public Methods

Method Description
__construct ( ) Constructor
build_map ( $address, $api_key = null ) : string Builds map display HTML code from the supplied latitude and longitude.
build_map_link ( string $address ) : string Generate a Google Maps link for the supplied address.
defaults ( ) : array Return an associative array of default values
enqueue_scripts ( ) Enqueue scripts and styles.
form ( array $instance ) : void Displays the form for this widget on the Widgets page of the WP Admin area.
has_good_map ( array $instance ) : boolean Check if the instance has a valid Map location.
update ( array $new_instance, array $old_instance ) : array Deals with the settings when they are saved by the admin. Here is where any validation should be dealt with.
urlencode_address ( string $address ) : string Encode an URL
widget ( array $args, array $instance ) : void Outputs the HTML for this widget.

Method Details

__construct() public method

Constructor
public __construct ( )

build_map() public method

Builds map display HTML code from the supplied latitude and longitude.
public build_map ( $address, $api_key = null ) : string
return string HTML of the map

defaults() public method

These values are used in new widgets.
public defaults ( ) : array
return array Array of default values for the Widget's options

enqueue_scripts() public method

Enqueue scripts and styles.
public enqueue_scripts ( )

form() public method

Displays the form for this widget on the Widgets page of the WP Admin area.
public form ( array $instance ) : void
$instance array Instance configuration.
return void

has_good_map() public method

Check if the instance has a valid Map location.
public has_good_map ( array $instance ) : boolean
$instance array Widget instance configuration.
return boolean Whether or not there is a valid map.

update() public method

Deals with the settings when they are saved by the admin. Here is where any validation should be dealt with.
public update ( array $new_instance, array $old_instance ) : array
$new_instance array New configuration values
$old_instance array Old configuration values
return array

urlencode_address() public method

Encode an URL
public urlencode_address ( string $address ) : string
$address string The URL to encode
return string The encoded URL

widget() public method

Outputs the HTML for this widget.
public widget ( array $args, array $instance ) : void
$args array An array of standard parameters for widgets in this theme
$instance array An array of settings for this widget instance
return void Echoes it's output