刚刚找到plugin_api并使用它,可以通过以下代码实现上述功能:
/** If plugins_api isn\'t available, load the file that holds the function */
if ( ! function_exists( \'plugins_api\' ) )
require_once( ABSPATH . \'wp-admin/includes/plugin-install.php\' );
/** Prepare our query */
$call_api = plugins_api( \'plugin_information\',
array(
\'slug\' => \'i-recommend-this\'
)
);
/** Display the results */
if ( is_wp_error( $call_api ) )
echo \'
\' . print_r( $call_api->get_error_message(), true ) . \'
\';
else
//echo \'
\' . print_r( $call_api, true ) . \'
\';
echo \'
\' . print_r( $call_api->downloaded, true ) . \'
\';