wp_credits
Retrieve the contributor credits.
Description
(array|false) wp_credits();
Returns (array|false)
A list of all of the contributors, or false on error.
Usage
if ( !function_exists( 'wp_credits' ) ) { require_once ABSPATH . '/wp-admin/includes/credits.php'; } // NOTICE! Understand what this does before running. $result = wp_credits();
Defined (1)
The function is defined in the following location(s).
- /wp-admin/includes/credits.php
- function wp_credits() {
- $wp_version = get_bloginfo( 'version' );
- $locale = get_user_locale();
- $results = get_site_transient( 'wordpress_credits_' . $locale );
- if ( ! is_array( $results )
- || false !== strpos( $wp_version, '-' )
- || ( isset( $results['data']['version'] ) && strpos( $wp_version, $results['data']['version'] ) !== 0 )
- ) {
- $response = wp_remote_get( "http://api.wordpress.org/core/credits/1.1/?version={$wp_version}&locale={$locale}" );
- if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) )
- return false;
- $results = json_decode( wp_remote_retrieve_body( $response ), true );
- if ( ! is_array( $results ) )
- return false;
- set_site_transient( 'wordpress_credits_' . $locale, $results, DAY_IN_SECONDS );
- }
- return $results;
- }