Merge branch 'wordpress' of https://github.com/harshil1712/n8n-docs into harshil1712-wordpress

This commit is contained in:
Tanay Pant 2020-09-17 08:27:55 +02:00
commit 83c7ffa234
5 changed files with 63 additions and 2 deletions

View File

@ -9,8 +9,9 @@ You can find information about the operations supported by the WordPress node on
## Prerequisites
Create a [WordPress](https://wordpress.com/) account.
- Create a [WordPress](https://wordpress.com/) account.
- Install and activate the [WP-API/Basic-Auth](https://github.com/WP-API/Basic-Auth) plugin in the WordPress website.
## Using Username and Password
Use your username, password and wordpress URL with your WordPress node credentials in n8n.
Use your username, password and WordPress URL with your WordPress node credentials in n8n.

View File

@ -0,0 +1,60 @@
---
permalink: /nodes/n8n-nodes-base.wordpress
---
# WordPress
[WordPress](https://wordpress.org/) is a free and open-source content management system written in PHP and paired with a MySQL or MariaDB database.
::: tip 🔑 Credentials
You can find authentication information for this node [here](../../../credentials/WordPress/README.md).
:::
## Basic Operations
- Post
- Create a post
- Get a post
- Get all posts
- Update a post
- User
- Create a user
- Get a user
- Get all users
- Update a user
## Example Usage
This workflow allows you to create a post and update the post in WordPress. You can also find the [workflow](https://n8n.io/workflows/668) on the website. This example usage workflow would use the following two nodes.
- [Start](../../core-nodes/Start/README.md)
- [WordPress]()
The final workflow should look like the following image.
![A workflow with the WordPress node](./workflow.png)
### 1. Start node
The start node exists by default when you create a new workflow.
### 2. Wordpress node (create: post)
1. First of all, you'll have to enter credentials for the WordPress node. You can find out how to do that [here](../../../credentials/WordPress/README.md).
2. Enter the title in the ***Title*** field.
3. Click on ***Execute Node*** to run the workflow.
![Using the WordPress node to create a new post](./WordPress_node.png)
::: v-pre
### 3. Wordpress1 node (update: post)
1. Select the credentials that you entered in the previous node.
2. Select 'Update' from the ***Operation*** dropdown list.
3. Click on the gears icon next to the ***Post ID*** field and click on ***Add Expression***.
4. Select the following in the ***Variable Selector*** section: Nodes > Wordpress > Output Data > JSON > id. You can also add the following expression: `{{$node["Wordpress"].json["id"]}}`.
5. Click on the ***Add Field*** button and select 'Content' from the dropdown list.
6. Enter the content in the ***Content*** filed.
7. Click on ***Execute Node*** to run the workflow.
:::
![Using the WordPress node to update the post](./WordPress1_node.png)

Binary file not shown.

After

Width:  |  Height:  |  Size: 227 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 208 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 162 KiB