publishpress / PublishPress-Future

This plugin was known as "Post Expirator", and now it is called "PublishPress Future".

Home Page:https://wordpress.org/plugins/post-expirator/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add a global variables system

andergmartins opened this issue · comments

Add a global variables system with the following data:

  • Current workflow data
  • What trigger initiated it
  • Site data
  • User that triggered the action (if any)

Note to self: Keep adding other global vars.

We may need to avoid collisions in the input, multiple input, and global variables.
One possible solution is to inject the node's ID as the prefix to each variable, and for global variables, "global" will be the prefix. For example:

This solves the problem when the node has multiple triggers, which triggers the same input variables.

  • node_92342790238.post_after.post_title
  • global.workflow.title

Prefixing the global variables sounds good, but maybe prefixing input variables might not be a good idea. Suppose a node receives as input two nodes, and both provide the same output names (as input) when the node is executed. In that case, it won't be able to decide which variable to use but will receive the one coming throw the current flow, for the respective activated edge.