/
githubmirror
/
wp-calypso
Обзор
Документация
Войти
/
githubmirror
/
wp-calypso
Код
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
trunk
packages/wpcom-proxy-request/examples/me.html
36 строк
775 B
Sergio Cinos
chore: Clean up eslint configuration for packages (#56787)
15 окт 2021, 06:59
Не верифицирован
15 окт 2021, 06:59
c2a3f57
Код
Авторство
О чём код?
<!DOCTYPE html> <html> <head> <title>WordPress.com REST API Proxy Me Test Page</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> </head> <body> <script src="dist/wpcom-proxy-request.js"></script> <script> var output = ''; WPCOMProxyRequest( { metaAPI: { accessAllUsersBlogs: true } }, function( err ) { if ( err ) { throw err; } console.log( 'proxy now running in "access all user\'s blogs" mode' ); } ); WPCOMProxyRequest( '/me', function( err, res ) { if ( err ) { throw err; } console.log( res ); output = document.createElement( 'pre' ); output.innerHTML = JSON.stringify( res, null, 2 ); document.body.appendChild( output ); } ); </script> </body> </html>