You appear to be a bot. Output may be restricted
Description
Initialise Genesis_Contributors object.
Each person in $people
should have the following properties:
- name
- url (full URL)
- avatar (full path to image)
- role (typically
contributor
or `lead-developer`)
There are two shortcut properties:
- twitter (just the twitter handle, no
@`, which gets converted into a full URL for the `url
key) - gravatar (just the hash, which gets converted into a full Gravatar URL for the
avatar
key)
The shortcut properties are preferred, but if someone does not have Twitter, or a Gravatar URL, different sources can be provided in the url and `avatar
keys.
Usage
Genesis_Contributors::__construct( $people );
Parameters
- $people
- ( array ) required – Data set of people who have contributed to Genesis.
Returns
void
Source
File name: genesis/lib/classes/class-genesis-contributors.php
Lines:
1 to 19 of 19
public function __construct( array $people ) { $all = []; foreach ( $people as $key => $person ) { if ( ! isset( $person['role'] ) ) { $person['role'] = 'none'; } if ( ! isset( $person['url'] ) && isset( $person['twitter'] ) ) { $person['url'] = 'https://twitter.com/' . $person['twitter']; } if ( ! isset( $person['avatar'] ) && isset( $person['gravatar'] ) ) { $person['avatar'] = 'https://0.gravatar.com/avatar/' . $person['gravatar'] . '?s=120'; } $all[ $key ] = new Genesis_Contributor( $person['name'], $person['url'], $person['avatar'], $person['role'] ); } $this->people = $all; }