Advertisements

wp_credits

Definition:
function wp_credits() {}

Source code

function wp_credits() {

	global $wp_version;

	$locale = get_locale();



	$results = get_site_transient( 'wordpress_credits_' . $locale );



	if ( ! is_array( $results ) ) {

		$response = wp_remote_get( "http://api.wordpress.org/core/credits/1.0/?version=$wp_version&locale=$locale" );



		if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) )

			return false;



		$results = maybe_unserialize( wp_remote_retrieve_body( $response ) );



		if ( ! is_array( $results ) )

			return false;



		set_site_transient( 'wordpress_credits_' . $locale, $results, 86400 ); // One day

	}



	return $results;

}

15001

Advertisements

No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: