Tips from Tech Support
Background
Actions in Ninja Forms fire in accordance with timing and priority rules that are set within the plugin files, and while it is possible to change those rules, at this time we have not yet implemented a user-friendly way to visualize the rules. This is something that is on our development roadmap, but because it affects a large number of plugins and could be overwhelming to many customers, and most importantly because making certain timing changes could result in unintended effects, we don't want to rush it.
The default timing and priority rules attempt to anticipate the most common combinations of actions, but there are certainly use cases that demand more precise control.
- You can find our documentation on action timing and priority here: https://developer.ninjaforms.com/codex/action-timing-and-priority/
In order to cause the Create Post action to fire after the payment action, you can change the timing to ensure the payment action has to fire first.
To implement this change, you can manually change one line in the Post Creation plugin code for the Create Post action to delay until after payment processing has completed (note that this will not prevent the submission data from being recorded if payment is not completed -- only the post creation).
- You can find instructions on how to access and edit this file in your Dashboard here: https://wordpress.org/support/article/editing-files/
- Alternatively, you can edit the file via FTP.
The line to change is line 21 in the file: /ninja-forms-post-creation/includes/Actions/CreatePost.php
This change should prevent the post creation from happening until and unless payment has been completed.
Change the timing from 'normal' to 'late'.
So:
protected $_timing = 'normal';
becomes
protected $_timing = 'late';
Then update the file, and test to ensure that the behavior is functioning as intended.
If the issue persists after implementing the change, please let us know. Also, of course let us know if you have any other questions or if there is anything else we can help you with.