在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:Automattic/wp-api-console开源软件地址:https://github.com/Automattic/wp-api-console开源编程语言:JavaScript 85.5%开源软件介绍:WordPress.com API Console v3This is the current version of the WordPress.com API console, written in React. It is deployed at: https://developer.wordpress.com/docs/api/ It supercedes https://github.com/Automattic/rest-api-console2. Getting Started LocallyTo setup the environment on your local system with WordPress.com APIs:
For more details, see below or check out the technical documentation. ConfigurationUsing with WordPress.com APIsTo use with WordPress.com, visit WordPress.com Developer Resources and create an application. Copy Make sure you add your host to the Javascript Origins / CORS whitelist in the Application's settings. {
"wordpress.com": {
"clientID": "33333",
"redirectUrl": "http://localhost:3000"
}
} Using with your self-hosted WordPress siteYou can also use this console with your WordPress.org installation but make
sure to install the
WP REST API - OAuth 1.0a Server
first, create an app (in the Users → Applications screen), and then edit the
{
"wordpress.org": [
{
"name": "Dev", // Name to display on the API selector
"url": "http://wordpress.dev", // Base URL of your WordPress website
"clientKey": "PwQXbJdBYrXq", // Client (public) key of your application
"secretKey": "XB9oidFfxr3g...", // Secret key of your application
"callbackUrl": "http://localhost:3000" // Callback URL where you are running this console
}
]
} Note that your You can also install the Application Passwords plugin and use basic authentication to communicate with your site. Make sure that your site is running over HTTPS, otherwise this is insecure. Here are the config settings for basic auth: {
"wordpress.org": [
{
"name": "Dev (basic)", // Name to display on the API selector
"url": "https://wordpress.dev", // Base URL of your WordPress website
"authType": "basic",
"authHeader": "Basic bWU6bXlwYSBzc3dvIHJk"
}
]
} You can generate the base64-encoded portion of the $ echo -n 'mywpusername:mypa sswo rd' | base64
bWU6bXlwYSBzc3dvIHJk Building a Static PackageTo create a static package you can use anywhere (e.g. Github pages): The static site is located in DeployingIf you want to quickly deploy the console to Surge, just run Deploying to WordPress.com
LicenseAll source code is licensed under GNU General Public License v2 (or later). |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论