PHP Class Jetpack_My_Community_Widget, jetpack

A community member is a WordPress.com user that liked or commented on an entry or subscribed to the site. Requires WordPress.com connection to work. Otherwise it won't be visible in Widgets screen in admin.
Inheritance: extends WP_Widget
Show file Open project: automattic/jetpack

Public Properties

Property Type Description
$default_title string Default widget title.
$expiration integer Transient expiration time.

Public Methods

Method Description
__construct ( ) Registers the widget with WordPress.
enqueue_style ( ) Enqueue stylesheet for grid layout.
fetch_remote_community ( $query ) : array Request community members to WordPress.com endpoint.
form ( array $instance ) : string | void Back-end widget form.
get_community ( array $query ) : string Initiate request and render the response.
update ( array $new_instance, array $old_instance ) : array Sanitize widget form values as they are saved.
widget ( array $args, array $instance ) Front-end display of widget.

Method Details

__construct() public method

Registers the widget with WordPress.
public __construct ( )

enqueue_style() public method

Enqueue stylesheet for grid layout.
public enqueue_style ( )

fetch_remote_community() public method

Request community members to WordPress.com endpoint.
Since: 4.0
public fetch_remote_community ( $query ) : array
$query
return array

form() public method

Back-end widget form.
See also: WP_Widget::form()
public form ( array $instance ) : string | void
$instance array Previously saved values from database.
return string | void

get_community() public method

Initiate request and render the response.
Since: 4.0
public get_community ( array $query ) : string
$query array
return string

update() public method

Sanitize widget form values as they are saved.
See also: WP_Widget::update()
public update ( array $new_instance, array $old_instance ) : array
$new_instance array Values just sent to be saved.
$old_instance array Previously saved values from database.
return array Updated safe values to be saved.

widget() public method

Front-end display of widget.
See also: WP_Widget::widget()
public widget ( array $args, array $instance )
$args array Widget arguments.
$instance array Saved values from database.

Property Details

$default_title public property

Default widget title.
public string $default_title
return string

$expiration static public property

Transient expiration time.
static public int $expiration
return integer