检索贡献者学分。

原型

wp_credits()

返回值

(array|false)  所有贡献者的列表,或者出错时为false。

源文件

路径:wp-admin/includes/credits.php

<?php
...
function wp_credits() {
	// include an unmodified $wp_version
	include( ABSPATH . WPINC . '/version.php' );
	$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 )
	) {
		$url = "http://api.wordpress.org/core/credits/1.1/?version={$wp_version}&locale={$locale}";
		$options = array( 'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url( '/' ) );
		if ( wp_http_supports( array( 'ssl' ) ) ) {
			$url = set_url_scheme( $url, 'https' );
		}
		$response = wp_remote_get( $url, $options );
		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;
}
...
?>

其他

英文文档:https://developer.wordpress.org/reference/functions/wp_credits/