PHP Class Jetpack_Contact_Info_Widget, jetpack

Inheritance: extends WP_Widget
Afficher le fichier Open project: automattic/jetpack

Méthodes publiques

Méthode 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 méthode

Constructor
public __construct ( )

build_map() public méthode

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

defaults() public méthode

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

enqueue_scripts() public méthode

Enqueue scripts and styles.
public enqueue_scripts ( )

form() public méthode

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

has_good_map() public méthode

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

update() public méthode

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
Résultat array

urlencode_address() public méthode

Encode an URL
public urlencode_address ( string $address ) : string
$address string The URL to encode
Résultat string The encoded URL

widget() public méthode

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
Résultat void Echoes it's output