PHP code example of tfrommen / adorable-avatars

1. Go to this page and download the library: Download tfrommen/adorable-avatars 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/ */

    

tfrommen / adorable-avatars example snippets




add_filter( 'adorable_avatars.force', '__return_true' );



add_filter( 'adorable_avatars.force', function ( $force, $id_or_email ) {

	if ( is_numeric( $id_or_email ) ) {
		$id_or_email = (int) $id_or_email;
	} elseif ( $id_or_email instanceof WP_Post ) {
		$id_or_email = $id_or_email->ID;
	} elseif ( $id_or_email instanceof WP_Comment ) {
		$id_or_email = $id_or_email->user_id;
	}

	return 42 !== $id_or_email;
}, 10, 2 );