Receive Data To WP Webhooks Pro

Use the webhook URL down below to connect your external service with your site. This URL receives data from external endpoints and does certain actions on your WordPress site. Please note, that deleting the default main webhook creates automatically a new one. If you need more information, check out the installation and documentation by clicking here.
Webhook Name Webhook URL Webhook API Key Action

Add Webhook

Available Webhook Actions

Below you will find a list of all available actions when sending data from your specified service to WordPress.
Create a new user via webhooks.
  • actionRequired
    Always required. Determines which webhook action you want to target. (Alternatively, set this value as a query parameter within the URL) For this webhook action, please set it to create_user
  • user_emailRequired
    This field is required. Include the email for the user.
  • first_name
    The first name of the user.
  • last_name
    The last name of the user.
  • nickname
    The nickname. Please note that the nickname will be sanitized by WordPress automatically.
  • user_login
    A string with which the user can log in to your site.
  • display_name
    The name that will be seen on the frontend of your site.
  • user_nicename
    A URL-friendly name. Default is user' username.
  • description
    A description for the user that will be available on the profile page.
  • rich_editing
    Wether the user should be able to use the Rich editor. Set it to "yes" or "no". Default "no".
  • user_registered
    The date the user gets registered. Date structure: Y-m-d H:i:s
  • user_url
    Include a website url.
  • role
    The main user role. If not set, default is subscriber.
  • additional_roles
    This allows to add multiple roles to a user. For more information, please read the description.
  • user_pass
    The user password. If not defined, we generate a 32 character long password dynamically.
  • manage_meta_data
    Manage the user-related meta. Please check the description for more details.
  • manage_acf_data
    Allows you to manage fields that are especially related to Advanced Custom Fields. See the description for further information.
  • send_email
    Set this field to "yes" to send a email to the user with the data.
  • do_action
    Advanced: Register a custom action after Webhooks Pro fires this webhook. More infos are in the description.
  • success
    (Bool) True if the action was successful, false if not. E.g. array( 'success' => true )
  • data
    (array) User related data as an array. We return the user id with the key "user_id" and the user data with the key "user_data". E.g. array( 'data' => array(...) )
  • msg
    (string) A message with more information about the current request. E.g. array( 'msg' => "This action was successful." )

Here is an example of all the available default fields. The fields may vary based on custom extensions, third party plugins or different values.

$return_args = array(
    'success' => false,
    'data' => array(
        'user_id' => 0,
        'user_data' => array()
    )
);
        

This webhook action is used to create a user on your WordPress system via a webhook call.
The description is uniquely made for the create_user webhook action.
In case you want to first understand how to setup webhook actions in general, please check out the following manuals:
https://ironikus.com/docs/article-categories/get-started/

How to use create_user

  1. The first argument you need to set within your webhook action request is the action argument. This argument is always required. Please set it to create_user.
  2. It is also required to set an email address using the argument user_email. This should be the email address of the user you want to create.
  3. All the other arguments are optional and just extend the creation of the user. We would still recommend to set the attribute user_login, since this will be the name a user can log in with.


Special Arguments


role
The slug of the role. The default roles have the following slugs: administrator, editor, author, contributor, subscriber

additional_roles
This argument allows you to add or remove additional roles on the user. There are two possible ways of doing that:
  1. String method
    This method allows you to add or remove the user roles using a simple string. To make it work, simply add the slug of the role and define the action (add/remove) after, separated by double points (:). If you want to add multiple roles, simply separate them with a semicolon (;). Please refer to the example down below.
    editor:add;custom-role:add;custom-role-1:remove
  2. JSON method
    We also support a JSON formatted string, which contains the role slug as the JSON key and the action (add/remove) as the value. Please refer to the example below:
    {
      "editor": "add",
      "custom-role": "add",
      "custom-role-1": "remove"
    }

user_meta (Deprecated)
This argument is specifically designed to add/update or remove user meta to your updated user.
To create/update or delete custom meta values, we offer you two different ways:
  1. String method
    This method allows you to add/update or delete the user meta using a simple string. To make it work, separate the meta key from the value using a comma (,). To separate multiple meta settings from each other, simply separate them with a semicolon (;). To remove a meta value, simply set as a value ironikus-delete
    meta_key_1,meta_value_1;my_second_key,ironikus-delete
    IMPORTANT: Please note that if you want to use values that contain commas or semicolons, the string method does not work. In this case, please use the JSON method.
  2. JSON method
    This method allows you to add/update or remove the user meta using a JSON formatted string. To make it work, add the meta key as the key and the meta value as the value. To delete a meta value, simply set the value to ironikus-delete. Here's an example on how this looks like:
    {
    "meta_key_1": "This is my meta value 1",
    "another_meta_key": "This is my second meta key!"
    "third_meta_key": "ironikus-delete"
    }
Advanced: We also offer JSON to array/object serialization for single user meta values. This means, you can turn JSON into a serialized array or object.
As an example: The following JSON {"price": "100"} will turn into O:8:"stdClass":1:{s:5:"price";s:3:"100";} with default serialization or into a:1:{s:5:"price";s:3:"100";} with array serialization.
  1. Object serialization
    This method allows you to serialize a JSON to an object using the default json_decode() function of PHP.
    To serialize your JSON to an object, you need to add the following string in front of the escaped JSON within the value field of your single meta value of the user_meta argument: ironikus-serialize. Here's a full example:
    {
    "meta_key_1": "This is my meta value 1",
    "another_meta_key": "This is my second meta key!",
    "third_meta_key": "ironikus-serialize{\"price\": \"100\"}"
    }
    This example will create three user meta entries. The third entry has the meta key third_meta_key and a serialized meta value of O:8:"stdClass":1:{s:5:"price";s:3:"100";}. The string ironikus-serialize in front of the escaped JSON will tell our plugin to serialize the value. Please note that the JSON value, which you include within the original JSON string of the user_meta argument, needs to be escaped.
  2. Array serialization
    This method allows you to serialize a JSON to an array using the json_decode( $json, true ) function of PHP.
    To serialize your JSON to an array, you need to add the following string in front of the escaped JSON within the value field of your single meta value of the user_meta argument: ironikus-serialize-array. Here's a full example:
    {
    "meta_key_1": "This is my meta value 1",
    "another_meta_key": "This is my second meta key!",
    "third_meta_key": "ironikus-serialize-array{\"price\": \"100\"}"
    }
    This example will create three user meta entries. The third entry has the meta key third_meta_key and a serialized meta value of a:1:{s:5:"price";s:3:"100";}. The string ironikus-serialize-array in front of the escaped JSON will tell our plugin to serialize the value. Please note that the JSON value, which you include within the original JSON string of the user_meta argument, needs to be escaped.

manage_meta_data
This argument integrates the full features of managing user related meta values.

Please note: This argument is very powerful and requires some good understanding of JSON. It is integrated with the commonly used functions for managing user meta within WordPress. You can find a list of all avaialble functions here:
Down below you will find a complete JSON example that shows you how to use each of the functions above.

We also offer JSON to array/object serialization for single user meta values. This means, you can turn JSON into a serialized array or object.
This argument accepts a JSON construct as an input. This construct contains each available function as a top-level key within the first layer and the assigned data respectively as a value. If you want to learn more about each line, please take a closer look at the bottom of the example.
{
   "add_user_meta":[
      {
        "meta_key": "first_custom_key",
        "meta_value": "Some custom value"
      },
      {
        "meta_key": "second_custom_key",
        "meta_value": { "some_array_key": "Some array Value" },
        "unique": true
      } 
    ],
   "update_user_meta":[
      {
        "meta_key": "first_custom_key",
        "meta_value": "Some custom value"
      },
      {
        "meta_key": "second_custom_key",
        "meta_value": "The new value",
        "prev_value": "The previous value"
      } 
    ],
   "delete_user_meta":[
      {
        "meta_key": "first_custom_key"
      },
      {
        "meta_key": "second_custom_key",
        "meta_value": "Target specific value"
      } 
    ]
}
Down below you will find a list that explains each of the top level keys.
  1. add_user_meta
    This key refers to the add_user_meta() function of WordPress: https://developer.wordpress.org/reference/functions/add_user_meta/
    In the example above, you will find two entries within the add_user_meta key. The first one shows the default behavior using only the meta key and the value. This causes the meta key to be created without checking upfront if it exists - that allows you to create the meta value multiple times.
    As seen in the second entry, you will find a third key called unique that allows you to check upfront if the meta key exists already. If it does, the meta entry is neither created, nor updated. Set the value to true to check against existing ones. Default: false
    If you look closely to the second entry again, the value included is not a string, but a JSON construct, which is considered as an array and will therefore be serialized. The given value will be saved to the database in the following format: a:1:{s:14:"some_array_key";s:16:"Some array Value";}
  2. update_user_meta
    This key refers to the update_user_meta() function of WordPress: https://developer.wordpress.org/reference/functions/update_user_meta/
    The example above shows you two entries for this function. The first one is the default set up thats used in most cases. Simply define the meta key and the meta value and the key will be updated if it does exist and if it does not exist, it will be created.
    The third argument, as seen in the second entry, allows you to check against a previous value before updating. That causes that the meta value will only be updated if the previous key fits to whats currently saved within the database. Default: ''
  3. delete_user_meta
    This key refers to the delete_user_meta() function of WordPress: https://developer.wordpress.org/reference/functions/delete_user_meta/
    Within the example above, you will see that only the meta key is required for deleting an entry. This will cause all meta keys on this post with the same key to be deleted.
    The second argument allows you to target only a specific meta key/value combination. This gets important if you want to target a specific meta key/value combination and not delete all available entries for the given post. Default: ''
Some tipps:
  1. You can include the value for this argument as a simple string to your webhook payload or you integrate it directly as JSON into your JSON payload (if you send a raw JSON response).
  2. Changing the order of the functions within the JSON causes the user meta to behave differently. If you, for example, add the delete_user_meta key before the update_user_meta key, the meta values will first be deleted and then added/updated.
  3. The webhook response contains a validted array that shows each initialized meta entry, as well as the response from its original WordPress function. This way you can see if the meta value was adjusted accordingly.

manage_acf_data
This argument integrates this endpoint with Advanced Custom Fields.

Please note: This argument is very powerful and requires some good understanding of JSON. It is integrated with all Update functions offered by ACF. You can find a list of all update functions here: https://www.advancedcustomfields.com/resources/#functions
Down below you will find some examples that show you how to use each of the functions.

This argument accepts a validated JSON construct as an input. This construct contains each available function within its top layers and the assigned data respectively as a value. If you want to learn more about each line, please take a closer look at the bottom of the example.
Down below you will find a list that explains each of the top level keys including an example.
  1. add_row
    This key refers to the add_row() function of ACF: https://www.advancedcustomfields.com/resources/add_row
    {
        "add_row": [
          {
            "selector": "demo_repeater",
            "value": {
              "demo_repeater_field": "This is the first text",
              "demo_repeater_url": "https://someurl1.com"
            }
          },
          {
            "selector": "demo_repeater",
            "value": {
              "demo_repeater_field": "This is the second text",
              "demo_repeater_url": "https://someurl2.com"
            }
          }
        ]
    }
    
    The example value for this key above shows you on how you can add multiple keys and values using the add_row() function. To make it work, you can add an array within the given construct, using the selector key for the key of the repeater field and the value key for the actual row data. Please note that the value for the row data must be an array using the seen JSON notation (Do not simply include a string). The value for the given example will add a new row to the demo_repeater_content repeater field which includes a sub field called demo_repeater_child_field and another sub field called demo_repeater_child_url.
  2. add_sub_row
    This key refers to the add_sub_row() function of ACF: https://www.advancedcustomfields.com/resources/add_sub_row
    {
        "add_sub_row": [
          {
            "selector": [
              "demo_repeater_content", 1, "sub_repeater"
            ],
            "value": {
              "sub_repeater_field": "Sub Repeater Text Value"
            }
          }
        ]
    }
    
    Within the example above, you will see how you can add a row to a sub row (e.g. if the repeater field as also a repeater field). The selector key can contain a string or an array that determins the exact position of the sub row. You can see the value for the selector key as a mapping to the sub row. The value key can contain a string or an array, depending on the choice of the field.
  3. delete_field
    This key refers to the delete_field() function of ACF: https://www.advancedcustomfields.com/resources/delete_field
    {
        "delete_field": [
          {
            "selector": "demo_field"
          }
        ]
    }
    
    To delete a field, you can use the same notation as seen above in the example. Simply add another row to the JSON including the field name, of the field you want to delete, into the selector key. This will cause the field to be deleted. You can also use this function to clear repeater fields.
  4. delete_row
    This key refers to the delete_row() function of ACF: https://www.advancedcustomfields.com/resources/delete_row/
    {
        "delete_row": [
          {
            "selector": "demo_repeater_row",
            "row": 2
          }
        ]
    }
    
    The example above shows that the logic is going to delete the second row for the demo_repeater_content repeater field. You can also see that we send over the numeric value for the row which is required by ACF.
  5. delete_sub_field
    This key refers to the delete_sub_field() function of ACF: https://www.advancedcustomfields.com/resources/delete_sub_field/
    {
        "delete_sub_field": [
          {
            "selector": [
              "demo_repeater", 2, "sub_repeater", 2, "sub_repeater_field"
            ]
          }
        ]
    }
    
    This allows you to delete a specific field within a repeater, flexible content or sub-repeater, etc.. To make it work, you must need to set the selector key as an array containing the given mapping of the field you'd like to delete. The example deletes a fiel of a sub-repeater.
  6. delete_sub_row
    This key refers to the delete_sub_row() function of ACF: https://www.advancedcustomfields.com/resources/delete_sub_row/
    {
        "delete_sub_row": [
          {
            "selector": [
              "demo_repeater", 2, "sub_repeater"
            ],
            "row": 2
          }
        ]
    }
    
    Delete the whole row of a sub-repeater field or flexible content. For the selector key you must define an array (as seen in the example) that contains the exact mapping of the repeater/flexible field you want to target. As for the row key, you must set the number of the row you want to delete.
  7. update_field
    This key refers to the update_field() function of ACF: https://www.advancedcustomfields.com/resources/update_field
    {
        "update_field":[
          {
            "selector": "first_custom_key",
            "value": "Some custom value"
          },
          {
            "selector": "second_custom_key",
            "value": { "some_array_key": "Some array Value" }
          } 
        ]
    }
    
    The example value for this key above shows you on how you can add multiple keys and values using the update_field() function. To make it work, you can add an array within the given construct, using the selector key for the post meta key and the value key for the actual value. The example also shows on how you can include an array. To make that work, you can simply create a sub entry for the value instead of a simple string as seen in the second example.
  8. update_row
    This key refers to the update_row() function of ACF: https://www.advancedcustomfields.com/resources/update_row
    {
        "update_row":[
          {
            "selector": "demo_repeater",
            "row": 2,
            "value": {
              "demo_repeater_field": "New Demo Text",
              "demo_repeater_url": "https://somenewurl.com"
            }
          }
        ]
    }
    
    Using the update_row() function, you can update specific or all fields of that given row. To do so, simply define the repeater/flexible content field name afor the selector key, the row number for the row key and for the value key the array containing all of your required fields you want to update.
  9. update_sub_field
    This key refers to the update_sub_field() function of ACF: https://www.advancedcustomfields.com/resources/update_sub_field
    {
        "update_sub_field":[
          {
            "selector": [
              "demo_repeater", 2, "sub_repeater", 1, "sub_repeater_field"
            ],
            "value": "Some New Text"
          }
        ]
    }
    
    Use this function if your goal is to update a specific, nested field within a repeater/flexible content. As for the selector key, you need to set an array containing the exact mapping position to target the exact field you would like to update. As for the value, you can define the content of the field.
  10. update_sub_row
    This key refers to the update_sub_row() function of ACF: https://www.advancedcustomfields.com/resources/update_sub_row
    {
        "update_sub_row":[
          {
            "selector": [
              "demo_repeater", 2, "sub_repeater"
            ],
            "row": 2,
            "value": {
              "sub_repeater_field": "Updated Sub Row Text"
            }
          }
        ]
    }
    
    With this function, you can update a whole row within a repeater/flecible content field. To make it work, please define for the selector key an array contianing the exact mapping to target the row you want to update. For the row key, please specify the row within the sub field. As for the value, please include an array containing all single fields you would like to update.
Some tipps:
  1. You can combine all of the functions within a single JSON such as:
    {
        "update_field": {},
        "update_row": {},
        "update_sub_field": {},
        "update_sub_row": {}
    }
    
  2. You can include the value for this argument as a simple string to your webhook payload or you integrate it directly as JSON into your JSON payload (if you send a raw JSON response).
  3. Changing the order of the functions within the JSON causes the added values behave differently. If you, for example, add the delete_field key before the update_field key, the fields will first be deleted and then added/updated.
  4. The webhook response contains a validted array that shows each initialized meta entry, as well as the response from its original ACF function. This way you can see if the meta value was adjusted accordingly.

send_email
In case you set the send_email argument to yes, we will send an email from this WordPress site to the user email, containing his login details.

do_action
The do_action argument is an advanced webhook for developers. It allows you to fire a custom WordPress hook after the create_user action was fired.
You can use it to trigger further logic after the webhook action. Here's an example:

Let's assume you set for the do_action parameter fire_this_function. In this case, we will trigger an action with the hook name fire_this_function. Here's how the code would look in this case:
add_action( 'fire_this_function', 'my_custom_callback_function', 20, 4 );
function my_custom_callback_function( $user_data, $user_id, $user_meta, $update ){
    //run your custom logic in here
}
Here's an explanation to each of the variables that are sent over within the custom function.
  1. $user_data (array)
    Contains the data that is used to create the user.
  2. $user_id (integer)
    Contains the user id of the newly created user. Please note that it can also contain a wp_error object since it is the response of the wp_insert_user() function.
  3. $user_meta (string)
    Contains the unformatted user meta as you sent it over within the webhook request as a string.
  4. $update (bool)
    This value will be set to 'false' for the create_user webhook.
Here you can test the specified webhook. Please note, that this test can modify the data of your website (Depending on what action you test). Also, you will see the response as any web service receives it.
Please choose the webhook you are going to run the test with. Simply select the one you want to use down below.
Update a user via WP Webhooks Pro.
  • actionRequired
    Always required. Determines which webhook action you want to target. (Alternatively, set this value as a query parameter within the URL) For this webhook action, please set it to update_user
  • user_idRequired
    (Optional if user_email is defined) Include the numeric id of the user. (Note that the user_id has a higher priority than the user_email. More details in the description.)
  • user_emailRequired
    (Optional if user_id is defined) Include the email correlated to the account.
  • first_name
    The first name of the user.
  • last_name
    The last name of the user.
  • nickname
    The nickname. Please note that the nickname will be sanitized by WordPress automatically.
  • user_login
    A string with which the user can log in to your site.
  • display_name
    The name that will be seen on the frontend of your site.
  • user_nicename
    A URL-friendly name. Default is user' username.
  • description
    A description for the user that will be available on the profile page.
  • rich_editing
    Wether the user should be able to use the Rich editor. Set it to "yes" or "no". Default "no".
  • user_registered
    The date the user got registered. Date structure: Y-m-d H:i:s
  • user_url
    Include a website url.
  • role
    The main user role. If set, all additional roles are removed.
  • additional_roles
    This allows to add/remove multiple roles on a user. For more information, please read the description.
  • user_pass
    The user password. If not defined, we don't generate a new one.
  • manage_meta_data
    Manage your user-related meta data. Please see the description for further details.
  • manage_acf_data
    Allows you to manage fields that are especially related to Advanced Custom Fields. See the description for further information.
  • send_email
    Set this field to "yes" to send a email to the user with the data.
  • do_action
    Advanced: Register a custom action after Webhooks Pro fires this webhook. More infos are in the description.
  • create_if_none
    Wether you want to create the user if it does not exists or not. Set it to "yes" or "no" Default is "no".
  • success
    (Bool) True if the action was successful, false if not. E.g. array( 'success' => true )
  • data
    (array) User related data as an array. We return the user id with the key "user_id" and the user data with the key "user_data". E.g. array( 'data' => array(...) )
  • msg
    (string) A message with more information about the current request. E.g. array( 'msg' => "This action was successful." )

Here is an example of all the available default fields. The fields may vary based on custom extensions, third party plugins or different values.

$return_args = array(
    'success' => false,
    'data' => array(
        'user_id' => 0,
        'user_data' => array()
    )
);
        

This webhook action is used to update a user on your WordPress system via a webhook call.
The description is uniquely made for the update_user webhook action.
In case you want to first understand how to setup webhook actions in general, please check out the following manuals:
https://ironikus.com/docs/article-categories/get-started/

How to use update_user

  1. The first argument you need to set within your webhook action request is the action argument. This argument is always required. Please set it to update_user.
  2. It is also required to set the users email address or the user id using the argument user_email/user_id. You can as well set both of them, but in this case, the user id has a higher priority than the email for fetching the user.
  3. All the other arguments are optional and just extend the updating process of the user.


Special Arguments


role
The slug of the role. The default roles have the following slugs: administrator, editor, author, contributor, subscriber
Important: Please note that once you set this value while updating a user, all of your additional roles are removed from that user. This is a default WordPress behavior. If you don't want that, please only use the additional_roles argument and leave this one empty. (In case you set the argument create_if_none to yes, it will create the user with the default role. If you don't want that, simply remove that role within the additional_roles argument again).

additional_roles
This argument allows you to add or remove additional roles on the user. There are two possible ways of doing that:
  1. String method
    This method allows you to add or remove the user roles using a simple string. To make it work, simply add the slug of the role and define the action (add/remove) after, separated by double points (:). If you want to add multiple roles, simply separate them with a semicolon (;). Please refer to the example down below.
    editor:add;custom-role:add;custom-role-1:remove
  2. JSON method
    We also support a JSON formatted string, which contains the role slug as the JSON key and the action (add/remove) as the value. Please refer to the example below:
    {
      "editor": "add",
      "custom-role": "add",
      "custom-role-1": "remove"
    }

user_meta (Deprecated)
This argument is specifically designed to add/update or remove user meta to your updated user.
To create/update or delete custom meta values, we offer you two different ways:
  1. String method
    This method allows you to add/update or delete the user meta using a simple string. To make it work, separate the meta key from the value using a comma (,). To separate multiple meta settings from each other, simply separate them with a semicolon (;). To remove a meta value, simply set as a value ironikus-delete
    meta_key_1,meta_value_1;my_second_key,ironikus-delete
    IMPORTANT: Please note that if you want to use values that contain commas or semicolons, the string method does not work. In this case, please use the JSON method.
  2. JSON method
    This method allows you to add/update or remove the user meta using a JSON formatted string. To make it work, add the meta key as the key and the meta value as the value. To delete a meta value, simply set the value to ironikus-delete. Here's an example on how this looks like:
    {
    "meta_key_1": "This is my meta value 1",
    "another_meta_key": "This is my second meta key!"
    "third_meta_key": "ironikus-delete"
    }
Advanced: We also offer JSON to array/object serialization for single user meta values. This means, you can turn JSON into a serialized array or object.
As an example: The following JSON {"price": "100"} will turn into O:8:"stdClass":1:{s:5:"price";s:3:"100";} with default serialization or into a:1:{s:5:"price";s:3:"100";} with array serialization.
  1. Object serialization
    This method allows you to serialize a JSON to an object using the default json_decode() function of PHP.
    To serialize your JSON to an object, you need to add the following string in front of the escaped JSON within the value field of your single meta value of the user_meta argument: ironikus-serialize. Here's a full example:
    {
    "meta_key_1": "This is my meta value 1",
    "another_meta_key": "This is my second meta key!",
    "third_meta_key": "ironikus-serialize{\"price\": \"100\"}"
    }
    This example will create three user meta entries. The third entry has the meta key third_meta_key and a serialized meta value of O:8:"stdClass":1:{s:5:"price";s:3:"100";}. The string ironikus-serialize in front of the escaped JSON will tell our plugin to serialize the value. Please note that the JSON value, which you include within the original JSON string of the user_meta argument, needs to be escaped.
  2. Array serialization
    This method allows you to serialize a JSON to an array using the json_decode( $json, true ) function of PHP.
    To serialize your JSON to an array, you need to add the following string in front of the escaped JSON within the value field of your single meta value of the user_meta argument: ironikus-serialize-array. Here's a full example:
    {
    "meta_key_1": "This is my meta value 1",
    "another_meta_key": "This is my second meta key!",
    "third_meta_key": "ironikus-serialize-array{\"price\": \"100\"}"
    }
    This example will create three user meta entries. The third entry has the meta key third_meta_key and a serialized meta value of a:1:{s:5:"price";s:3:"100";}. The string ironikus-serialize-array in front of the escaped JSON will tell our plugin to serialize the value. Please note that the JSON value, which you include within the original JSON string of the user_meta argument, needs to be escaped.

manage_meta_data
This argument integrates the full features of managing user related meta values.

Please note: This argument is very powerful and requires some good understanding of JSON. It is integrated with the commonly used functions for managing user meta within WordPress. You can find a list of all avaialble functions here:
Down below you will find a complete JSON example that shows you how to use each of the functions above.

We also offer JSON to array/object serialization for single user meta values. This means, you can turn JSON into a serialized array or object.
This argument accepts a JSON construct as an input. This construct contains each available function as a top-level key within the first layer and the assigned data respectively as a value. If you want to learn more about each line, please take a closer look at the bottom of the example.
{
   "add_user_meta":[
      {
        "meta_key": "first_custom_key",
        "meta_value": "Some custom value"
      },
      {
        "meta_key": "second_custom_key",
        "meta_value": { "some_array_key": "Some array Value" },
        "unique": true
      } 
    ],
   "update_user_meta":[
      {
        "meta_key": "first_custom_key",
        "meta_value": "Some custom value"
      },
      {
        "meta_key": "second_custom_key",
        "meta_value": "The new value",
        "prev_value": "The previous value"
      } 
    ],
   "delete_user_meta":[
      {
        "meta_key": "first_custom_key"
      },
      {
        "meta_key": "second_custom_key",
        "meta_value": "Target specific value"
      } 
    ]
}
Down below you will find a list that explains each of the top level keys.
  1. add_user_meta
    This key refers to the add_user_meta() function of WordPress: https://developer.wordpress.org/reference/functions/add_user_meta/
    In the example above, you will find two entries within the add_user_meta key. The first one shows the default behavior using only the meta key and the value. This causes the meta key to be created without checking upfront if it exists - that allows you to create the meta value multiple times.
    As seen in the second entry, you will find a third key called unique that allows you to check upfront if the meta key exists already. If it does, the meta entry is neither created, nor updated. Set the value to true to check against existing ones. Default: false
    If you look closely to the second entry again, the value included is not a string, but a JSON construct, which is considered as an array and will therefore be serialized. The given value will be saved to the database in the following format: a:1:{s:14:"some_array_key";s:16:"Some array Value";}
  2. update_user_meta
    This key refers to the update_user_meta() function of WordPress: https://developer.wordpress.org/reference/functions/update_user_meta/
    The example above shows you two entries for this function. The first one is the default set up thats used in most cases. Simply define the meta key and the meta value and the key will be updated if it does exist and if it does not exist, it will be created.
    The third argument, as seen in the second entry, allows you to check against a previous value before updating. That causes that the meta value will only be updated if the previous key fits to whats currently saved within the database. Default: ''
  3. delete_user_meta
    This key refers to the delete_user_meta() function of WordPress: https://developer.wordpress.org/reference/functions/delete_user_meta/
    Within the example above, you will see that only the meta key is required for deleting an entry. This will cause all meta keys on this post with the same key to be deleted.
    The second argument allows you to target only a specific meta key/value combination. This gets important if you want to target a specific meta key/value combination and not delete all available entries for the given post. Default: ''
Some tipps:
  1. You can include the value for this argument as a simple string to your webhook payload or you integrate it directly as JSON into your JSON payload (if you send a raw JSON response).
  2. Changing the order of the functions within the JSON causes the user meta to behave differently. If you, for example, add the delete_user_meta key before the update_user_meta key, the meta values will first be deleted and then added/updated.
  3. The webhook response contains a validted array that shows each initialized meta entry, as well as the response from its original WordPress function. This way you can see if the meta value was updated accordingly.

manage_acf_data
This argument integrates this endpoint with Advanced Custom Fields.

Please note: This argument is very powerful and requires some good understanding of JSON. It is integrated with all Update functions offered by ACF. You can find a list of all update functions here: https://www.advancedcustomfields.com/resources/#functions
Down below you will find some examples that show you how to use each of the functions.

This argument accepts a validated JSON construct as an input. This construct contains each available function within its top layers and the assigned data respectively as a value. If you want to learn more about each line, please take a closer look at the bottom of the example.
Down below you will find a list that explains each of the top level keys including an example.
  1. add_row
    This key refers to the add_row() function of ACF: https://www.advancedcustomfields.com/resources/add_row
    {
        "add_row": [
          {
            "selector": "demo_repeater",
            "value": {
              "demo_repeater_field": "This is the first text",
              "demo_repeater_url": "https://someurl1.com"
            }
          },
          {
            "selector": "demo_repeater",
            "value": {
              "demo_repeater_field": "This is the second text",
              "demo_repeater_url": "https://someurl2.com"
            }
          }
        ]
    }
    
    The example value for this key above shows you on how you can add multiple keys and values using the add_row() function. To make it work, you can add an array within the given construct, using the selector key for the key of the repeater field and the value key for the actual row data. Please note that the value for the row data must be an array using the seen JSON notation (Do not simply include a string). The value for the given example will add a new row to the demo_repeater_content repeater field which includes a sub field called demo_repeater_child_field and another sub field called demo_repeater_child_url.
  2. add_sub_row
    This key refers to the add_sub_row() function of ACF: https://www.advancedcustomfields.com/resources/add_sub_row
    {
        "add_sub_row": [
          {
            "selector": [
              "demo_repeater_content", 1, "sub_repeater"
            ],
            "value": {
              "sub_repeater_field": "Sub Repeater Text Value"
            }
          }
        ]
    }
    
    Within the example above, you will see how you can add a row to a sub row (e.g. if the repeater field as also a repeater field). The selector key can contain a string or an array that determins the exact position of the sub row. You can see the value for the selector key as a mapping to the sub row. The value key can contain a string or an array, depending on the choice of the field.
  3. delete_field
    This key refers to the delete_field() function of ACF: https://www.advancedcustomfields.com/resources/delete_field
    {
        "delete_field": [
          {
            "selector": "demo_field"
          }
        ]
    }
    
    To delete a field, you can use the same notation as seen above in the example. Simply add another row to the JSON including the field name, of the field you want to delete, into the selector key. This will cause the field to be deleted. You can also use this function to clear repeater fields.
  4. delete_row
    This key refers to the delete_row() function of ACF: https://www.advancedcustomfields.com/resources/delete_row/
    {
        "delete_row": [
          {
            "selector": "demo_repeater_row",
            "row": 2
          }
        ]
    }
    
    The example above shows that the logic is going to delete the second row for the demo_repeater_content repeater field. You can also see that we send over the numeric value for the row which is required by ACF.
  5. delete_sub_field
    This key refers to the delete_sub_field() function of ACF: https://www.advancedcustomfields.com/resources/delete_sub_field/
    {
        "delete_sub_field": [
          {
            "selector": [
              "demo_repeater", 2, "sub_repeater", 2, "sub_repeater_field"
            ]
          }
        ]
    }
    
    This allows you to delete a specific field within a repeater, flexible content or sub-repeater, etc.. To make it work, you must need to set the selector key as an array containing the given mapping of the field you'd like to delete. The example deletes a fiel of a sub-repeater.
  6. delete_sub_row
    This key refers to the delete_sub_row() function of ACF: https://www.advancedcustomfields.com/resources/delete_sub_row/
    {
        "delete_sub_row": [
          {
            "selector": [
              "demo_repeater", 2, "sub_repeater"
            ],
            "row": 2
          }
        ]
    }
    
    Delete the whole row of a sub-repeater field or flexible content. For the selector key you must define an array (as seen in the example) that contains the exact mapping of the repeater/flexible field you want to target. As for the row key, you must set the number of the row you want to delete.
  7. update_field
    This key refers to the update_field() function of ACF: https://www.advancedcustomfields.com/resources/update_field
    {
        "update_field":[
          {
            "selector": "first_custom_key",
            "value": "Some custom value"
          },
          {
            "selector": "second_custom_key",
            "value": { "some_array_key": "Some array Value" }
          } 
        ]
    }
    
    The example value for this key above shows you on how you can add multiple keys and values using the update_field() function. To make it work, you can add an array within the given construct, using the selector key for the post meta key and the value key for the actual value. The example also shows on how you can include an array. To make that work, you can simply create a sub entry for the value instead of a simple string as seen in the second example.
  8. update_row
    This key refers to the update_row() function of ACF: https://www.advancedcustomfields.com/resources/update_row
    {
        "update_row":[
          {
            "selector": "demo_repeater",
            "row": 2,
            "value": {
              "demo_repeater_field": "New Demo Text",
              "demo_repeater_url": "https://somenewurl.com"
            }
          }
        ]
    }
    
    Using the update_row() function, you can update specific or all fields of that given row. To do so, simply define the repeater/flexible content field name afor the selector key, the row number for the row key and for the value key the array containing all of your required fields you want to update.
  9. update_sub_field
    This key refers to the update_sub_field() function of ACF: https://www.advancedcustomfields.com/resources/update_sub_field
    {
        "update_sub_field":[
          {
            "selector": [
              "demo_repeater", 2, "sub_repeater", 1, "sub_repeater_field"
            ],
            "value": "Some New Text"
          }
        ]
    }
    
    Use this function if your goal is to update a specific, nested field within a repeater/flexible content. As for the selector key, you need to set an array containing the exact mapping position to target the exact field you would like to update. As for the value, you can define the content of the field.
  10. update_sub_row
    This key refers to the update_sub_row() function of ACF: https://www.advancedcustomfields.com/resources/update_sub_row
    {
        "update_sub_row":[
          {
            "selector": [
              "demo_repeater", 2, "sub_repeater"
            ],
            "row": 2,
            "value": {
              "sub_repeater_field": "Updated Sub Row Text"
            }
          }
        ]
    }
    
    With this function, you can update a whole row within a repeater/flecible content field. To make it work, please define for the selector key an array contianing the exact mapping to target the row you want to update. For the row key, please specify the row within the sub field. As for the value, please include an array containing all single fields you would like to update.
Some tipps:
  1. You can combine all of the functions within a single JSON such as:
    {
        "update_field": {},
        "update_row": {},
        "update_sub_field": {},
        "update_sub_row": {}
    }
    
  2. You can include the value for this argument as a simple string to your webhook payload or you integrate it directly as JSON into your JSON payload (if you send a raw JSON response).
  3. Changing the order of the functions within the JSON causes the added values behave differently. If you, for example, add the delete_field key before the update_field key, the fields will first be deleted and then added/updated.
  4. The webhook response contains a validted array that shows each initialized meta entry, as well as the response from its original ACF function. This way you can see if the meta value was adjusted accordingly.

send_email
In case you set the send_email argument to yes, we will send an email from this WordPress site to the user email, containing his login details.

do_action
The do_action argument is an advanced webhook for developers. It allows you to fire a custom WordPress hook after the update_user action was fired.
You can use it to trigger further logic after the webhook action. Here's an example:

Let's assume you set for the do_action parameter fire_this_function. In this case, we will trigger an action with the hook name fire_this_function. Here's how the code would look in this case:
add_action( 'fire_this_function', 'my_custom_callback_function', 20, 4 );
function my_custom_callback_function( $user_data, $user_id, $user_meta, $update ){
    //run your custom logic in here
}
Here's an explanation to each of the variables that are sent over within the custom function.
  1. $user_data (array)
    Contains the data that is used to update the user.
  2. $user_id (integer)
    Contains the user id of the updated user. Please note that it can also contain a wp_error object since it is the response of the wp_insert_user() function.
  3. $user_meta (string)
    Contains the unformatted user meta as you sent it over within the webhook request as a string.
  4. $update (bool)
    This value will be set to 'true' for the update_user webhook.

create_if_none
In case you set the create_if_none argument to yes, a user will be created with the given details in case it does not exist.
Here you can test the specified webhook. Please note, that this test can modify the data of your website (Depending on what action you test). Also, you will see the response as any web service receives it.
Please choose the webhook you are going to run the test with. Simply select the one you want to use down below.
Delete a user via WP Webhooks Pro.
  • actionRequired
    Always required. Determines which webhook action you want to target. (Alternatively, set this value as a query parameter within the URL) For this webhook action, please set it to delete_user
  • user_idRequired
    (Optional if user_email is defined) Include the numeric id of the user.
  • user_emailRequired
    (Optional if user_email is defined) Include the assigned email of the user.
  • send_email
    Set this field to "yes" to send a email to the user that the account got deleted.
  • remove_from_network
    Set this field to "yes" to delete a user from the whole network. WARNING: This will delete all posts authored by the user. Default: "no"
  • do_action
    Advanced: Register a custom action after Webhooks Pro fires this webhook. More infos are in the description.
  • success
    (Bool) True if the action was successful, false if not. E.g. array( 'success' => true )
  • data
    (array) User related data as an array. We return the user id with the key "user_id" and the user delete success boolean with the key "user_deleted". E.g. array( 'data' => array(...) )
  • msg
    (string) A message with more information about the current request. E.g. array( 'msg' => "This action was successful." )

Here is an example of all the available default fields. The fields may vary based on custom extensions, third party plugins or different values.

$return_args = array(
    'success' => false,
    'msg'     => '',
    'data' => array(
        'user_deleted' => false,
        'user_id' => 0
    )
);
        

This webhook action is used to delete a user on your WordPress system via a webhook call.
This description is uniquely made for the delete_user webhook action.
In case you want to first understand on how to setup webhook actions in general, please check out the following manuals:
https://ironikus.com/docs/article-categories/get-started/

How to use delete_user

  1. The first argument you need to set within your webhook action request is the action argument. This argument is always required. Please set it to delete_user.
  2. It is also required to set either the email or the user id of the user you want to delete. You can do that by using the user_id or user_email argument.
  3. All the other arguments are optional and just extend the deletion of the user.
  4. Please note that deleting a user inside of a multisite network without setting the remove_from_network argument, just deletes the user from the current site, but not from the whole network.


Special Arguments


send_email
In case you set the send_email argument to yes, we will send an email from this WordPress site to the user email, containing the notice of the deleted account.

do_action
The do_action argument is an advanced webhook for developers. It allows you to fire a custom WordPress hook after the delete_user action was fired.
You can use it to trigger further logic after the webhook action. Here's an example:

Let's assume you set for the do_action parameter fire_this_function. In this case, we will trigger an action with the hook name fire_this_function. Here's how the code would look in this case:
add_action( 'fire_this_function', 'my_custom_callback_function', 20, 4 );
function my_custom_callback_function( $user, $user_id, $user_email, $send_email ){
    //run your custom logic in here
}
Here's an explanation to each of the variables that are sent over within the custom function.
  1. $user (object)
    Contains the WordPress user object.
  2. $user_id (integer)
    Contains the user id of the deleted user. Please note that it can also contain a wp_error object since it is the response of the wp_insert_user() function.
  3. $user_email (string)
    Contains the user email.
  4. $send_email (string)
    Returns either yes or no, depending on your settings for the send_email argument.
Here you can test the specified webhook. Please note, that this test can modify the data of your website (Depending on what action you test). Also, you will see the response as any web service receives it.
Please choose the webhook you are going to run the test with. Simply select the one you want to use down below.
Search for users on your WordPress website
  • actionRequired
    Always required. Determines which webhook action you want to target. (Alternatively, set this value as a query parameter within the URL) For this webhook action, please set it to get_users
  • argumentsRequired
    A string containing a JSON construct in the WP_User_Query notation. Please check the description for more information.
  • return_only
    Define the data you want to return. Please check the description for more information. Default: get_results
  • do_action
    Advanced: Register a custom action after Webhooks Pro fires this webhook. More infos are in the description.
  • success
    (Bool) True if the action was successful, false if not. E.g. array( 'success' => true )
  • data
    The data construct of the user query. This depends on the parameters you send.
  • msg
    (string) A message with more information about the current request. E.g. array( 'msg' => "This action was successful." )

Here is an example of all the available default fields. The fields may vary based on custom extensions, third party plugins or different values.

$return_args = array(
    'success' => false,
    'msg'     => '',
    'data' => array()
);
        

This webhook action is used to fetch one or multiple users from your WordPress system via a webhook call.
This description is uniquely made for the get_users webhook action.
In case you want to first understand on how to setup webhook actions in general, please check out the following manuals:
https://ironikus.com/docs/article-categories/get-started/

How to use get_users

  1. The first argument you need to set within your webhook action request is the action argument. This argument is always required. Please set it to get_users.
  2. It is also required to set the argument arguments, which contains a JSON formatted string with the parameters used to identify the users.
  3. All the other arguments are optional and just extend the fetching of the users.


Special Arguments


arguments
This argument contains a JSON formatted string, which includes certain arguments from the WordPress user query called WP_User_Query. For further details, please check out the following link:
https://codex.wordpress.org/Class_Reference/WP_User_Query
Here is an example on how the JSON is set up:
{"search":"Max","number":5}
The example above will filter the users for the name "Max" and returns maximum five users with that name.

return_only
You can also manipulate the output of the query using the return_only parameter. This allows you to, for example, output either only the search results, the total count, the whole query object or any combination in between. Here is an example that returns all of the data:
get_total,get_results,all,meta_data
The all argument returns the whole WP_Query object, but not the results of the query. If you want the results of the query, you can use the get_results value. To use the meta_data setting, you also need to set the get_results key since the meta data will be attached to every user entry.

do_action
The do_action argument is an advanced webhook for developers. It allows you to fire a custom WordPress hook after the get_users action was fired.
You can use it to trigger further logic after the webhook action. Here's an example:

Let's assume you set for the do_action parameter fire_this_function. In this case, we will trigger an action with the hook name fire_this_function. Here's how the code would look in this case:
add_action( 'fire_this_function', 'my_custom_callback_function', 20, 4 );
function my_custom_callback_function( $return_args, $user_query, $args, $return_only ){
    //run your custom logic in here
}
Here's an explanation to each of the variables that are sent over within the custom function.
  1. $return_args (array)
    All the values that are sent back as a response the the initial webhook action caller.
  2. $user_query (object)
    The full WP_User_Query object.
  3. $args (string)
    The string formatted JSON construct that was sent by the caller within the arguments argument.
  4. $return_only (string)
    The string that was sent by the caller via the return_only argument.
Here you can test the specified webhook. Please note, that this test can modify the data of your website (Depending on what action you test). Also, you will see the response as any web service receives it.
Please choose the webhook you are going to run the test with. Simply select the one you want to use down below.
Returns the object of a user
  • actionRequired
    Always required. Determines which webhook action you want to target. (Alternatively, set this value as a query parameter within the URL) For this webhook action, please set it to get_user
  • user_valueRequired
    The user id of the user. You can also use certain other values. Please check the descripton for more details.
  • value_type
    You can choose between certain value types. Possible: id, slug, email, login
  • do_action
    Advanced: Register a custom action after Webhooks Pro fires this webhook. More infos are in the description.
  • success
    (Bool) True if the action was successful, false if not. E.g. array( 'success' => true )
  • data
    The data construct of the user qury. This depends on the parameters you send.
  • msg
    (string) A message with more information about the current request. E.g. array( 'msg' => "This action was successful." )

Here is an example of all the available default fields. The fields may vary based on custom extensions, third party plugins or different values.

$return_args = array(
    'success' => false,
    'msg'     => '',
    'data' => array()
);
        

This webhook action is used to fetch a single users from your WordPress system via a webhook call.
It uses the WordPress function get_user_by() to fetch the user from the database. To learn more about this function, please check the official WordPress docs:https://developer.wordpress.org/reference/functions/get_user_by/

This description is uniquely made for the get_user webhook action.
In case you want to first understand on how to setup webhook actions in general, please check out the following manuals:
https://ironikus.com/docs/article-categories/get-started/

How to use get_user

  1. The first argument you need to set within your webhook action request is the action argument. This argument is always required. Please set it to get_user.
  2. It is also required to set the argument user_value, which by default is the user id. You can also use other values like the email or the login name (But for doing so, please read the next step).
  3. In case you want to use e.g. the email instead of the user id, you need to set the argument value_type to email. Further details are down below within the Special Arguments description.
  4. All the other arguments are optional and just extend the fetching of the user.


Special Arguments


value_type
This argument is used to change the data you can add within the user_value argument. Possible values are: id, ID, slug, email, login

do_action
The do_action argument is an advanced webhook for developers. It allows you to fire a custom WordPress hook after the get_user action was fired.
You can use it to trigger further logic after the webhook action. Here's an example:

Let's assume you set for the do_action parameter fire_this_function. In this case, we will trigger an action with the hook name fire_this_function. Here's how the code would look in this case:
add_action( 'fire_this_function', 'my_custom_callback_function', 20, 4 );
function my_custom_callback_function( $return_args, $user_value, $value_type, $user ){
    //run your custom logic in here
}
Here's an explanation to each of the variables that are sent over within the custom function.
  1. $return_args (array)
    All the values that are sent back as a response the the initial webhook action caller.
  2. $user_value (string)
    The value you included into the user_value argument.
  3. $value_type (string)
    The value you included into the value_type argument.
  4. $user (mixed)
    Returns null in case an the user_value wasn't set, the user object on success or a wp_error object in case an error occurs.
Here you can test the specified webhook. Please note, that this test can modify the data of your website (Depending on what action you test). Also, you will see the response as any web service receives it.
Please choose the webhook you are going to run the test with. Simply select the one you want to use down below.
Insert/Create a post. You have all functionalities available from wp_insert_post
  • actionRequired
    Always required. Determines which webhook action you want to target. (Alternatively, set this value as a query parameter within the URL) For this webhook action, please set it to create_post
  • post_author
    (mixed) The ID or the email of the user who added the post. Default is the current user ID.
  • post_date
    (string) The date of the post. Default is the current time. Format: 2018-12-31 11:11:11
  • post_date_gmt
    (string) The date of the post in the GMT timezone. Default is the value of $post_date.
  • post_content
    (string) The post content. Default empty.
  • post_content_filtered
    (string) The filtered post content. Default empty.
  • post_title
    (string) The post title. Default empty.
  • post_excerpt
    (string) The post excerpt. Default empty.
  • post_status
    (string) The post status. Default 'draft'.
  • post_type
    (string) The post type. Default 'post'.
  • comment_status
    (string) Whether the post can accept comments. Accepts 'open' or 'closed'. Default is the value of 'default_comment_status' option.
  • ping_status
    (string) Whether the post can accept pings. Accepts 'open' or 'closed'. Default is the value of 'default_ping_status' option.
  • post_password
    (string) The password to access the post. Default empty.
  • post_name
    (string) The post name. Default is the sanitized post title when creating a new post.
  • to_ping
    (string) Space or carriage return-separated list of URLs to ping. Default empty.
  • pinged
    (string) Space or carriage return-separated list of URLs that have been pinged. Default empty.
  • post_parent
    (int) Set this for the post it belongs to, if any. Default 0.
  • menu_order
    (int) The order the post should be displayed in. Default 0.
  • post_mime_type
    (string) The mime type of the post. Default empty.
  • guid
    (string) Global Unique ID for referencing the post. Default empty.
  • import_id
    (integer) In case you want to give your post a specific post id, please define it here. See the description for further details.
  • post_category
    (string) A comma separated list of category names, slugs, or IDs. Defaults to value of the 'default_category' option. Example: cat_1,cat_2,cat_3
  • tags_input
    (string) A comma separated list of tag names, slugs, or IDs. Default empty.
  • tax_input
    (string) A simple or JSON formatted string containing existing taxonomy terms. Default empty. More details within the description.
  • manage_meta_data
    Manage your post-related meta data. Please see the description for further details.
  • manage_acf_data
    Allows you to manage fields that are especially related to Advanced Custom Fields. See the description for further information.
  • wp_error
    Whether to return a WP_Error on failure. Posible values: "yes" or "no". Default value: "no".
  • do_action
    Advanced: Register a custom action after Webhooks Pro fires this webhook. More infos are in the description.
  • success
    (Bool) True if the action was successful, false if not. E.g. array( 'success' => true )
  • data
    (array) User related data as an array. We return the post id with the key "post_id" and the post data with the key "post_data". E.g. array( 'data' => array(...) )
  • msg
    (string) A message with more information about the current request. E.g. array( 'msg' => "This action was successful." )

Here is an example of all the available default fields. The fields may vary based on custom extensions, third party plugins or different values.

$return_args = array(
    'success'   => false,
    'msg'       => '',
    'data'      => array(
        'post_id' => null,
        'post_data' => null
    )
);
        

This webhook action is used to create a post on your WordPress system via a webhook call.
The description is uniquely made for the create_post webhook action.
In case you want to first understand how to setup webhook actions in general, please check out the following manuals:
https://ironikus.com/docs/article-categories/get-started/

How to use create_post

  1. The first argument you need to set within your webhook action request is the action argument. This argument is always required. Please set it to create_post.
  2. All the other arguments are optional and just extend the creation of the post. We would still recommend to set the attribute post_title, to make recognizing it easy, as well as for creating proper permalinks/slugs.


Tipps

  1. In case you want to create a post for a custom post type, you can do that by using the post_type argument.
  2. By default, we create each post in a draft state. If you want to directly publish a post, use the post_status argument and set it to publish.
  3. In case you want to set a short description for your post, you can use the post_excerpt argument.


Special Arguments


post_author
The post author argument accepts either the user id of a user, or the email address of an existing user. In case you choose the email adress, we try to match it with the users on your WordPress site. In case we couldn't find a user for the given email, we leave the field empty.

post_content
The post content is the main content area of the post. It can contain HTML or any other kind of content necessary for your functionality.

post_status
The post status defines further details about how your post will be treated. By default, WordPress offers the following post statuses: draft, pending, private, publish. Please note that other plugins can extend the post status values to offer a bigger variety, e.g. Woocommerce.

post_type
The post type determines to which group of posts your currently created post belongs. Please use the slug of the post type to assign it properly.

import_id
This argument allows you to define a suggested post ID for your post. In case the ID is already taken, the post will be created using the default behavior by asigning automatically an ID.

tags_input
This argument supports the default tags_input variable of the wp_insert_post() function. Please use this function only if you are known to its functionality since WordPress might not add the values properly due to permissions. If you are not sure, please use the tax_input argument instead.

Here is an example:
342,5678,2
This argument supports a comma separated list of tag names, slugs, or IDs.

tax_input
This argument allows you to add/append/delete any kind of taxonomies on your post. It uses a custom functionality that adds the taxonomies independently of the wp_update_post() function.
To make it work, we offer certain different features and methods to make the most out of the taxonomy management. Down below, you will find further information about the whole functionality.
  1. String method
    This method allows you to add/update/delete or bulk manage the post taxonomies using a simple string. Both the string and the JSON method support custom taxonomies too. In case you use more complex taxonomies that use semicolons or double points within the slugs, you need to use the JSON method.
    • Replace existing taxonomy items
      This method allows you to replace already existing taxonomy items on the post. In case a taxonomy item does not exists at the point you want to add it, it will be ignored.
      taxonomy_1,tax_item_1:tax_item_2:tax_item_3;taxonomy_2,tax_item_5:tax_item_7:tax_item_8
      To separate the taxonomies from the single taxonomy items, please use a comma ",". In case you want to add multiple items per taxonomy, you can separate them via a double point ":". To separate multiple taxonomies from each other, please separate them with a semicolon ";" (It is not necessary to set a semicolon at the end of the last one)
    • Remove all taxonomy items for a single taxonomy
      In case you want to remove all taxonomy items from one or multiple taxonomies, you can set ironikus-remove-all; in front of a semicolon-separated list of the taxonomies you want to remove all items for. Here is an example:
      ironikus-remove-all;taxonomy_1;taxonomy_2
    • Remove single taxonomy items for a taxonomy
      You can also remove only single taxonomy items for one or multiple taxonomies. Here is an example:
      ironikus-append;taxonomy_1,value_1:value_2-ironikus-delete:value_3;taxonomy_2,value_5:value_6:value_7-ironikus-delete
      In the example above, we append the taxonomies taxonomy_1 and taxonomy_2. We also add the taxonomy items value_1, value_3, value_5 and value_6. We also remove the taxonomy items value_2 and value_7.
    • Append taxonomy items
      You can also append any taxonomy items without the existing ones being replaced. To do that, simply add ironikus-append; at the beginning of the string.
      ironikus-append;taxonomy_1,value_1:value_2:value_3;taxonomy_2,value_1:value_2:value_3
      In the example above, we append the taxonomies taxonomy_1 and taxonomy_2 with multiple taxonomy items on the post. The already assigned ones won't be replaced.
  2. JSON method
    This method allows you to add/update/delete or bulk manage the post taxonomies using a simple string. Both the string and the JSON method support custom taxonomies too.
    • Replace existing taxonomy items
      This JSON allows you to replace already existing taxonomy items on the post. In case a taxonomy item does not exists at the point you want to add it, it will be ignored.
      {
        "category": [
          "test-category",
          "second-category"
        ],
        "post_tag": [
          "dog",
          "male",
          "simple"
        ]
      }
      The key on the first layer of the JSON is the slug of the taxonomy. As a value, it accepts multiple slugs of the single taxonomy terms. To add multiple taxonomies, simply append them on the first layer of the JSON.
    • Remove all taxonomy items for a single taxonomy
      In case you want to remove all taxonomy items from one or multiple taxonomies, you can set ironikus-remove-all as a separate value with the wpwhtype key. The wpwhtype key is a reserved key for further actions on the data. Here is an example:
      {
        "wpwhtype": "ironikus-remove-all",
        "category": [],
        "post_tag": []
      }
    • Append taxonomy items
      You can also append any taxonomy items without the existing ones being replaced. To do that, simply add ironikus-append to the wpwhtype key. The wpwhtype key is a reserved key for further actions on the data. All the taxonomies you add after, will be added to the existing ones on the post.
      {
        "wpwhtype": "ironikus-append",
        "category": [
          "test-category",
          "second-category"
        ],
        "post_tag": [
          "dog"
        ]
      }
      In the example above, we append the taxonomies category and post_tag with multiple taxonomy items on the post. The already assigned ones won't be replaced.
    • Remove single taxonomy items for a taxonomy
      You can also remove only single taxonomy items for one or multiple taxonomies. To do that, simply append -ironikus-delete at the end of the taxonomy term slug. This specific taxonomy term will then be removed from the post. Here is an example:
      {
        "wpwhtype": "ironikus-append",
        "category": [
          "test-category",
          "second-category-ironikus-delete"
        ],
        "post_tag": [
          "dog-ironikus-delete"
        ]
      }
      In the example above, we append the taxonomies category and post_tag. We also add the taxonomy item test-category. We also remove the taxonomy items second-category and dog.

meta_input (Deprecated)
This argument is specifically designed to add/update or remove post meta to your created post.
To create/update or delete custom meta values, we offer you two different ways:
  1. String method
    This method allows you to add/update or delete the post meta using a simple string. To make it work, separate the meta key from the value using a comma (,). To separate multiple meta settings from each other, simply separate them with a semicolon (;). To remove a meta value, simply set as a value ironikus-delete
    meta_key_1,meta_value_1;my_second_key,ironikus-delete
    IMPORTANT: Please note that if you want to use values that contain commas or semicolons, the string method does not work. In this case, please use the JSON method.
  2. JSON method
    This method allows you to add/update or remove the post meta using a JSON formatted string. To make it work, add the meta key as the key and the meta value as the value. To delete a meta value, simply set the value to ironikus-delete. Here's an example on how this looks like:
    {
    "meta_key_1": "This is my meta value 1",
    "another_meta_key": "This is my second meta key!"
    "third_meta_key": "ironikus-delete"
    }
Advanced: We also offer JSON to array/object serialization for single post meta values. This means, you can turn JSON into a serialized array or object.
As an example: The following JSON {"price": "100"} will turn into O:8:"stdClass":1:{s:5:"price";s:3:"100";} with default serialization or into a:1:{s:5:"price";s:3:"100";} with array serialization.
  1. Object serialization
    This method allows you to serialize a JSON to an object using the default json_decode() function of PHP.
    To serialize your JSON to an object, you need to add the following string in front of the escaped JSON within the value field of your single meta value of the meta_input argument: ironikus-serialize. Here's a full example:
    {
    "meta_key_1": "This is my meta value 1",
    "another_meta_key": "This is my second meta key!",
    "third_meta_key": "ironikus-serialize{\"price\": \"100\"}"
    }
    This example will create three post meta entries. The third entry has the meta key third_meta_key and a serialized meta value of O:8:"stdClass":1:{s:5:"price";s:3:"100";}. The string ironikus-serialize in front of the escaped JSON will tell our plugin to serialize the value. Please note that the JSON value, which you include within the original JSON string of the meta_input argument, needs to be escaped.
  2. Array serialization
    This method allows you to serialize a JSON to an array using the json_decode( $json, true ) function of PHP.
    To serialize your JSON to an array, you need to add the following string in front of the escaped JSON within the value field of your single meta value of the meta_input argument: ironikus-serialize-array. Here's a full example:
    {
    "meta_key_1": "This is my meta value 1",
    "another_meta_key": "This is my second meta key!",
    "third_meta_key": "ironikus-serialize-array{\"price\": \"100\"}"
    }
    This example will create three post meta entries. The third entry has the meta key third_meta_key and a serialized meta value of a:1:{s:5:"price";s:3:"100";}. The string ironikus-serialize-array in front of the escaped JSON will tell our plugin to serialize the value. Please note that the JSON value, which you include within the original JSON string of the meta_input argument, needs to be escaped.

manage_meta_data
This argument integrates the full features of managing post related meta values.

Please note: This argument is very powerful and requires some good understanding of JSON. It is integrated with the commonly used functions for managing post meta within WordPress. You can find a list of all avaialble functions here:
Down below you will find a complete JSON example that shows you how to use each of the functions above.

We also offer JSON to array/object serialization for single post meta values. This means, you can turn JSON into a serialized array or object.
This argument accepts a JSON construct as an input. This construct contains each available function as a top-level key within the first layer and the assigned data respectively as a value. If you want to learn more about each line, please take a closer look at the bottom of the example.
{
   "add_post_meta":[
      {
        "meta_key": "first_custom_key",
        "meta_value": "Some custom value"
      },
      {
        "meta_key": "second_custom_key",
        "meta_value": { "some_array_key": "Some array Value" },
        "unique": true
      } 
    ],
   "update_post_meta":[
      {
        "meta_key": "first_custom_key",
        "meta_value": "Some custom value"
      },
      {
        "meta_key": "second_custom_key",
        "meta_value": "The new value",
        "prev_value": "The previous value"
      } 
    ],
   "delete_post_meta":[
      {
        "meta_key": "first_custom_key"
      },
      {
        "meta_key": "second_custom_key",
        "meta_value": "Target specific value"
      } 
    ]
}
Down below you will find a list that explains each of the top level keys.
  1. add_post_meta
    This key refers to the add_post_meta() function of WordPress: https://developer.wordpress.org/reference/functions/add_post_meta/
    In the example above, you will find two entries within the add_post_meta key. The first one shows the default behavior using only the meta key and the value. This causes the meta key to be created without checking upfront if it exists - that allows you to create the meta value multiple times.
    As seen in the second entry, you will find a third key called unique that allows you to check upfront if the meta key exists already. If it does, the meta entry is neither created, nor updated. Set the value to true to check against existing ones. Default: false
    If you look closely to the second entry again, the value included is not a string, but a JSON construct, which is considered as an array and will therefore be serialized. The given value will be saved to the database in the following format: a:1:{s:14:"some_array_key";s:16:"Some array Value";}
  2. update_post_meta
    This key refers to the update_post_meta() function of WordPress: https://developer.wordpress.org/reference/functions/update_post_meta/
    The example above shows you two entries for this function. The first one is the default set up thats used in most cases. Simply define the meta key and the meta value and the key will be updated if it does exist and if it does not exist, it will be created.
    The third argument, as seen in the second entry, allows you to check against a previous value before updating. That causes that the meta value will only be updated if the previous key fits to whats currently saved within the database. Default: ''
  3. delete_post_meta
    This key refers to the delete_post_meta() function of WordPress: https://developer.wordpress.org/reference/functions/delete_post_meta/
    Within the example above, you will see that only the meta key is required for deleting an entry. This will cause all meta keys on this post with the same key to be deleted.
    The second argument allows you to target only a specific meta key/value combination. This gets important if you want to target a specific meta key/value combination and not delete all available entries for the given post. Default: ''
Some tipps:
  1. You can include the value for this argument as a simple string to your webhook payload or you integrate it directly as JSON into your JSON payload (if you send a raw JSON response).
  2. Changing the order of the functions within the JSON causes the post meta to behave differently. If you, for example, add the delete_post_meta key before the update_post_meta key, the meta values will first be deleted and then added/updated.
  3. The webhook response contains a validted array that shows each initialized meta entry, as well as the response from its original WordPress function. This way you can see if the meta value was adjusted accordingly.

manage_acf_data
This argument integrates this endpoint with Advanced Custom Fields.

Please note: This argument is very powerful and requires some good understanding of JSON. It is integrated with all Update functions offered by ACF. You can find a list of all update functions here: https://www.advancedcustomfields.com/resources/#functions
Down below you will find some examples that show you how to use each of the functions.

This argument accepts a validated JSON construct as an input. This construct contains each available function within its top layers and the assigned data respectively as a value. If you want to learn more about each line, please take a closer look at the bottom of the example.
Down below you will find a list that explains each of the top level keys including an example.
  1. add_row
    This key refers to the add_row() function of ACF: https://www.advancedcustomfields.com/resources/add_row
    {
        "add_row": [
          {
            "selector": "demo_repeater",
            "value": {
              "demo_repeater_field": "This is the first text",
              "demo_repeater_url": "https://someurl1.com"
            }
          },
          {
            "selector": "demo_repeater",
            "value": {
              "demo_repeater_field": "This is the second text",
              "demo_repeater_url": "https://someurl2.com"
            }
          }
        ]
    }
    
    The example value for this key above shows you on how you can add multiple keys and values using the add_row() function. To make it work, you can add an array within the given construct, using the selector key for the key of the repeater field and the value key for the actual row data. Please note that the value for the row data must be an array using the seen JSON notation (Do not simply include a string). The value for the given example will add a new row to the demo_repeater_content repeater field which includes a sub field called demo_repeater_child_field and another sub field called demo_repeater_child_url.
  2. add_sub_row
    This key refers to the add_sub_row() function of ACF: https://www.advancedcustomfields.com/resources/add_sub_row
    {
        "add_sub_row": [
          {
            "selector": [
              "demo_repeater_content", 1, "sub_repeater"
            ],
            "value": {
              "sub_repeater_field": "Sub Repeater Text Value"
            }
          }
        ]
    }
    
    Within the example above, you will see how you can add a row to a sub row (e.g. if the repeater field as also a repeater field). The selector key can contain a string or an array that determins the exact position of the sub row. You can see the value for the selector key as a mapping to the sub row. The value key can contain a string or an array, depending on the choice of the field.
  3. delete_field
    This key refers to the delete_field() function of ACF: https://www.advancedcustomfields.com/resources/delete_field
    {
        "delete_field": [
          {
            "selector": "demo_field"
          }
        ]
    }
    
    To delete a field, you can use the same notation as seen above in the example. Simply add another row to the JSON including the field name, of the field you want to delete, into the selector key. This will cause the field to be deleted. You can also use this function to clear repeater fields.
  4. delete_row
    This key refers to the delete_row() function of ACF: https://www.advancedcustomfields.com/resources/delete_row/
    {
        "delete_row": [
          {
            "selector": "demo_repeater_row",
            "row": 2
          }
        ]
    }
    
    The example above shows that the logic is going to delete the second row for the demo_repeater_content repeater field. You can also see that we send over the numeric value for the row which is required by ACF.
  5. delete_sub_field
    This key refers to the delete_sub_field() function of ACF: https://www.advancedcustomfields.com/resources/delete_sub_field/
    {
        "delete_sub_field": [
          {
            "selector": [
              "demo_repeater", 2, "sub_repeater", 2, "sub_repeater_field"
            ]
          }
        ]
    }
    
    This allows you to delete a specific field within a repeater, flexible content or sub-repeater, etc.. To make it work, you must need to set the selector key as an array containing the given mapping of the field you'd like to delete. The example deletes a fiel of a sub-repeater.
  6. delete_sub_row
    This key refers to the delete_sub_row() function of ACF: https://www.advancedcustomfields.com/resources/delete_sub_row/
    {
        "delete_sub_row": [
          {
            "selector": [
              "demo_repeater", 2, "sub_repeater"
            ],
            "row": 2
          }
        ]
    }
    
    Delete the whole row of a sub-repeater field or flexible content. For the selector key you must define an array (as seen in the example) that contains the exact mapping of the repeater/flexible field you want to target. As for the row key, you must set the number of the row you want to delete.
  7. update_field
    This key refers to the update_field() function of ACF: https://www.advancedcustomfields.com/resources/update_field
    {
        "update_field":[
          {
            "selector": "first_custom_key",
            "value": "Some custom value"
          },
          {
            "selector": "second_custom_key",
            "value": { "some_array_key": "Some array Value" }
          } 
        ]
    }
    
    The example value for this key above shows you on how you can add multiple keys and values using the update_field() function. To make it work, you can add an array within the given construct, using the selector key for the post meta key and the value key for the actual value. The example also shows on how you can include an array. To make that work, you can simply create a sub entry for the value instead of a simple string as seen in the second example.
  8. update_row
    This key refers to the update_row() function of ACF: https://www.advancedcustomfields.com/resources/update_row
    {
        "update_row":[
          {
            "selector": "demo_repeater",
            "row": 2,
            "value": {
              "demo_repeater_field": "New Demo Text",
              "demo_repeater_url": "https://somenewurl.com"
            }
          }
        ]
    }
    
    Using the update_row() function, you can update specific or all fields of that given row. To do so, simply define the repeater/flexible content field name afor the selector key, the row number for the row key and for the value key the array containing all of your required fields you want to update.
  9. update_sub_field
    This key refers to the update_sub_field() function of ACF: https://www.advancedcustomfields.com/resources/update_sub_field
    {
        "update_sub_field":[
          {
            "selector": [
              "demo_repeater", 2, "sub_repeater", 1, "sub_repeater_field"
            ],
            "value": "Some New Text"
          }
        ]
    }
    
    Use this function if your goal is to update a specific, nested field within a repeater/flexible content. As for the selector key, you need to set an array containing the exact mapping position to target the exact field you would like to update. As for the value, you can define the content of the field.
  10. update_sub_row
    This key refers to the update_sub_row() function of ACF: https://www.advancedcustomfields.com/resources/update_sub_row
    {
        "update_sub_row":[
          {
            "selector": [
              "demo_repeater", 2, "sub_repeater"
            ],
            "row": 2,
            "value": {
              "sub_repeater_field": "Updated Sub Row Text"
            }
          }
        ]
    }
    
    With this function, you can update a whole row within a repeater/flecible content field. To make it work, please define for the selector key an array contianing the exact mapping to target the row you want to update. For the row key, please specify the row within the sub field. As for the value, please include an array containing all single fields you would like to update.
Some tipps:
  1. You can combine all of the functions within a single JSON such as:
    {
        "update_field": {},
        "update_row": {},
        "update_sub_field": {},
        "update_sub_row": {}
    }
    
  2. You can include the value for this argument as a simple string to your webhook payload or you integrate it directly as JSON into your JSON payload (if you send a raw JSON response).
  3. Changing the order of the functions within the JSON causes the added values behave differently. If you, for example, add the delete_field key before the update_field key, the fields will first be deleted and then added/updated.
  4. The webhook response contains a validted array that shows each initialized meta entry, as well as the response from its original ACF function. This way you can see if the meta value was adjusted accordingly.

wp_error
In case you set the wp_error argument to yes, we will return the WP Error object within the response if the webhook action call. It is recommended to only use this for debugging.

do_action
The do_action argument is an advanced webhook for developers. It allows you to fire a custom WordPress hook after the create_post action was fired.
You can use it to trigger further logic after the webhook action. Here's an example:

Let's assume you set for the do_action parameter fire_this_function. In this case, we will trigger an action with the hook name fire_this_function. Here's how the code would look in this case:
add_action( 'fire_this_function', 'my_custom_callback_function', 20, 4 );
function my_custom_callback_function( $post_data, $post_id, $meta_input, $return_args ){
    //run your custom logic in here
}
Here's an explanation to each of the variables that are sent over within the custom function.
  1. $post_data (array)
    Contains the data that is used to create the post and some additional data as the meta input.
  2. $post_id (integer)
    Contains the post id of the newly created post. Please note that it can also contain a wp_error object since it is the response of the wp_insert_user() function.
  3. $meta_input (string)
    Contains the unformatted post meta as you sent it over within the webhook request as a string.
  4. $return_args (array)
    An array containing the information we will send back as the response to the initial webhook caller.
Here you can test the specified webhook. Please note, that this test can modify the data of your website (Depending on what action you test). Also, you will see the response as any web service receives it.
Please choose the webhook you are going to run the test with. Simply select the one you want to use down below.
Update a post. You have all functionalities available from wp_update_post
  • actionRequired
    Always required. Determines which webhook action you want to target. (Alternatively, set this value as a query parameter within the URL) For this webhook action, please set it to update_post
  • post_idRequired
    (int) The post id itself. This field is mandatory
  • post_author
    (mixed) The ID or the email of the user who added the post. Default is the current user ID.
  • post_date
    (string) The date of the post. Default is the current time.
  • post_date_gmt
    (string) The date of the post in the GMT timezone. Default is the value of $post_date.
  • post_content
    (string) The post content. Default empty.
  • post_content_filtered
    (string) The filtered post content. Default empty.
  • post_title
    (string) The post title. Default empty.
  • post_excerpt
    (string) The post excerpt. Default empty.
  • post_status
    (string) The post status. Default 'draft'.
  • post_type
    (string) The post type. Default 'post'.
  • comment_status
    (string) Whether the post can accept comments. Accepts 'open' or 'closed'. Default is the value of 'default_comment_status' option.
  • ping_status
    (string) Whether the post can accept pings. Accepts 'open' or 'closed'. Default is the value of 'default_ping_status' option.
  • post_password
    (string) The password to access the post. Default empty.
  • post_name
    (string) The post name. Default is the sanitized post title when creating a new post.
  • to_ping
    (string) Space or carriage return-separated list of URLs to ping. Default empty.
  • pinged
    (string) Space or carriage return-separated list of URLs that have been pinged. Default empty.
  • post_modified
    (string) The date when the post was last modified. Default is the current time.
  • post_modified_gmt
    (string) The date when the post was last modified in the GMT timezone. Default is the current time.
  • post_parent
    (int) Set this for the post it belongs to, if any. Default 0.
  • menu_order
    (int) The order the post should be displayed in. Default 0.
  • post_mime_type
    (string) The mime type of the post. Default empty.
  • guid
    (string) Global Unique ID for referencing the post. Default empty.
  • post_category
    (string) A comma separated list of category IDs. Defaults to value of the 'default_category' option. Example: cat_1,cat_2,cat_3. Please note that WordPress just accepts categories of the type "category" here.
  • tags_input
    (string) A comma separated list of tag names, slugs, or IDs. Default empty. Please note that WordPress just accepts tags of the type "post_tag" here.
  • tax_input
    (string) A simple or JSON formatted string containing existing taxonomy terms. Default empty. More details within the description.
  • manage_meta_data
    Manage your post-related meta data. Please see the description for further details.
  • manage_acf_data
    Allows you to manage fields that are especially related to Advanced Custom Fields. See the description for further information.
  • wp_error
    Whether to return a WP_Error on failure. Posible values: "yes" or "no". Default value: "no".
  • do_action
    Advanced: Register a custom action after Webhooks Pro fires this webhook. More infos are in the description.
  • create_if_none
    Wether you want to create the post if it does not exists or not. Set it to "yes" or "no" Default is "no".
  • success
    (Bool) True if the action was successful, false if not. E.g. array( 'success' => true )
  • data
    (array) User related data as an array. We return the post id with the key "post_id" and the post data with the key "post_data". E.g. array( 'data' => array(...) )
  • msg
    (string) A message with more information about the current request. E.g. array( 'msg' => "This action was successful." )

Here is an example of all the available default fields. The fields may vary based on custom extensions, third party plugins or different values.

$return_args = array(
    'success'   => false,
    'msg'       => '',
    'data'      => array(
        'post_id' => null,
        'post_data' => null
    )
);
        

This webhook action is used to update a post on your WordPress system via a webhook call.
The description is uniquely made for the update_post webhook action.
In case you want to first understand how to setup webhook actions in general, please check out the following manuals:
https://ironikus.com/docs/article-categories/get-started/

How to use update_post

  1. The first argument you need to set within your webhook action request is the action argument. This argument is always required. Please set it to create_post.
  2. Another argument you need to define is the post_id. It contains the ID of the post within your WordPress site.
  3. All the other arguments are optional and just extend the updating process of the post.


Tipps

  1. To update a post, you only need to set the values you want to update. The undefined settings won't be overwritten.
  2. In case you want to create the post if it does not exists at that point, you can set the create_if_none argument to yes


Special Arguments


post_author
The post author argument accepts either the user id of a user, or the email address of an existing user. In case you choose the email adress, we try to match it with the users on your WordPress site. In case we couldn't find a user for the given email, we leave the field empty.

post_content
The post content is the main content area of the post. It can contain HTML or any other kind of content necessary for your functionality.

post_status
The post status defines further details about how your post will be treated. By default, WordPress offers the following post statuses: draft, pending, private, publish. Please note that other plugins can extend the post status values to offer a bigger variety, e.g. Woocommerce.

post_type
The post type determines to which group of posts your currently updated post belongs. Please use the slug of the post type.

tags_input
This argument supports the default tags_input variable of the wp_update_post() function. Please use this function only if you are known to its functionality since WordPress might not add the values properly due to permissions. If you are not sure, please use the tax_input argument instead.

Here is an example:
342,5678,2
This argument supports a comma separated list of tag names, slugs, or IDs.

tax_input
This argument allows you to add/append/delete any kind of taxonomies on your post. It uses a custom functionality that adds the taxonomies independently of the wp_update_post() function.
To make it work, we offer certain different features and methods to make the most out of the taxonomy management. Down below, you will find further information about the whole functionality.
  1. String method
    This method allows you to add/update/delete or bulk manage the post taxonomies using a simple string. Both the string and the JSON method support custom taxonomies too. In case you use more complex taxonomies that use semicolons or double points within the slugs, you need to use the JSON method.
    • Replace existing taxonomy items
      This method allows you to replace already existing taxonomy items on the post. In case a taxonomy item does not exists at the point you want to add it, it will be ignored.
      taxonomy_1,tax_item_1:tax_item_2:tax_item_3;taxonomy_2,tax_item_5:tax_item_7:tax_item_8
      To separate the taxonomies from the single taxonomy items, please use a comma ",". In case you want to add multiple items per taxonomy, you can separate them via a double point ":". To separate multiple taxonomies from each other, please separate them with a semicolon ";" (It is not necessary to set a semicolon at the end of the last one)
    • Remove all taxonomy items for a single taxonomy
      In case you want to remove all taxonomy items from one or multiple taxonomies, you can set ironikus-remove-all; in front of a semicolon-separated list of the taxonomies you want to remove all items for. Here is an example:
      ironikus-remove-all;taxonomy_1;taxonomy_2
    • Remove single taxonomy items for a taxonomy
      You can also remove only single taxonomy items for one or multiple taxonomies. Here is an example:
      ironikus-append;taxonomy_1,value_1:value_2-ironikus-delete:value_3;taxonomy_2,value_5:value_6:value_7-ironikus-delete
      In the example above, we append the taxonomies taxonomy_1 and taxonomy_2. We also add the taxonomy items value_1, value_3, value_5 and value_6. We also remove the taxonomy items value_2 and value_7.
    • Append taxonomy items
      You can also append any taxonomy items without the existing ones being replaced. To do that, simply add ironikus-append; at the beginning of the string.
      ironikus-append;taxonomy_1,value_1:value_2:value_3;taxonomy_2,value_1:value_2:value_3
      In the example above, we append the taxonomies taxonomy_1 and taxonomy_2 with multiple taxonomy items on the post. The already assigned ones won't be replaced.
  2. JSON method
    This method allows you to add/update/delete or bulk manage the post taxonomies using a simple string. Both the string and the JSON method support custom taxonomies too.
    • Replace existing taxonomy items
      This JSON allows you to replace already existing taxonomy items on the post. In case a taxonomy item does not exists at the point you want to add it, it will be ignored.
      {
        "category": [
          "test-category",
          "second-category"
        ],
        "post_tag": [
          "dog",
          "male",
          "simple"
        ]
      }
      The key on the first layer of the JSON is the slug of the taxonomy. As a value, it accepts multiple slugs of the single taxonomy terms. To add multiple taxonomies, simply append them on the first layer of the JSON.
    • Remove all taxonomy items for a single taxonomy
      In case you want to remove all taxonomy items from one or multiple taxonomies, you can set ironikus-remove-all as a separate value with the wpwhtype key. The wpwhtype key is a reserved key for further actions on the data. Here is an example:
      {
        "wpwhtype": "ironikus-remove-all",
        "category": [],
        "post_tag": []
      }
    • Append taxonomy items
      You can also append any taxonomy items without the existing ones being replaced. To do that, simply add ironikus-append to the wpwhtype key. The wpwhtype key is a reserved key for further actions on the data. All the taxonomies you add after, will be added to the existing ones on the post.
      {
        "wpwhtype": "ironikus-append",
        "category": [
          "test-category",
          "second-category"
        ],
        "post_tag": [
          "dog"
        ]
      }
      In the example above, we append the taxonomies category and post_tag with multiple taxonomy items on the post. The already assigned ones won't be replaced.
    • Remove single taxonomy items for a taxonomy
      You can also remove only single taxonomy items for one or multiple taxonomies. To do that, simply append -ironikus-delete at the end of the taxonomy term slug. This specific taxonomy term will then be removed from the post. Here is an example:
      {
        "wpwhtype": "ironikus-append",
        "category": [
          "test-category",
          "second-category-ironikus-delete"
        ],
        "post_tag": [
          "dog-ironikus-delete"
        ]
      }
      In the example above, we append the taxonomies category and post_tag. We also add the taxonomy item test-category. We also remove the taxonomy items second-category and dog.

meta_input (Deprecated)
This argument is specifically designed to add/update or remove post meta to your updated post.
To create/update or delete custom meta values, we offer you two different ways:
  1. String method
    This method allows you to add/update or delete the post meta using a simple string. To make it work, separate the meta key from the value using a comma (,). To separate multiple meta settings from each other, simply separate them with a semicolon (;). To remove a meta value, simply set as a value ironikus-delete
    meta_key_1,meta_value_1;my_second_key,ironikus-delete
    IMPORTANT: Please note that if you want to use values that contain commas or semicolons, the string method does not work. In this case, please use the JSON method.
  2. JSON method
    This method allows you to add/update or remove the post meta using a JSON formatted string. To make it work, add the meta key as the key and the meta value as the value. To delete a meta value, simply set the value to ironikus-delete. Here's an example on how this looks like:
    {
    "meta_key_1": "This is my meta value 1",
    "another_meta_key": "This is my second meta key!"
    "third_meta_key": "ironikus-delete"
    }
Advanced: We also offer JSON to array/object serialization for single post meta values. This means, you can turn JSON into a serialized array or object.
As an example: The following JSON {"price": "100"} will turn into O:8:"stdClass":1:{s:5:"price";s:3:"100";} with default serialization or into a:1:{s:5:"price";s:3:"100";} with array serialization.
  1. Object serialization
    This method allows you to serialize a JSON to an object using the default json_decode() function of PHP.
    To serialize your JSON to an object, you need to add the following string in front of the escaped JSON within the value field of your single meta value of the meta_input argument: ironikus-serialize. Here's a full example:
    {
    "meta_key_1": "This is my meta value 1",
    "another_meta_key": "This is my second meta key!",
    "third_meta_key": "ironikus-serialize{\"price\": \"100\"}"
    }
    This example will create three post meta entries. The third entry has the meta key third_meta_key and a serialized meta value of O:8:"stdClass":1:{s:5:"price";s:3:"100";}. The string ironikus-serialize in front of the escaped JSON will tell our plugin to serialize the value. Please note that the JSON value, which you include within the original JSON string of the meta_input argument, needs to be escaped.
  2. Array serialization
    This method allows you to serialize a JSON to an array using the json_decode( $json, true ) function of PHP.
    To serialize your JSON to an array, you need to add the following string in front of the escaped JSON within the value field of your single meta value of the meta_input argument: ironikus-serialize-array. Here's a full example:
    {
    "meta_key_1": "This is my meta value 1",
    "another_meta_key": "This is my second meta key!",
    "third_meta_key": "ironikus-serialize-array{\"price\": \"100\"}"
    }
    This example will create three post meta entries. The third entry has the meta key third_meta_key and a serialized meta value of a:1:{s:5:"price";s:3:"100";}. The string ironikus-serialize-array in front of the escaped JSON will tell our plugin to serialize the value. Please note that the JSON value, which you include within the original JSON string of the meta_input argument, needs to be escaped.

manage_acf_data
This argument integrates this endpoint with Advanced Custom Fields.

Please note: This argument is very powerful and requires some good understanding of JSON. It is integrated with all Update functions offered by ACF. You can find a list of all update functions here: https://www.advancedcustomfields.com/resources/#functions
Down below you will find some examples that show you how to use each of the functions.

This argument accepts a validated JSON construct as an input. This construct contains each available function within its top layers and the assigned data respectively as a value. If you want to learn more about each line, please take a closer look at the bottom of the example.
Down below you will find a list that explains each of the top level keys including an example.
  1. add_row
    This key refers to the add_row() function of ACF: https://www.advancedcustomfields.com/resources/add_row
    {
        "add_row": [
          {
            "selector": "demo_repeater",
            "value": {
              "demo_repeater_field": "This is the first text",
              "demo_repeater_url": "https://someurl1.com"
            }
          },
          {
            "selector": "demo_repeater",
            "value": {
              "demo_repeater_field": "This is the second text",
              "demo_repeater_url": "https://someurl2.com"
            }
          }
        ]
    }
    
    The example value for this key above shows you on how you can add multiple keys and values using the add_row() function. To make it work, you can add an array within the given construct, using the selector key for the key of the repeater field and the value key for the actual row data. Please note that the value for the row data must be an array using the seen JSON notation (Do not simply include a string). The value for the given example will add a new row to the demo_repeater_content repeater field which includes a sub field called demo_repeater_child_field and another sub field called demo_repeater_child_url.
  2. add_sub_row
    This key refers to the add_sub_row() function of ACF: https://www.advancedcustomfields.com/resources/add_sub_row
    {
        "add_sub_row": [
          {
            "selector": [
              "demo_repeater_content", 1, "sub_repeater"
            ],
            "value": {
              "sub_repeater_field": "Sub Repeater Text Value"
            }
          }
        ]
    }
    
    Within the example above, you will see how you can add a row to a sub row (e.g. if the repeater field as also a repeater field). The selector key can contain a string or an array that determins the exact position of the sub row. You can see the value for the selector key as a mapping to the sub row. The value key can contain a string or an array, depending on the choice of the field.
  3. delete_field
    This key refers to the delete_field() function of ACF: https://www.advancedcustomfields.com/resources/delete_field
    {
        "delete_field": [
          {
            "selector": "demo_field"
          }
        ]
    }
    
    To delete a field, you can use the same notation as seen above in the example. Simply add another row to the JSON including the field name, of the field you want to delete, into the selector key. This will cause the field to be deleted. You can also use this function to clear repeater fields.
  4. delete_row
    This key refers to the delete_row() function of ACF: https://www.advancedcustomfields.com/resources/delete_row/
    {
        "delete_row": [
          {
            "selector": "demo_repeater_row",
            "row": 2
          }
        ]
    }
    
    The example above shows that the logic is going to delete the second row for the demo_repeater_content repeater field. You can also see that we send over the numeric value for the row which is required by ACF.
  5. delete_sub_field
    This key refers to the delete_sub_field() function of ACF: https://www.advancedcustomfields.com/resources/delete_sub_field/
    {
        "delete_sub_field": [
          {
            "selector": [
              "demo_repeater", 2, "sub_repeater", 2, "sub_repeater_field"
            ]
          }
        ]
    }
    
    This allows you to delete a specific field within a repeater, flexible content or sub-repeater, etc.. To make it work, you must need to set the selector key as an array containing the given mapping of the field you'd like to delete. The example deletes a fiel of a sub-repeater.
  6. delete_sub_row
    This key refers to the delete_sub_row() function of ACF: https://www.advancedcustomfields.com/resources/delete_sub_row/
    {
        "delete_sub_row": [
          {
            "selector": [
              "demo_repeater", 2, "sub_repeater"
            ],
            "row": 2
          }
        ]
    }
    
    Delete the whole row of a sub-repeater field or flexible content. For the selector key you must define an array (as seen in the example) that contains the exact mapping of the repeater/flexible field you want to target. As for the row key, you must set the number of the row you want to delete.
  7. update_field
    This key refers to the update_field() function of ACF: https://www.advancedcustomfields.com/resources/update_field
    {
        "update_field":[
          {
            "selector": "first_custom_key",
            "value": "Some custom value"
          },
          {
            "selector": "second_custom_key",
            "value": { "some_array_key": "Some array Value" }
          } 
        ]
    }
    
    The example value for this key above shows you on how you can add multiple keys and values using the update_field() function. To make it work, you can add an array within the given construct, using the selector key for the post meta key and the value key for the actual value. The example also shows on how you can include an array. To make that work, you can simply create a sub entry for the value instead of a simple string as seen in the second example.
  8. update_row
    This key refers to the update_row() function of ACF: https://www.advancedcustomfields.com/resources/update_row
    {
        "update_row":[
          {
            "selector": "demo_repeater",
            "row": 2,
            "value": {
              "demo_repeater_field": "New Demo Text",
              "demo_repeater_url": "https://somenewurl.com"
            }
          }
        ]
    }
    
    Using the update_row() function, you can update specific or all fields of that given row. To do so, simply define the repeater/flexible content field name afor the selector key, the row number for the row key and for the value key the array containing all of your required fields you want to update.
  9. update_sub_field
    This key refers to the update_sub_field() function of ACF: https://www.advancedcustomfields.com/resources/update_sub_field
    {
        "update_sub_field":[
          {
            "selector": [
              "demo_repeater", 2, "sub_repeater", 1, "sub_repeater_field"
            ],
            "value": "Some New Text"
          }
        ]
    }
    
    Use this function if your goal is to update a specific, nested field within a repeater/flexible content. As for the selector key, you need to set an array containing the exact mapping position to target the exact field you would like to update. As for the value, you can define the content of the field.
  10. update_sub_row
    This key refers to the update_sub_row() function of ACF: https://www.advancedcustomfields.com/resources/update_sub_row
    {
        "update_sub_row":[
          {
            "selector": [
              "demo_repeater", 2, "sub_repeater"
            ],
            "row": 2,
            "value": {
              "sub_repeater_field": "Updated Sub Row Text"
            }
          }
        ]
    }
    
    With this function, you can update a whole row within a repeater/flecible content field. To make it work, please define for the selector key an array contianing the exact mapping to target the row you want to update. For the row key, please specify the row within the sub field. As for the value, please include an array containing all single fields you would like to update.
Some tipps:
  1. You can combine all of the functions within a single JSON such as:
    {
        "update_field": {},
        "update_row": {},
        "update_sub_field": {},
        "update_sub_row": {}
    }
    
  2. You can include the value for this argument as a simple string to your webhook payload or you integrate it directly as JSON into your JSON payload (if you send a raw JSON response).
  3. Changing the order of the functions within the JSON causes the added values behave differently. If you, for example, add the delete_field key before the update_field key, the fields will first be deleted and then added/updated.
  4. The webhook response contains a validted array that shows each initialized meta entry, as well as the response from its original ACF function. This way you can see if the meta value was adjusted accordingly.

wp_error
In case you set the wp_error argument to yes, we will return the WP Error object within the response if the webhook action call. It is recommended to only use this for debugging.

do_action
The do_action argument is an advanced webhook for developers. It allows you to fire a custom WordPress hook after the update_post action was fired.
You can use it to trigger further logic after the webhook action. Here's an example:

Let's assume you set for the do_action parameter fire_this_function. In this case, we will trigger an action with the hook name fire_this_function. Here's how the code would look in this case:
add_action( 'fire_this_function', 'my_custom_callback_function', 20, 4 );
function my_custom_callback_function( $post_data, $post_id, $meta_input, $return_args ){
    //run your custom logic in here
}
Here's an explanation to each of the variables that are sent over within the custom function.
  1. $post_data (array)
    Contains the data that is used to update the post and some additional data as the meta input.
  2. $post_id (integer)
    Contains the post id of the newly updated post. Please note that it can also contain a wp_error object since it is the response of the wp_update_user() function.
  3. $meta_input (string)
    Contains the unformatted post meta as you sent it over within the webhook request as a string.
  4. $return_args (array)
    An array containing the information we will send back as the response to the initial webhook caller.

create_if_none
In case you set the create_if_none argument to yes, a post will be created with the given details in case it does not exist.
Here you can test the specified webhook. Please note, that this test can modify the data of your website (Depending on what action you test). Also, you will see the response as any web service receives it.
Please choose the webhook you are going to run the test with. Simply select the one you want to use down below.
Delete a post via WP Webhooks Pro Pro.
  • actionRequired
    Always required. Determines which webhook action you want to target. (Alternatively, set this value as a query parameter within the URL) For this webhook action, please set it to delete_post
  • post_idRequired
    The post id of your specified post. This field is required.
  • force_delete
    (optional) Whether to bypass trash and force deletion (added in WordPress 2.9). Possible values: "yes" and "no". Default: "no". Please note that soft deletion just works for the "post" and "page" post type.
  • do_action
    Advanced: Register a custom action after Webhooks Pro fires this webhook. More infos are in the description.
  • success
    (Bool) True if the action was successful, false if not. E.g. array( 'success' => true )
  • data
    (array) Post related data as an array. We return the post id with the key "post_id" and the force delete boolean with the key "force_delete". E.g. array( 'data' => array(...) )
  • msg
    (string) A message with more information about the current request. E.g. array( 'msg' => "This action was successful." )

Here is an example of all the available default fields. The fields may vary based on custom extensions, third party plugins or different values.

$return_args = array(
    'success' => false,
    'msg' => '',
    'data' => array(
        'post_id' => 0,
        'force_delete' => false
    )
);
        

This webhook action is used to delete a post on your WordPress system via a webhook call.
This description is uniquely made for the delete_post webhook action.
In case you want to first understand on how to setup webhook actions in general, please check out the following manuals:
https://ironikus.com/docs/article-categories/get-started/

How to use delete_post

  1. The first argument you need to set within your webhook action request is the action argument. This argument is always required. Please set it to delete_post.
  2. It is also required to set the post id of the post you want to delete. You can do that by using the post_id argument.
  3. All the other arguments are optional and just extend the deletion of the post.
  4. Please note that deleting a post without defining the force_delete argument, only moves default posts and pages to the trash (wherever applicable) - otherwise they will be directly deleted.


Special Arguments


force_delete
In case you set the force_delete argument to yes, the post will be completely removed from your WordPress website.

do_action
The do_action argument is an advanced webhook for developers. It allows you to fire a custom WordPress hook after the delete_post action was fired.
You can use it to trigger further logic after the webhook action. Here's an example:

Let's assume you set for the do_action parameter fire_this_function. In this case, we will trigger an action with the hook name fire_this_function. Here's how the code would look in this case:
add_action( 'fire_this_function', 'my_custom_callback_function', 20, 4 );
function my_custom_callback_function( $post, $post_id, $check, $force_delete ){
    //run your custom logic in here
}
Here's an explanation to each of the variables that are sent over within the custom function.
  1. $post (object)
    Contains the WordPress post object of the already deleted post.
  2. $post_id (integer)
    Contains the post id of the deleted post.
  3. $check (mixed)
    Contains the response of the wp_delete_post() function.
  4. $force_delete (string)
    Returns either yes or no, depending on your settings for the force_delete argument.
Here you can test the specified webhook. Please note, that this test can modify the data of your website (Depending on what action you test). Also, you will see the response as any web service receives it.
Please choose the webhook you are going to run the test with. Simply select the one you want to use down below.
Search for posts on your WordPress website
  • actionRequired
    Always required. Determines which webhook action you want to target. (Alternatively, set this value as a query parameter within the URL) For this webhook action, please set it to get_posts
  • argumentsRequired
    A string containing a JSON construct in the WP_Query notation. Please check the description for more information.
  • return_only
    Define the data you want to return. Please check the description for more information. Default: posts
  • load_meta
    Set this argument to "yes" to add the post meta to each given post. Default: "no"
  • do_action
    Advanced: Register a custom action after Webhooks Pro fires this webhook. More infos are in the description.
  • success
    (Bool) True if the action was successful, false if not. E.g. array( 'success' => true )
  • data
    The data construct of the post query. This depends on the parameters you send.
  • msg
    (string) A message with more information about the current request. E.g. array( 'msg' => "This action was successful." )

Here is an example of all the available default fields. The fields may vary based on custom extensions, third party plugins or different values.

$return_args = array(
    'success' => false,
    'msg'     => '',
    'data' => array()
);
        

This webhook action is used to fetch one or multiple posts from your WordPress system via a webhook call.
This description is uniquely made for the get_posts webhook action.
In case you want to first understand on how to setup webhook actions in general, please check out the following manuals:
https://ironikus.com/docs/article-categories/get-started/

How to use get_posts

  1. The first argument you need to set within your webhook action request is the action argument. This argument is always required. Please set it to get_posts.
  2. It is also required to set the argument arguments, which contains a JSON formatted string with the parameters used to identify the posts. More details about that is available within the Special Arguments list.
  3. All the other arguments are optional and just extend the fetching of the posts.


Special Arguments


arguments
This argument contains a JSON formatted string, which includes certain arguments from the WordPress post query called WP_Query. For further details, please check out the following link:
https://developer.wordpress.org/reference/classes/wp_query/
Here is an example on how the JSON is set up:
{"post_type":"post","posts_per_page":8}
The example above will filter the posts for the post type "post" and returns maximum eight posts.

return_only
You can also manipulate the output of the query using the return_only parameter. This allows you to output only certain elements or the whole WP_Query class. Here is an example:
posts,post_count,found_posts,max_num_pages
Here's a list of all available values for the return_only argument. In case you want to use multiple ones, simply separate them with a comma.
  1. all
  2. posts
  3. post
  4. post_count
  5. found_posts
  6. max_num_pages
  7. current_post
  8. query_vars
  9. query
  10. tax_query
  11. meta_query
  12. date_query
  13. request
  14. in_the_loop
  15. current_post

do_action
The do_action argument is an advanced webhook for developers. It allows you to fire a custom WordPress hook after the get_posts action was fired.
You can use it to trigger further logic after the webhook action. Here's an example:

Let's assume you set for the do_action parameter fire_this_function. In this case, we will trigger an action with the hook name fire_this_function. Here's how the code would look in this case:
add_action( 'fire_this_function', 'my_custom_callback_function', 20, 4 );
function my_custom_callback_function( $return_args, $post_query, $args, $return_only ){
    //run your custom logic in here
}
Here's an explanation to each of the variables that are sent over within the custom function.
  1. $return_args (array)
    All the values that are sent back as a response the the initial webhook action caller.
  2. $post_query (object)
    The full WP_Query object.
  3. $args (string)
    The string formatted JSON construct that was sent by the caller within the arguments argument.
  4. $return_only (string)
    The string that was sent by the caller via the return_only argument.
Here you can test the specified webhook. Please note, that this test can modify the data of your website (Depending on what action you test). Also, you will see the response as any web service receives it.
Please choose the webhook you are going to run the test with. Simply select the one you want to use down below.
Returns the object of a user
  • actionRequired
    Always required. Determines which webhook action you want to target. (Alternatively, set this value as a query parameter within the URL) For this webhook action, please set it to get_post
  • post_idRequired
    The post id of the post you want to fetch.
  • return_only
    Select the values you want to return. Default is all. Please see the description for more details.
  • thumbnail_size
    Pass the size of the thumbnail of your given post id. Default is full. Please see the description for more details.
  • post_taxonomies
    Single value or comma separated list of the taxonomies you want to return. Default: post_tag. Please see the description for more details.
  • do_action
    Advanced: Register a custom action after our plugin fires this webhook. More infos are in the description.
  • success
    (Bool) True if the action was successful, false if not. E.g. array( 'success' => true )
  • data
    The data construct of the single post. This depends on the parameters you send.
  • msg
    (string) A message with more information about the current request. E.g. array( 'msg' => "This action was successful." )

Here is an example of all the available default fields. The fields may vary based on custom extensions, third party plugins or different values.

$return_args = array(
    'success' => false,
    'msg'     => '',
    'data' => array()
);
        

This webhook action is used to fetch a single post from your WordPress system via a webhook call. It uses the default WordPress function get_post():
https://developer.wordpress.org/reference/functions/get_post/

This description is uniquely made for the get_post webhook action.
In case you want to first understand on how to setup webhook actions in general, please check out the following manuals:
https://ironikus.com/docs/article-categories/get-started/

How to use get_post

  1. The first argument you need to set within your webhook action request is the action argument. This argument is always required. Please set it to get_post.
  2. It is also required to set the argument post_id, which contains the id of the post you want to fetch.
  3. All the other arguments are optional and just extend the fetching of the post.


Special Arguments


return_only
You can also manipulate the result of the post data gathering using the return_only parameter. This allows you to output only certain elements of the request. Here is an example:
post,post_thumbnail,post_terms,post_meta,post_permalink
Here's a list of all available values for the return_only argument. In case you want to use multiple ones, simply separate them with a comma.
  1. all
  2. post
  3. post_thumbnail
  4. post_terms
  5. post_meta
  6. post_permalink

thumbnail_size
This argument allows you to return one or multiple thumbnail_sizes for the given post thumbnail. By default, we output only the full image. Here is an example:
full,medium
Here's a list of all available sizes for the thumbnail_size argument (The availalbe sizes may vary since you can also use third-party size definitions). In case you want to use multiple ones, simply separate them with a comma.
  1. thumbnail (150px square)
  2. medium (maximum 300px width and height)
  3. large (maximum 1024px width and height)
  4. full (full/original image size you uploaded)

post_taxonomies
You can also customize the output of the returned taxonomies using the post_taxonomies argument. Default is post_tag. This argument accepts a string of a single taxonomy slug or a comma separated list of multiple taxonomy slugs. Please see the example down below:
post_tag,custom_taxonomy_1,custom_taxonomy_2

do_action
The do_action argument is an advanced webhook for developers. It allows you to fire a custom WordPress hook after the get_post action was fired.
You can use it to trigger further logic after the webhook action. Here's an example:

Let's assume you set for the do_action parameter fire_this_function. In this case, we will trigger an action with the hook name fire_this_function. Here's how the code would look in this case:
add_action( 'fire_this_function', 'my_custom_callback_function', 20, 4 );
function my_custom_callback_function( $return_args, $post_id, $thumbnail_size, $post_taxonomies ){
    //run your custom logic in here
}
Here's an explanation to each of the variables that are sent over within the custom function.
  1. $return_args (array)
    All the values that are sent back as a response the the initial webhook action caller.
  2. $post_id (integer)
    The id of the currently fetched post.
  3. $thumbnail_size (string)
    The string formatted thumbnail sizes sent by the caller within the thumbnail_size argument.
  4. $post_taxonomies (string)
    The string formatted taxonomy slugs sent by the caller within the post_taxonomies argument.
Here you can test the specified webhook. Please note, that this test can modify the data of your website (Depending on what action you test). Also, you will see the response as any web service receives it.
Please choose the webhook you are going to run the test with. Simply select the one you want to use down below.
Do whatever you like with the incoming data by defining this custom action.
  • actionRequired
    Always required. Determines which webhook action you want to target. (Alternatively, set this value as a query parameter within the URL) For this webhook action, please set it to custom_action
  • wpwh_identifier
    This value is send over within the WordPress hooks to identify the incoming action. You can use it to fire your customizatios only on specific webhooks. For more information, please check the description.
  • custom
    This webhook returns whatever you define withiin the filters. Please check the description for more detials.

Here is an example of all the available default fields. The fields may vary based on custom extensions, third party plugins or different values.

//This is how the default response looks like
$return_args = array(
    'success' => false,
    'msg' => ''
);
        

This webhook action is used to fire a custom wordpress filter within your WordPress system via a webhook call. You can use it to fully cusotmize the webhook logic for your needs.
This description is uniquely made for the custom_action webhook action.
In case you want to first understand on how to setup webhook actions in general, please check out the following manuals:
https://ironikus.com/docs/article-categories/get-started/

How to use custom_action

  1. The first argument you need to set within your webhook action request is the action argument. This argument is always required. Please set it to custom_action.
  2. All the other arguments are optional and just extend the custom execution of the action.
To modify your incoming data based on your needs, you simply create a custom add_filter() call within your theme or plugin. Down below is an example on how you can do that:
add_filter( 'wpwhpro/run/actions/custom_action/return_args', 'wpwh_fire_my_custom_logic', 10, 3 );
function wpwh_fire_my_custom_logic( $return_args, $identifier, $response_body ){

	//If the identifier doesn't match, do nothing
	if( $identifier !== 'ilovewebhooks' ){
		return $return_args;
	}

	//This is how you can validate the incoming value. This field will return the value for the key user_email
	$email = WPWHPRO()->helpers->validate_request_value( $response_body['content'], 'user_email' );

	//Include your own logic here....

	//This is what the webhook returns back to the caller of this action (response)
	//By default, we return an array with success => true and msg -> Some Text
	return $return_args;

}
The custom add_filter() callback accepts three parameters, which are explained down below:
  1. $return_args (array)
    This is what the webhook call returns as a response. You can modify it to return your own custom data.
  2. $identifier (string)
    This is the wpwh_identifier you may have set up within the webhook call. (We also allow to set this specific argument within the URL as &wpwh_identifier=my_identifier). Further information about this argument is available within the Special Arguments list.
  3. $response_body (array)
    This returns the validated payload of the incoming webhook call. You can use WPWHPRO()->helpers->validate_request_value() to validate single entries (See example)

Tipp

Since this webhook action requires you to still set the action as mentioned above (to let our plugin know you want to fire a custom_action), you can also set the action parameter within the webhook URL you define within your external endpoint (instead of within the body). E.g.: &action=custom_action - This way you can avoid modifying the webhook request payload in the first place.

Special Arguments


wpwh_identifier
Set this argument to identify your webhook call within the add_filter() function. It can be used to diversify between multiple calls that use this custom action. You can set it to e.g. validate-user and then check within the add_filter() callback against it to only fire it for this specific webhook call. You can also define this argument within the URL as a parameter, e.g. &wpwh_identifier=my-custom-identifier. In case you have defined the wpwh_identifier within the payload and the URL, we prioritize the parameter set within the payload.
Here you can test the specified webhook. Please note, that this test can modify the data of your website (Depending on what action you test). Also, you will see the response as any web service receives it.
Please choose the webhook you are going to run the test with. Simply select the one you want to use down below.
Execute multiple webhooks within a single webhook call.
  • actionRequired
    Always required. Determines which webhook action you want to target. (Alternatively, set this value as a query parameter within the URL) For this webhook action, please set it to bulk_webhooks
  • actions
    This argument contains all of your executable webhook calls and settings. Please see the description for further information.
  • actions
    A list of all executed actions and their responses.

Here is an example of all the available default fields. The fields may vary based on custom extensions, third party plugins or different values.

//This is how the default response looks like
$return_args = array(
    'success' => false,
    'msg' => '',
    'actions' => ''
);
        

This webhook action allows you to fire multiple webhook calls within a single webhook call. It supports all kind of webhooks for internal and external connections and is compatible with all features of WP Webhooks Pro
This description is uniquely made for the bulk_webhooks webhook action.
In case you want to first understand on how to setup webhook actions in general, please check out the following manuals:
https://ironikus.com/docs/article-categories/get-started/

How to use bulk_webhooks

  1. The first argument you need to set within your webhook action request is the action argument. This argument is always required. Please set it to bulk_webhooks.
  2. All the other arguments are optional and just extend the custom execution of the webhooks.

Tipp

  1. To make the most out of this webhook endpoint, please take a look at the actions argument within the Special Arguments list.
  2. You can send data to internal and external URL's. There is no limitation to the system.
  3. This action integrates all available feature of this plugin. You can also connect data mapping templates, as well as authentication templates and much more.


Special Arguments


actions
This argument contains a JSON construct that allows you to register multiple webhooks, which will then be executed in the given order. Each of the row acts as a separate webhook call with all of the available settings and configurations.
{
  "first_webhook_call": {
      "http_arguments": {
          "sslverify": false
      },
      "webhook_url": null,
      "webhook_name": "bulk_actions",
      "webhook_status": "active",
      "webhook_settings": {
          "wpwhpro_trigger_allow_unverified_ssl": 1,
          "wpwhpro_trigger_allow_unsafe_urls": 1,
      },
      "payload_data": {
          "action": "ironikus_test",
          "test_var": "test-value123"
      }
  },
  "second_webhook_call": {
      "payload_data": {
          "action": "ironikus_test",
          "test_var": "test-value123"
      }
  }
}
The JSON can contain multiple webhook calls that are marked via the top level key within the JSON (first_webhook_call, second_webhook_call, ...). This top-level-key indicates the webhook you want to fire and is later used within the response to add the response for that call. Down below you will find an explanation on each of the available settings.
  1. http_arguments (array)
    This key accepts an array containing multiple arguments from the WP_Http object within WordPress. You can take a look at the argumet list by visiting on the following link: https://developer.wordpress.org/reference/classes/WP_Http/request/
  2. webhook_url (string)
    This contains the webhook URL you want to send the request to. By default, it is set to the same webhook URL you are sending this webhook action call to. You can also define external URL's here and send data out of WordPress.
  3. webhook_name (string)
    The name as an identicator when you sent the webhook. By default, it is set to bulk_actions. This value will be sent over to the webhook call within the header as well.
  4. webhook_status (string)
    Use this argumet to prevent the webhook from being sent in the first place. This allows you to temporarily deactivate the call instead of removing it completely fromthe JSON. To deactivate it, please set it to inactive. Default: active
  5. webhook_settings (array)
    This powerful argument allows you to assign All the settings features, that are available for triggers, for ANY webhook call. That means you can even assign authentication and data mapping templates to triggers just for reformatting the data. Down below, you will find a list with all default trigger settings and its possible values:
    1. wpwhpro_trigger_response_type (Type select):
      • json (JSON)
      • xml (XML)
      • form (X-WWW-FORM-URLENCODE)
    2. wpwhpro_trigger_request_method (Type select):
      • post (POST)
      • get (GET)
      • head (HEAD)
      • put (PUT)
      • delete (DELETE)
      • trace (TRACE)
      • options (OPTIONS)
      • patch (PATCH)
    3. wpwhpro_trigger_data_mapping (Type select):
      • 0 (Choose...)
    4. wpwhpro_trigger_authentication (Type select):
      • 0 (Choose...)
    5. wpwhpro_trigger_allow_unsafe_urls (Type checkbox):
      • 0
      • 1
    6. wpwhpro_trigger_allow_unverified_ssl (Type checkbox):
      • 0
      • 1
  6. payload_data (mixed)
    This key contains all of the actual data you would like to send to this specific webhook call.
do_action
The do_action argument is an advanced webhook for developers. It allows you to fire a custom WordPress hook after the bulk_webhooks action was fired.
You can use it to trigger further logic after the webhook action. Here's an example:

Let's assume you set for the do_action parameter fire_this_function. In this case, we will trigger an action with the hook name fire_this_function. Here's how the code would look in this case:
add_action( 'fire_this_function', 'my_custom_callback_function', 20, 2 );
function my_custom_callback_function( $actions, $return_args ){
    //run your custom logic in here
}
Here's an explanation to each of the variables that are sent over within the custom function.
  1. $actions (array)
    Contains the validated data from the actions argument.
  2. $return_args (array)
    Contains the full response that is sent back to the webhook caller.s
Here you can test the specified webhook. Please note, that this test can modify the data of your website (Depending on what action you test). Also, you will see the response as any web service receives it.
Please choose the webhook you are going to run the test with. Simply select the one you want to use down below.
Test a webhooks functionality. (Advanced)
  • actionRequired
    Always required. Determines which webhook action you want to target. (Alternatively, set this value as a query parameter within the URL) For this webhook action, please set it to ironikus_test
  • test_varRequired
    A test var. Include the following value to get a success message back: test-value123
  • success
    (Bool) True if the action was successful, false if not. E.g. array( 'success' => true )
  • test_var
    (string) The variable that was set for the request.
  • msg
    (string) A message with more information about the current request. E.g. array( 'msg' => "This action was successful." )

Here is an example of all the available default fields. The fields may vary based on custom extensions, third party plugins or different values.

$return_args = array(
    'success' => false,
    'msg' => '',
    'test_var' => 'test-value123'
);
        

This webhook action is only used for testing purposes to test if WP Webhooks Pro works properly on your WordPress website.
This description is uniquely made for the ironikus_test webhook action.
In case you want to first understand on how to setup webhook actions in general, please check out the following manuals:
https://ironikus.com/docs/article-categories/get-started/

How to use ironikus_test

  1. The first argument you need to set within your webhook action request is the action argument. This argument is always required. Please set it to ironikus_test.
  2. The second argument you need to set is test_var. Please set it to test-value123

Tipp

This webhook makes sense if you want to test if WP Webhooks Pro works properly on your WordPress website. You can try to setup different values to see how the webhook interacts with your site.
You can also use it to test the functionality using our Ironikus assistant:https://ironikus.com/assistant/
Here you can test the specified webhook. Please note, that this test can modify the data of your website (Depending on what action you test). Also, you will see the response as any web service receives it.
Please choose the webhook you are going to run the test with. Simply select the one you want to use down below.
Creates a comment using a webhook.
  • actionRequired
    Always required. Determines which webhook action you want to target. (Alternatively, set this value as a query parameter within the URL) For this webhook action, please set it to create_comment
  • comment_agent
    (string) The HTTP user agent of the comment_author when the comment was submitted. Default empty.
  • comment_approved
    (int|string) Whether the comment has been approved. Default 1.
  • comment_author
    (string) The name of the author of the comment. Default empty.
  • comment_author_email
    (string) The email address of the $comment_author. Default empty.
  • comment_author_IP
    (string) The IP address of the $comment_author. Default empty.
  • comment_author_url
    (string) The URL address of the $comment_author. Default empty.
  • comment_content
    (string) The content of the comment. Default empty.
  • comment_date
    (string) The date the comment was submitted. To set the date manually, comment_date_gmt must also be specified. Default is the current time.
  • comment_date_gmt
    (string) The date the comment was submitted in the GMT timezone. Default is comment_date in the site's GMT timezone.
  • comment_karma
    (int) The karma of the comment. Default 0.
  • comment_parent
    (int) ID of this comment's parent, if any. Default 0.
  • comment_post_ID
    (int) ID of the post that relates to the comment, if any. Default 0.
  • comment_type
    (string) Comment type. Default empty.
  • comment_meta
    (array) Optional. Array of key/value pairs to be stored in commentmeta for the new comment. More info within the description.
  • user_id
    (int) ID of the user who submitted the comment. Default 0.
  • success
    (Bool) True if the action was successful, false if not. E.g. array( 'success' => true )
  • data
    (array) The data related to the comment, as well as the user and the post object, incl. the meta values.
  • msg
    (string) A message with more information about the current request. E.g. array( 'msg' => "This action was successful." )

Here is an example of all the available default fields. The fields may vary based on custom extensions, third party plugins or different values.

$return_args = array(
	'success' => false,
	'msg' => '',
	'data' => array(
		'comment_id'   => 0,
		'comment_data'  => array(),
		'comment_meta'  => array(),
		'current_post_id' => 0,
		'current_post_data' => array(),
		'current_post_data_meta' => array(),
		'user_id' => 0,
		'user_data' => array(),
		'user_data_meta' => array()
	),
);
        

This hook enables you to create a comment with all of its settings.

You can also add custom post meta. Here is an example on how this would look like using the simple structure (We also support json):



meta_key_1,meta_value_1;my_second_key,add_my_value


To separate the meta from the value, you can use a comma ",". To separate multiple meta settings from each other, easily separate them with a semicolon ";" (It is not necessary to set a semicolon at the end of the last one)

This is an example on how you can include the post meta using JSON.
{
  "meta_key_1": "This is my meta value 1",
  "another_meta_key": "This is my second meta key!"
}
				

For security reasons, we don't send the password within the webhook response. To send the password as well, you can check out the following filter: wpwhpro/webhooks/action_create_comment_restrict_user_values

Here you can test the specified webhook. Please note, that this test can modify the data of your website (Depending on what action you test). Also, you will see the response as any web service receives it.
Please choose the webhook you are going to run the test with. Simply select the one you want to use down below.
Updates a comment using a webhook.
  • actionRequired
    Always required. Determines which webhook action you want to target. (Alternatively, set this value as a query parameter within the URL) For this webhook action, please set it to update_comment
  • comment_IDRequired
    (string) The HTTP user agent of the comment_author when the comment was submitted. Default empty.
  • comment_agent
    (string) The HTTP user agent of the comment_author when the comment was submitted. Default empty.
  • comment_approved
    (int|string) Whether the comment has been approved. Default 1.
  • comment_author
    (string) The name of the author of the comment. Default empty.
  • comment_author_email
    (string) The email address of the $comment_author. Default empty.
  • comment_author_IP
    (string) The IP address of the $comment_author. Default empty.
  • comment_author_url
    (string) The URL address of the $comment_author. Default empty.
  • comment_content
    (string) The content of the comment. Default empty.
  • comment_date
    (string) The date the comment was submitted. To set the date manually, comment_date_gmt must also be specified. Default is the current time.
  • comment_date_gmt
    (string) The date the comment was submitted in the GMT timezone. Default is comment_date in the site's GMT timezone.
  • comment_karma
    (int) The karma of the comment. Default 0.
  • comment_parent
    (int) ID of this comment's parent, if any. Default 0.
  • comment_post_ID
    (int) ID of the post that relates to the comment, if any. Default 0.
  • comment_type
    (string) Comment type. Default empty.
  • comment_meta
    (array) Optional. Array of key/value pairs to be stored in commentmeta for the new comment. More info within the description.
  • user_id
    (int) ID of the user who submitted the comment. Default 0.
  • success
    (Bool) True if the action was successful, false if not. E.g. array( 'success' => true )
  • data
    (array) The data related to the comment, as well as the user and the post object, incl. the meta values.
  • msg
    (string) A message with more information about the current request. E.g. array( 'msg' => "This action was successful." )

Here is an example of all the available default fields. The fields may vary based on custom extensions, third party plugins or different values.

$return_args = array(
	'success' => false,
	'msg' => '',
	'data' => array(
		'comment_id'   => 0,
		'comment_data'  => array(),
		'comment_meta'  => array(),
		'current_post_id' => 0,
		'current_post_data' => array(),
		'current_post_data_meta' => array(),
		'user_id' => 0,
		'user_data' => array(),
		'user_data_meta' => array()
	),
);
        

This hook enables you to update a comment with all of its settings.

You can also add custom post meta. Here is an example on how this would look like using the simple structure (We also support json):



meta_key_1,meta_value_1;my_second_key,add_my_value


To separate the meta from the value, you can use a comma ",". To separate multiple meta settings from each other, easily separate them with a semicolon ";" (It is not necessary to set a semicolon at the end of the last one)

This is an example on how you can include the post meta using JSON. (If you set the meta value to "ironikus-delete", it will remove the existing value.)
{
  "meta_key_1": "This is my meta value 1",
  "another_meta_key": "This is my second meta key!",
  "another_meta_key_1": "ironikus-delete"
}
				

For security reasons, we don't send the password within the webhook response. To send the password as well, you can check out the following filter: wpwhpro/webhooks/action_update_comment_restrict_user_values

Here you can test the specified webhook. Please note, that this test can modify the data of your website (Depending on what action you test). Also, you will see the response as any web service receives it.
Please choose the webhook you are going to run the test with. Simply select the one you want to use down below.
Trash a comment using a webhook.
  • actionRequired
    Always required. Determines which webhook action you want to target. (Alternatively, set this value as a query parameter within the URL) For this webhook action, please set it to trash_comment
  • comment_idRequired
    (int) The comment id of the comment you want to trash.
  • success
    (Bool) True if the action was successful, false if not. E.g. array( 'success' => true )
  • data
    (array) The comment id as comment_id.
  • msg
    (string) A message with more information about the current request. E.g. array( 'msg' => "This action was successful." )

Here is an example of all the available default fields. The fields may vary based on custom extensions, third party plugins or different values.

$return_args = array(
	'success' => false,
	'msg' => '',
	'data' => array(
		'comment_id'   => 0
	),
);
        

This hook enables you to trash a comment with all of its settings.

We only support the comment id. Json objects are not allowed.

Here you can test the specified webhook. Please note, that this test can modify the data of your website (Depending on what action you test). Also, you will see the response as any web service receives it.
Please choose the webhook you are going to run the test with. Simply select the one you want to use down below.
Delete a comment using a webhook.
  • actionRequired
    Always required. Determines which webhook action you want to target. (Alternatively, set this value as a query parameter within the URL) For this webhook action, please set it to delete_comment
  • comment_idRequired
    (int) The comment id of the comment you want to delete.
  • force_delete
    (string) Wether you want to bypass the trash or not. You can set this value to "yes" or "no". Default "no"
  • success
    (Bool) True if the action was successful, false if not. E.g. array( 'success' => true )
  • data
    (array) The comment id as comment_id and the force_delete status.
  • msg
    (string) A message with more information about the current request. E.g. array( 'msg' => "This action was successful." )

Here is an example of all the available default fields. The fields may vary based on custom extensions, third party plugins or different values.

$return_args = array(
	'success' => false,
	'msg' => '',
	'data' => array(
		'comment_id'   => 0,
		'force_delete'   => 'no'
	),
);
        

This hook enables you to delete a comment with all of its settings.

Please note, that this function, by default, pushes the comment to the trash. In case you want to fully delete it, set force_delete to "yes".

Here you can test the specified webhook. Please note, that this test can modify the data of your website (Depending on what action you test). Also, you will see the response as any web service receives it.
Please choose the webhook you are going to run the test with. Simply select the one you want to use down below.
This webhook action allows you to create a download within Easy Digital Downloads.
  • actionRequired
    Always required. Determines which webhook action you want to target. (Alternatively, set this value as a query parameter within the URL) For this webhook action, please set it to edd_create_download
  • price
    (float) The price of the download you want to use. Format: 19.99
  • is_variable_pricing
    (string) Set this value to "yes" if you want to activate variable pricing for this product. Default: no
  • variable_prices
    (string) A JSON formatted string, containing all of the variable product prices. Please see the description for further details.
  • default_price_id
    (integer) The ID of the price variation you want to use as the default price.
  • download_files
    (String) A JSON formatted string containing all of the downloable file. Please see the description for further details.
  • bundled_products
    (String) A JSON formatted string, containing all of the bundled products. Please see the description for further details.
  • bundled_products_conditions
    (String) A JSON formatted string that contains the price dependencies. Please see the description for further details.
  • increase_earnings
    (Float) The price you would like to increase the lifetime earnings of this product. Please see the description for further details.
  • decrease_earnings
    (Float) The price you would like to decrease the lifetime earnings of this product. Please see the description for further details.
  • increase_sales
    (Integer) Increase the number of sales from a statistical point of view. Please see the description for further details.
  • decrease_sales
    (Integer) Decrease the number of sales from a statistical point of view. Please see the description for further details.
  • hide_purchase_link
    (String) Set this string to "yes" to hide the purchase button under the download. Please see the description for more details.
  • download_limit
    (Integer) Limits how often a customer can globally download the purchase. Please see the description for further details.
  • download_author
    (mixed) The ID or the email of the user who added the post. Default is the current user ID.
  • download_date
    (string) The date of the post. Default is the current time. Format: 2018-12-31 11:11:11
  • download_date_gmt
    (string) The date of the post in the GMT timezone. Default is the value of $post_date.
  • download_content
    (string) The post content. Default empty.
  • download_content_filtered
    (string) The filtered post content. Default empty.
  • download_title
    (string) The post title. Default empty.
  • download_excerpt
    (string) The post excerpt. Default empty.
  • download_status
    (string) The post status. Default 'draft'.
  • comment_status
    (string) Whether the post can accept comments. Accepts 'open' or 'closed'. Default is the value of 'default_comment_status' option.
  • ping_status
    (string) Whether the post can accept pings. Accepts 'open' or 'closed'. Default is the value of 'default_ping_status' option.
  • download_password
    (string) The password to access the post. Default empty.
  • download_name
    (string) The post name. Default is the sanitized post title when creating a new post.
  • to_ping
    (string) Space or carriage return-separated list of URLs to ping. Default empty.
  • pinged
    (string) Space or carriage return-separated list of URLs that have been pinged. Default empty.
  • download_parent
    (int) Set this for the post it belongs to, if any. Default 0.
  • menu_order
    (int) The order the post should be displayed in. Default 0.
  • download_mime_type
    (string) The mime type of the post. Default empty.
  • guid
    (string) Global Unique ID for referencing the post. Default empty.
  • download_category
    (string) A comma separated list of category names, slugs, or IDs. Defaults to value of the 'default_category' option. Example: cat_1,cat_2,cat_3
  • tags_input
    (string) A comma separated list of tag names, slugs, or IDs. Default empty.
  • tax_input
    (string) A simple or JSON formatted string containing existing taxonomy terms. Default empty. More details within the description.
  • meta_input
    (string) A json or a comma and semicolon separated list of post meta values keyed by their post meta key. Default empty. More info in the description.
  • wp_error
    Whether to return a WP_Error on failure. Posible values: "yes" or "no". Default value: "no".
  • do_action
    Advanced: Register a custom action after Webhooks Pro fires this webhook. More infos are in the description.
  • success
    (Bool) True if the action was successful, false if not. E.g. array( 'success' => true )
  • msg
    (string) A message with more information about the current request. E.g. array( 'msg' => "This action was successful." )
  • data
    (array) Within the data array, you will find further details about the response, as well as the payment id and further information.

Here is an example of all the available default fields. The fields may vary based on custom extensions, third party plugins or different values.

{
    "success": true,
    "msg": "Download successfully created",
    "data": {
        "download_id": 797,
        "download_data": {
            "post_type": "download",
            "meta_data": "{\n  \"meta_key_1\": \"This is my meta value 1\",\n  \"another_meta_key\": \"This is my second meta key!\",\n  \"third_meta_key\": \"ironikus-serialize{\\\"price\\\": \\\"100\\\"}\"\n}",
            "tax_input": false,
            "edd": {
                "increase_earnings": "25.49",
                "decrease_earnings": false,
                "increase_sales": "15",
                "decrease_sales": false,
                "edd_price": "11.11",
                "is_variable_pricing": 1,
                "edd_variable_prices": "{\n    \"1\": {\n        \"index\": \"1\",\n        \"name\": \"Variation 1\",\n        \"amount\": \"39.90\",\n        \"license_limit\": \"0\",\n        \"is_lifetime\": \"1\"\n    },\n    \"2\": {\n        \"index\": \"2\",\n        \"name\": \"Variation 2\",\n        \"amount\": \"49.90\",\n        \"license_limit\": \"4\"\n    }\n}",
                "default_price_id": "2",
                "edd_download_files": "{\n    \"1\": {\n        \"index\": \"0\",\n        \"attachment_id\": \"\",\n        \"thumbnail_size\": \"\",\n        \"name\": \"wp-webhooks-pro-\",\n        \"file\": \"https:\\/\\/domain.demo\\/wp-content\\/uploads\\/edd\\/2020\\/02\\/wp-webhooks-pro.zip\",\n        \"condition\": \"all\"\n    }\n}",
                "edd_bundled_products": false,
                "bundled_products_conditions": false,
                "hide_purchase_link": "on",
                "download_limit": 45
            }
        },
        "edd": []
    }
}

This webhook action is used to create a download for Easy Digital Downloads on your WordPress system via a webhook call.
The description is uniquely made for the edd_create_download webhook action.
In case you want to first understand how to setup webhook actions in general, please check out the following manuals:
https://ironikus.com/docs/article-categories/get-started/

How to use edd_create_download

  1. The first argument you need to set within your webhook action request is the action argument. This argument is always required. Please set it to edd_create_download.
  2. All the other arguments are optional and just extend the creation of the download. We would still recommend to set the attribute download_title, to make recognizing it easy, as well as for creating proper permalinks/slugs.


Tipps

  1. By default, we create each download in a draft state. If you want to directly publish a download, use the download_status argument and set it to publish.
  2. In case you want to set a short description for your download, you can use the download_excerpt argument.


Special Arguments


price
The default price of the Easy Digital Downloads product. Please set it in the following format: 19.99

is_variable_pricing
In case you set this value to yes, the default edd_price is ignored.

variable_prices
This argument accepts a JSON formatted string of the variations you want to add. Down below, you will find an example, containing all values you can set.
{
    "1": {
        "index": "1",
        "name": "Variation Name",
        "amount": "39.90",
        "license_limit": "0",
        "is_lifetime": "1"
    },
    "2": {
        "index": "2",
        "name": "Variation Name",
        "amount": "49.90",
        "license_limit": "4"
    }
}
Here is a more detailed explanation for each of the values.
  1. The number in front of each entry and the index should always be the same. They identify which variation is which one. It has to be always a numeric string.
  2. The name argument defined the name of the variation.
  3. The amount argument defines the price of the variation. Please use the following format: 19.99.
  4. The license_limit accepts a number to limit the amount of license slots created. 0 is unlimited.
  5. The is_lifetime argument is optional. Set it to 1 to make it lifetime.

default_price_id
The default price id of the variation you want to set as the fault. You only need to set this value in case you set is_variable_pricing to yes.

download_files
This argument accepts a JSON formatted string of the downloadable files you want to add to the download. Down below, you will find an example, containing all values you can set.
{
    "1": {
        "index": "0",
        "attachment_id": "177",
        "thumbnail_size": "false",
        "name": "wp-webhooks.2.0.5",
        "file": "https:\/\/downloads.wordpress.org\/plugin\/wp-webhooks.2.0.5.zip",
        "condition": "all"
    },
    "2": {
        "index": "",
        "attachment_id": "184",
        "thumbnail_size": "false",
        "name": "wp-webhooks.2.0.5",
        "file": "https:\/\/downloads.wordpress.org\/plugin\/wp-webhooks.2.0.5.zip",
        "condition": "2"
    }
}
Here is a more detailed explanation for each of the values.
  1. The number in front of each entry and the index are the identifier of the file. They identify which downloadable file is which one. It has to be always a numeric string.
  2. The attachment_id argument can contain an attachment id (in case the download you add is available within the WordPress media library).
  3. The thumbnail_size argument can contain a specific thumbnail size (in case the download you add is available within the WordPress media library and contains the thumbnail size you defined).
  4. The name argument defines the name of the file (without the extension).
  5. The file argument defines the full, downloadable file URL.
  6. The condition argument defines if you want to enable this file only for a specific variation or not. Set all if you want to make it available for all variations. Otherwise, please use the index id.

bundled_products
This argument allows you to create download bundles. This argument accepts a JSON formatted string of the downloadads you want to bundle. You can also target only a specific variation of a product by defining the variation id, separated by an underscore.
[
    "285_1",
    "23"
]
Here is a more detailed explanation for each of the values.
  1. Each line contains one download id.
  2. On the first line, we add only the first variation of the download with the id 285.
  3. The second line adds the full download with the id 23.

bundled_products_conditions
This argument accepts a JSON formatted string of the downloadads you want to bundle. It contains further definitions on which price assignment should be given for which download.
{
    "1": "all",
    "2": "2"
}
Here is a more detailed explanation for each of the values.
  1. The first argument contains the index id of the bundled product from the bundled_products argument. The value contains the Price assignment for your given variation.
  2. The second line adds the second bundled product with the price assigment of the second variation.

increase_earnings
This argument allows you to increase the lifetime earnings for this product. In case the product does not have any lifetime earnings yet and you set this value to 25.00, then the lifetime earnings will be 0 + 25.00 = 25 $ (or the currency you set by default).

decrease_earnings
This argument allows you to decrease the lifetime earnings for this product. In case the product has lifetime earnings of 100$ and you set this value to 25.00, then the lifetime earnings will be 100 - 25.00 = 75 $ (or the currency you set by default).

increase_sales
Increase the number of sales that have been made for this product. In case you set it to 5, it will add five sales to the lifetime sales of the product (it only increases the number, no payments or anything else is added).

decrease_sales
Decrease the number of sales that have been made for this product. In case you set it to 5, it will remove five sales from the lifetime sales of the product (it only decreases the number, no payments or anything else are removed).

hide_purchase_link
By default, the purchase buttons will be displayed at the bottom of the download, when disabled you will need to use the Purchase link shortcode to output the ability to buy the product where you prefer. To hide the link, set this value to yes

download_limit
Limit the number of times a customer who purchased this product can access their download links. This is a global limit. If you want to set different limits for variations, please do that within the variable_prices argument.

download_author
The download author argument accepts either the user id of a user, or the email address of an existing user. In case you choose the email adress, we try to match it with the users on your WordPress site. In case we couldn't find a user for the given email, we leave the field empty.

download_content
The download content is the main content area of the download. It can contain HTML or any other kind of content necessary for your functionality.

download_status
The download status defines further details about how your download will be treated. By default, WordPress offers the following download statuses: draft, pending, private, publish. Please note that other plugins can extend the download status values to offer a bigger variety.

tags_input
This argument supports the default tags_input variable of the wp_insert_post() function. Please use this function only if you are known to its functionality since WordPress might not add the values properly due to permissions. If you are not sure, please use the tax_input argument instead.

Here is an example:
342,5678,2
This argument supports a comma separated list of tag names, slugs, or IDs.

tax_input
This argument allows you to add/append/delete any kind of taxonomies on your download. It uses a custom functionality that adds the taxonomies independently of the wp_update_post() function.
To make it work, we offer certain different features and methods to make the most out of the taxonomy management. Down below, you will find further information about the whole functionality.
  1. String method
    This method allows you to add/update/delete or bulk manage the download taxonomies using a simple string. Both the string and the JSON method support custom taxonomies too. In case you use more complex taxonomies that use semicolons or double points within the slugs, you need to use the JSON method.
    • Replace existing taxonomy items
      This method allows you to replace already existing taxonomy items on the download. In case a taxonomy item does not exists at the point you want to add it, it will be ignored.
      taxonomy_1,tax_item_1:tax_item_2:tax_item_3;taxonomy_2,tax_item_5:tax_item_7:tax_item_8
      To separate the taxonomies from the single taxonomy items, please use a comma ",". In case you want to add multiple items per taxonomy, you can separate them via a double point ":". To separate multiple taxonomies from each other, please separate them with a semicolon ";" (It is not necessary to set a semicolon at the end of the last one)
    • Remove all taxonomy items for a single taxonomy
      In case you want to remove all taxonomy items from one or multiple taxonomies, you can set ironikus-remove-all; in front of a semicolon-separated list of the taxonomies you want to remove all items for. Here is an example:
      ironikus-remove-all;taxonomy_1;taxonomy_2
    • Remove single taxonomy items for a taxonomy
      You can also remove only single taxonomy items for one or multiple taxonomies. Here is an example:
      ironikus-append;taxonomy_1,value_1:value_2-ironikus-delete:value_3;taxonomy_2,value_5:value_6:value_7-ironikus-delete
      In the example above, we append the taxonomies taxonomy_1 and taxonomy_2. We also add the taxonomy items value_1, value_3, value_5 and value_6. We also remove the taxonomy items value_2 and value_7.
    • Append taxonomy items
      You can also append any taxonomy items without the existing ones being replaced. To do that, simply add ironikus-append; at the beginning of the string.
      ironikus-append;taxonomy_1,value_1:value_2:value_3;taxonomy_2,value_1:value_2:value_3
      In the example above, we append the taxonomies taxonomy_1 and taxonomy_2 with multiple taxonomy items on the download. The already assigned ones won't be replaced.
  2. JSON method
    This method allows you to add/update/delete or bulk manage the download taxonomies using a simple string. Both the string and the JSON method support custom taxonomies too.
    • Replace existing taxonomy items
      This JSON allows you to replace already existing taxonomy items on the download. In case a taxonomy item does not exists at the point you want to add it, it will be ignored.
      {
        "category": [
          "test-category",
          "second-category"
        ],
        "post_tag": [
          "dog",
          "male",
          "simple"
        ]
      }
      The key on the first layer of the JSON is the slug of the taxonomy. As a value, it accepts multiple slugs of the single taxonomy terms. To add multiple taxonomies, simply append them on the first layer of the JSON.
    • Remove all taxonomy items for a single taxonomy
      In case you want to remove all taxonomy items from one or multiple taxonomies, you can set ironikus-remove-all as a separate value with the wpwhtype key. The wpwhtype key is a reserved key for further actions on the data. Here is an example:
      {
        "wpwhtype": "ironikus-remove-all",
        "category": [],
        "post_tag": []
      }
    • Append taxonomy items
      You can also append any taxonomy items without the existing ones being replaced. To do that, simply add ironikus-append to the wpwhtype key. The wpwhtype key is a reserved key for further actions on the data. All the taxonomies you add after, will be added to the existing ones on the download.
      {
        "wpwhtype": "ironikus-append",
        "category": [
          "test-category",
          "second-category"
        ],
        "post_tag": [
          "dog"
        ]
      }
      In the example above, we append the taxonomies category and post_tag with multiple taxonomy items on the download. The already assigned ones won't be replaced.
    • Remove single taxonomy items for a taxonomy
      You can also remove only single taxonomy items for one or multiple taxonomies. To do that, simply append -ironikus-delete at the end of the taxonomy term slug. This specific taxonomy term will then be removed from the download. Here is an example:
      {
        "wpwhtype": "ironikus-append",
        "category": [
          "test-category",
          "second-category-ironikus-delete"
        ],
        "post_tag": [
          "dog-ironikus-delete"
        ]
      }
      In the example above, we append the taxonomies category and post_tag. We also add the taxonomy item test-category. We also remove the taxonomy items second-category and dog.

meta_input
This argument is specifically designed to add/update or remove download meta to your created download.
To create/update or delete custom meta values, we offer you two different ways:
  1. String method
    This method allows you to add/update or delete the download meta using a simple string. To make it work, separate the meta key from the value using a comma (,). To separate multiple meta settings from each other, simply separate them with a semicolon (;). To remove a meta value, simply set as a value ironikus-delete
    meta_key_1,meta_value_1;my_second_key,ironikus-delete
    IMPORTANT: Please note that if you want to use values that contain commas or semicolons, the string method does not work. In this case, please use the JSON method.
  2. JSON method
    This method allows you to add/update or remove the download meta using a JSON formatted string. To make it work, add the meta key as the key and the meta value as the value. To delete a meta value, simply set the value to ironikus-delete. Here's an example on how this looks like:
    {
      "meta_key_1": "This is my meta value 1",
      "another_meta_key": "This is my second meta key!"
      "third_meta_key": "ironikus-delete"
    }
Advanced: We also offer JSON to array serialization for single download meta values. This means, you can turn JSON into a serialized array.
As an example: The following JSON {"price": "100"} will turn into a:1:{s:5:"price";s:3:"100";}
To make it work, you need to add the following string in front of the escaped JSON within the value field of your single meta value of the meta_input argument: ironikus-serialize. Here's a full example:
{
  "meta_key_1": "This is my meta value 1",
  "another_meta_key": "This is my second meta key!",
  "third_meta_key": "ironikus-serialize{\"price\": \"100\"}"
}
This example will create three download meta entries. The third entry has the meta key third_meta_key and a serialized meta value of a:1:{s:5:"price";s:3:"100";}. The string ironikus-serialize in front of the escaped JSON will tell our plugin to serialize the value. Please note that the JSON value, which you include within the original JSON string of the meta_input argument, needs to be escaped.

wp_error
In case you set the wp_error argument to yes, we will return the WP Error object within the response if the webhook action call. It is recommended to only use this for debugging.

do_action
The do_action argument is an advanced webhook for developers. It allows you to fire a custom WordPress hook after the edd_create_download action was fired.
You can use it to trigger further logic after the webhook action. Here's an example:

Let's assume you set for the do_action parameter fire_this_function. In this case, we will trigger an action with the hook name fire_this_function. Here's how the code would look in this case:
add_action( 'fire_this_function', 'my_custom_callback_function', 20, 4 );
function my_custom_callback_function( $post_data, $post_id, $meta_input, $return_args ){
    //run your custom logic in here
}
Here's an explanation to each of the variables that are sent over within the custom function.
  1. $post_data (array)
    Contains the data that is used to create the download and some additional data as the meta input.
  2. $post_id (integer)
    Contains the download id of the newly created download. Please note that it can also contain a wp_error object since it is the response of the wp_insert_user() function.
  3. $meta_input (string)
    Contains the unformatted download meta as you sent it over within the webhook request as a string.
  4. $return_args (array)
    An array containing the information we will send back as the response to the initial webhook caller.
Here you can test the specified webhook. Please note, that this test can modify the data of your website (Depending on what action you test). Also, you will see the response as any web service receives it.
Please choose the webhook you are going to run the test with. Simply select the one you want to use down below.
This webhook action allows you to update (or create) a download within Easy Digital Downloads.
  • actionRequired
    Always required. Determines which webhook action you want to target. (Alternatively, set this value as a query parameter within the URL) For this webhook action, please set it to edd_update_download
  • download_idRequired
    (Integer) The ID of the existing download
  • create_if_none
    (String) Set this value to "yes" to create the download in case the given download id does not exist. Default: no
  • price
    (float) The price of the download you want to use. Format: 19.99
  • is_variable_pricing
    (string) Set this value to "yes" if you want to activate variable pricing for this product. Default: no
  • variable_prices
    (string) A JSON formatted string, containing all of the variable product prices. Please see the description for further details.
  • default_price_id
    (integer) The ID of the price variation you want to use as the default price.
  • download_files
    (String) A JSON formatted string containing all of the downloable file. Please see the description for further details.
  • bundled_products
    (String) A JSON formatted string, containing all of the bundled products. Please see the description for further details.
  • bundled_products_conditions
    (String) A JSON formatted string that contains the price dependencies. Please see the description for further details.
  • increase_earnings
    (Float) The price you would like to increase the lifetime earnings of this product. Please see the description for further details.
  • decrease_earnings
    (Float) The price you would like to decrease the lifetime earnings of this product. Please see the description for further details.
  • increase_sales
    (Integer) Increase the number of sales from a statistical point of view. Please see the description for further details.
  • decrease_sales
    (Integer) Decrease the number of sales from a statistical point of view. Please see the description for further details.
  • hide_purchase_link
    (String) Set this string to "yes" to hide the purchase button under the download. Please see the description for more details.
  • download_limit
    (Integer) Limits how often a customer can globally download the purchase. Please see the description for further details.
  • download_author
    (mixed) The ID or the email of the user who added the post. Default is the current user ID.
  • download_date
    (string) The date of the post. Default is the current time. Format: 2018-12-31 11:11:11
  • download_date_gmt
    (string) The date of the post in the GMT timezone. Default is the value of $post_date.
  • download_content
    (string) The post content. Default empty.
  • download_content_filtered
    (string) The filtered post content. Default empty.
  • download_title
    (string) The post title. Default empty.
  • download_excerpt
    (string) The post excerpt. Default empty.
  • download_status
    (string) The post status. Default 'draft'.
  • comment_status
    (string) Whether the post can accept comments. Accepts 'open' or 'closed'. Default is the value of 'default_comment_status' option.
  • ping_status
    (string) Whether the post can accept pings. Accepts 'open' or 'closed'. Default is the value of 'default_ping_status' option.
  • download_password
    (string) The password to access the post. Default empty.
  • download_name
    (string) The post name. Default is the sanitized post title when creating a new post.
  • to_ping
    (string) Space or carriage return-separated list of URLs to ping. Default empty.
  • pinged
    (string) Space or carriage return-separated list of URLs that have been pinged. Default empty.
  • download_parent
    (int) Set this for the post it belongs to, if any. Default 0.
  • menu_order
    (int) The order the post should be displayed in. Default 0.
  • download_mime_type
    (string) The mime type of the post. Default empty.
  • guid
    (string) Global Unique ID for referencing the post. Default empty.
  • download_category
    (string) A comma separated list of category names, slugs, or IDs. Defaults to value of the 'default_category' option. Example: cat_1,cat_2,cat_3
  • tags_input
    (string) A comma separated list of tag names, slugs, or IDs. Default empty.
  • tax_input
    (string) A simple or JSON formatted string containing existing taxonomy terms. Default empty. More details within the description.
  • meta_input
    (string) A json or a comma and semicolon separated list of post meta values keyed by their post meta key. Default empty. More info in the description.
  • wp_error
    Whether to return a WP_Error on failure. Posible values: "yes" or "no". Default value: "no".
  • do_action
    Advanced: Register a custom action after Webhooks Pro fires this webhook. More infos are in the description.
  • success
    (Bool) True if the action was successful, false if not. E.g. array( 'success' => true )
  • msg
    (string) A message with more information about the current request. E.g. array( 'msg' => "This action was successful." )
  • data
    (array) Within the data array, you will find further details about the response, as well as the payment id and further information.

Here is an example of all the available default fields. The fields may vary based on custom extensions, third party plugins or different values.

{
    "success": true,
    "msg": "Download successfully created",
    "data": {
        "download_id": 797,
        "download_data": {
            "post_type": "download",
            "meta_data": "{\n  \"meta_key_1\": \"This is my meta value 1\",\n  \"another_meta_key\": \"This is my second meta key!\",\n  \"third_meta_key\": \"ironikus-serialize{\\\"price\\\": \\\"100\\\"}\"\n}",
            "tax_input": false,
            "create_if_none": false,
            "edd": {
                "increase_earnings": "25.49",
                "decrease_earnings": false,
                "increase_sales": "15",
                "decrease_sales": false,
                "edd_price": "11.11",
                "is_variable_pricing": 1,
                "edd_variable_prices": "{\n    \"1\": {\n        \"index\": \"1\",\n        \"name\": \"Variation 1\",\n        \"amount\": \"39.90\",\n        \"license_limit\": \"0\",\n        \"is_lifetime\": \"1\"\n    },\n    \"2\": {\n        \"index\": \"2\",\n        \"name\": \"Variation 2\",\n        \"amount\": \"49.90\",\n        \"license_limit\": \"4\"\n    }\n}",
                "default_price_id": "2",
                "edd_download_files": "{\n    \"1\": {\n        \"index\": \"0\",\n        \"attachment_id\": \"\",\n        \"thumbnail_size\": \"\",\n        \"name\": \"wp-webhooks-pro-\",\n        \"file\": \"https:\\/\\/domain.demo\\/wp-content\\/uploads\\/edd\\/2020\\/02\\/wp-webhooks-pro.zip\",\n        \"condition\": \"all\"\n    }\n}",
                "edd_bundled_products": false,
                "bundled_products_conditions": false,
                "hide_purchase_link": "on",
                "download_limit": 45
            }
        },
        "edd": []
    }
}

This webhook action is used to update a download for Easy Digital Downloads on your WordPress system via a webhook call.
The description is uniquely made for the edd_update_download webhook action.
In case you want to first understand how to setup webhook actions in general, please check out the following manuals:
https://ironikus.com/docs/article-categories/get-started/

How to use edd_update_download

  1. The first argument you need to set within your webhook action request is the action argument. This argument is always required. Please set it to edd_update_download.
  2. It is also required to set the download_id argument. Please set it to the id of the download you want to update.
  3. All the other arguments are optional and just extend the update process of the download.


Tipps

  1. In case the download id you provided within the download_id argument coult not be found, you can also create the post by defining the create_if_none argument with the value yes.
  2. We currently offer pre-defined fields for the download. If you want to add further meta values, you can use the meta_input argument.


Special Arguments


create_if_none
Set this value to yes to create the download in case it does not exist yet.

price
The default price of the Easy Digital Downloads product. Please set it in the following format: 19.99

is_variable_pricing
In case you set this value to yes, the default edd_price is ignored.

variable_prices
This argument accepts a JSON formatted string of the variations you want to update. Down below, you will find an example, containing all values you can set. Please not that defining this argument, it will replace all previously set variations.
{
    "1": {
        "index": "1",
        "name": "Variation Name",
        "amount": "39.90",
        "license_limit": "0",
        "is_lifetime": "1"
    },
    "2": {
        "index": "2",
        "name": "Variation Name",
        "amount": "49.90",
        "license_limit": "4"
    }
}
Here is a more detailed explanation for each of the values.
  1. The number in front of each entry and the index should always be the same. They identify which variation is which one. It has to be always a numeric string.
  2. The name argument defined the name of the variation.
  3. The amount argument defines the price of the variation. Please use the following format: 19.99.
  4. The license_limit accepts a number to limit the amount of license slots created. 0 is unlimited.
  5. The is_lifetime argument is optional. Set it to 1 to make it lifetime.

default_price_id
The default price id of the variation you want to set as the fault. You only need to set this value in case you set is_variable_pricing to yes.

download_files
This argument accepts a JSON formatted string of the downloadable files you want to add to the download. Down below, you will find an example, containing all values you can set. Please not that defining this argument, it will replace all previously set download files within this argument.
{
    "1": {
        "index": "0",
        "attachment_id": "177",
        "thumbnail_size": "false",
        "name": "wp-webhooks.2.0.5",
        "file": "https:\/\/downloads.wordpress.org\/plugin\/wp-webhooks.2.0.5.zip",
        "condition": "all"
    },
    "2": {
        "index": "",
        "attachment_id": "184",
        "thumbnail_size": "false",
        "name": "wp-webhooks.2.0.5",
        "file": "https:\/\/downloads.wordpress.org\/plugin\/wp-webhooks.2.0.5.zip",
        "condition": "2"
    }
}
Here is a more detailed explanation for each of the values.
  1. The number in front of each entry and the index are the identifier of the file. They identify which downloadable file is which one. It has to be always a numeric string.
  2. The attachment_id argument can contain an attachment id (in case the download you add is available within the WordPress media library).
  3. The thumbnail_size argument can contain a specific thumbnail size (in case the download you add is available within the WordPress media library and contains the thumbnail size you defined).
  4. The name argument defines the name of the file (without the extension).
  5. The file argument defines the full, downloadable file URL.
  6. The condition argument defines if you want to enable this file only for a specific variation or not. Set all if you want to make it available for all variations. Otherwise, please use the index id.

bundled_products
This argument allows you to create download bundles. This argument accepts a JSON formatted string of the downloadads you want to bundle. You can also target only a specific variation of a product by defining the variation id, separated by an underscore. Please not that defining this argument, will replace all previously set bundle products within this argument.
[
    "285_1",
    "23"
]
Here is a more detailed explanation for each of the values.
  1. Each line contains one download id.
  2. On the first line, we add only the first variation of the download with the id 285.
  3. The second line adds the full download with the id 23.

bundled_products_conditions
This argument accepts a JSON formatted string of the downloadads you want to bundle. It contains further definitions on which price assignment should be given for which download. Please not that defining this argument, it will replace all previously set conditions for this argument.
{
    "1": "all",
    "2": "2"
}
Here is a more detailed explanation for each of the values.
  1. The first argument contains the index id of the bundled product from the bundled_products argument. The value contains the Price assignment for your given variation.
  2. The second line adds the second bundled product with the price assigment of the second variation.

increase_earnings
This argument allows you to increase the lifetime earnings for this product. In case the product does not have any lifetime earnings yet and you set this value to 25.00, then the lifetime earnings will be 0 + 25.00 = 25 $ (or the currency you set by default).

decrease_earnings
This argument allows you to decrease the lifetime earnings for this product. In case the product has lifetime earnings of 100$ and you set this value to 25.00, then the lifetime earnings will be 100 - 25.00 = 75 $ (or the currency you set by default).

increase_sales
Increase the number of sales that have been made for this product. In case you set it to 5, it will add five sales to the lifetime sales of the product (it only increases the number, no payments or anything else is added).

decrease_sales
Decrease the number of sales that have been made for this product. In case you set it to 5, it will remove five sales from the lifetime sales of the product (it only decreases the number, no payments or anything else are removed).

hide_purchase_link
By default, the purchase buttons will be displayed at the bottom of the download, when disabled you will need to use the Purchase link shortcode to output the ability to buy the product where you prefer. To hide the link, set this value to yes

download_limit
Limit the number of times a customer who purchased this product can access their download links. This is a global limit. If you want to set different limits for variations, please do that within the variable_prices argument.

download_author
The download author argument accepts either the user id of a user, or the email address of an existing user. In case you choose the email adress, we try to match it with the users on your WordPress site. In case we couldn't find a user for the given email, we leave the field empty.

download_content
The download content is the main content area of the download. It can contain HTML or any other kind of content necessary for your functionality.

download_status
The download status defines further details about how your download will be treated. By default, WordPress offers the following download statuses: draft, pending, private, publish. Please note that other plugins can extend the download status values to offer a bigger variety.

tags_input
This argument supports the default tags_input variable of the wp_insert_post() function. Please use this function only if you are known to its functionality since WordPress might not add the values properly due to permissions. If you are not sure, please use the tax_input argument instead.

Here is an example:
342,5678,2
This argument supports a comma separated list of tag names, slugs, or IDs.

tax_input
This argument allows you to add/append/delete any kind of taxonomies on your download. It uses a custom functionality that adds the taxonomies independently of the wp_update_post() function.
To make it work, we offer certain different features and methods to make the most out of the taxonomy management. Down below, you will find further information about the whole functionality.
  1. String method
    This method allows you to add/update/delete or bulk manage the download taxonomies using a simple string. Both the string and the JSON method support custom taxonomies too. In case you use more complex taxonomies that use semicolons or double points within the slugs, you need to use the JSON method.
    • Replace existing taxonomy items
      This method allows you to replace already existing taxonomy items on the download. In case a taxonomy item does not exists at the point you want to add it, it will be ignored.
      taxonomy_1,tax_item_1:tax_item_2:tax_item_3;taxonomy_2,tax_item_5:tax_item_7:tax_item_8
      To separate the taxonomies from the single taxonomy items, please use a comma ",". In case you want to add multiple items per taxonomy, you can separate them via a double point ":". To separate multiple taxonomies from each other, please separate them with a semicolon ";" (It is not necessary to set a semicolon at the end of the last one)
    • Remove all taxonomy items for a single taxonomy
      In case you want to remove all taxonomy items from one or multiple taxonomies, you can set ironikus-remove-all; in front of a semicolon-separated list of the taxonomies you want to remove all items for. Here is an example:
      ironikus-remove-all;taxonomy_1;taxonomy_2
    • Remove single taxonomy items for a taxonomy
      You can also remove only single taxonomy items for one or multiple taxonomies. Here is an example:
      ironikus-append;taxonomy_1,value_1:value_2-ironikus-delete:value_3;taxonomy_2,value_5:value_6:value_7-ironikus-delete
      In the example above, we append the taxonomies taxonomy_1 and taxonomy_2. We also add the taxonomy items value_1, value_3, value_5 and value_6. We also remove the taxonomy items value_2 and value_7.
    • Append taxonomy items
      You can also append any taxonomy items without the existing ones being replaced. To do that, simply add ironikus-append; at the beginning of the string.
      ironikus-append;taxonomy_1,value_1:value_2:value_3;taxonomy_2,value_1:value_2:value_3
      In the example above, we append the taxonomies taxonomy_1 and taxonomy_2 with multiple taxonomy items on the download. The already assigned ones won't be replaced.
  2. JSON method
    This method allows you to add/update/delete or bulk manage the download taxonomies using a simple string. Both the string and the JSON method support custom taxonomies too.
    • Replace existing taxonomy items
      This JSON allows you to replace already existing taxonomy items on the download. In case a taxonomy item does not exists at the point you want to add it, it will be ignored.
      {
        "category": [
          "test-category",
          "second-category"
        ],
        "post_tag": [
          "dog",
          "male",
          "simple"
        ]
      }
      The key on the first layer of the JSON is the slug of the taxonomy. As a value, it accepts multiple slugs of the single taxonomy terms. To add multiple taxonomies, simply append them on the first layer of the JSON.
    • Remove all taxonomy items for a single taxonomy
      In case you want to remove all taxonomy items from one or multiple taxonomies, you can set ironikus-remove-all as a separate value with the wpwhtype key. The wpwhtype key is a reserved key for further actions on the data. Here is an example:
      {
        "wpwhtype": "ironikus-remove-all",
        "category": [],
        "post_tag": []
      }
    • Append taxonomy items
      You can also append any taxonomy items without the existing ones being replaced. To do that, simply add ironikus-append to the wpwhtype key. The wpwhtype key is a reserved key for further actions on the data. All the taxonomies you add after, will be added to the existing ones on the download.
      {
        "wpwhtype": "ironikus-append",
        "category": [
          "test-category",
          "second-category"
        ],
        "post_tag": [
          "dog"
        ]
      }
      In the example above, we append the taxonomies category and post_tag with multiple taxonomy items on the download. The already assigned ones won't be replaced.
    • Remove single taxonomy items for a taxonomy
      You can also remove only single taxonomy items for one or multiple taxonomies. To do that, simply append -ironikus-delete at the end of the taxonomy term slug. This specific taxonomy term will then be removed from the download. Here is an example:
      {
        "wpwhtype": "ironikus-append",
        "category": [
          "test-category",
          "second-category-ironikus-delete"
        ],
        "post_tag": [
          "dog-ironikus-delete"
        ]
      }
      In the example above, we append the taxonomies category and post_tag. We also add the taxonomy item test-category. We also remove the taxonomy items second-category and dog.

meta_input
This argument is specifically designed to add/update or remove download meta to your created download.
To create/update or delete custom meta values, we offer you two different ways:
  1. String method
    This method allows you to add/update or delete the download meta using a simple string. To make it work, separate the meta key from the value using a comma (,). To separate multiple meta settings from each other, simply separate them with a semicolon (;). To remove a meta value, simply set as a value ironikus-delete
    meta_key_1,meta_value_1;my_second_key,ironikus-delete
    IMPORTANT: Please note that if you want to use values that contain commas or semicolons, the string method does not work. In this case, please use the JSON method.
  2. JSON method
    This method allows you to add/update or remove the download meta using a JSON formatted string. To make it work, add the meta key as the key and the meta value as the value. To delete a meta value, simply set the value to ironikus-delete. Here's an example on how this looks like:
    {
      "meta_key_1": "This is my meta value 1",
      "another_meta_key": "This is my second meta key!"
      "third_meta_key": "ironikus-delete"
    }
Advanced: We also offer JSON to array serialization for single download meta values. This means, you can turn JSON into a serialized array.
As an example: The following JSON {"price": "100"} will turn into a:1:{s:5:"price";s:3:"100";}
To make it work, you need to add the following string in front of the escaped JSON within the value field of your single meta value of the meta_input argument: ironikus-serialize. Here's a full example:
{
  "meta_key_1": "This is my meta value 1",
  "another_meta_key": "This is my second meta key!",
  "third_meta_key": "ironikus-serialize{\"price\": \"100\"}"
}
This example will create three download meta entries. The third entry has the meta key third_meta_key and a serialized meta value of a:1:{s:5:"price";s:3:"100";}. The string ironikus-serialize in front of the escaped JSON will tell our plugin to serialize the value. Please note that the JSON value, which you include within the original JSON string of the meta_input argument, needs to be escaped.

wp_error
In case you set the wp_error argument to yes, we will return the WP Error object within the response if the webhook action call. It is recommended to only use this for debugging.

do_action
The do_action argument is an advanced webhook for developers. It allows you to fire a custom WordPress hook after the edd_update_download action was fired.
You can use it to trigger further logic after the webhook action. Here's an example:

Let's assume you set for the do_action parameter fire_this_function. In this case, we will trigger an action with the hook name fire_this_function. Here's how the code would look in this case:
add_action( 'fire_this_function', 'my_custom_callback_function', 20, 4 );
function my_custom_callback_function( $post_data, $post_id, $meta_input, $return_args ){
    //run your custom logic in here
}
Here's an explanation to each of the variables that are sent over within the custom function.
  1. $post_data (array)
    Contains the data that is used to create the download and some additional data as the meta input.
  2. $post_id (integer)
    Contains the download id of the newly created download. Please note that it can also contain a wp_error object since it is the response of the wp_insert_user() function.
  3. $meta_input (string)
    Contains the unformatted download meta as you sent it over within the webhook request as a string.
  4. $return_args (array)
    An array containing the information we will send back as the response to the initial webhook caller.
Here you can test the specified webhook. Please note, that this test can modify the data of your website (Depending on what action you test). Also, you will see the response as any web service receives it.
Please choose the webhook you are going to run the test with. Simply select the one you want to use down below.