PHP code example of aristath / gh-sponsors-list

1. Go to this page and download the library: Download aristath/gh-sponsors-list library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

aristath / gh-sponsors-list example snippets


/**
 * Print GitHub Sponsors.
 *
 * @return void
 */
function my_plugin_or_theme_the_github_sponsors() {

	// Require the class.
	if ( ! class_exists( '\Aristath\GHSponsors' ) ) {
		ername( 'aristath' );

	// Uncomment this line to not add CSS.
	/* $sponsors->add_styles = true; */

	// Manually inject a sponsor.
	$sponsors->add_sponsor(
		[
			'name'    => 'aristath',
			'url'     => 'https://aristath.github.io',
			'img'     => 'https://avatars0.githubusercontent.com/u/588688?s=460&u=b2865bad64212673fc4ab425231e0a61aa9a2193&v=4',
			'classes' => 'round',
		]
	);

	// Get GitHub Sponsors from the API.
	$sponsors->add_sponsors_from_api();

	// Print the sponsors.
	$sponsors->the_sponsors_details();	
}