• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
Genesis Theme Framework a2z

Genesis Theme Framework a2z

WordPress Dynamic API Reference

  • Home
  • Plugins
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / APIs / Genesis_Contributors::__construct() – Initialise Genesis_Contributors object.

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;
  }
 

Published: 25th November 2019 | Last updated: 25th November 2019

Primary Sidebar

Information

Function name: Genesis_Contributors::__construct
Class ref: Genesis_Contributors
Plugin ref: Genesis Framework
Version: 3.3.3
Sourcefile: lib/classes/class-genesis-contributors.php
File ref: lib/classes/class-genesis-contributors.php
Deprecated?: No
API Letters: C,G

Footer

Genesis a2z
Genesis Theme Framework a2z
WordPress Dynamic API Reference
WordPress 5.6
WordPress a2z
WordPress core a2z
Genesis Theme Framework a2z
Jetpack a2z
WordPress develop tests
Easy Digital Downloads a2z
WooCommerce a2z
Yoast SEO a2z
WordPress Blocks

Site:  genesis.wp-a2z.org
© Copyright Genesis a2z 2014-2021. All rights reserved.


Website designed and developed by Herb Miller
Proudly powered by WordPress and oik plugins

  • Home
  • Blog
  • Sitemap
  • Sites