colinwalker
colinwalker

Frustrating. When posting via Workflow the save_post hook doesn’t seem to be getting triggered, only when going via the WordPress post UI.

Anyone know a workaround?

|
Embed
johnjohnston
johnjohnston

@colinwalker would wpinsertpost_data do it? Caller prior to inserting into or updating the database?

|
Embed
johnjohnston
johnjohnston

@colinwalker hmm underscore mid word are markdowned try escaping wp_insert_post_data

|
Embed
colinwalker
colinwalker

@johnjohnston Not sure πŸ€” Think Workflow posts via the Rest API so not convinced that is going to work either. Think you'd need to use rest_insert but don't know anything about The Rest API.

|
Embed
johnjohnston
johnjohnston

@colinwalker me neither I am afraid. But the name and description sound as if it should work.. Does work for xml-rpc which doesn't use web Ui?

|
Embed
colinwalker
colinwalker

@johnjohnston Don't know, Workflow is the only avenue I'm attacking (or not, lol) may dig in some other time - can't really find any useful guides.

|
Embed
johnjohnston
johnjohnston

@colinwalker I'll give workflow a try tomorrow I use it for microcasts and normal so should be able to test.

|
Embed
colinwalker
colinwalker

@johnjohnston Cool πŸ‘ be interested to know how you get on. Night for now.

|
Embed
In reply to
johnjohnston
johnjohnston

@colinwalker gave it a quick test this morning seems to work. I've got a function that is called on wp_insert_data that added a title and titles were added.

|
Embed
colinwalker
colinwalker

@johnjohnston Cool, thanks. I'll have to have a look at converting the function called on save_post and see if I can get it working.

|
Embed
colinwalker
colinwalker

@johnjohnston A quick test looks good πŸ‘ now just need to flesh it out to replicate the function completely. Thanks for checking.

|
Embed
colinwalker
colinwalker

@johnjohnston Got it sorted πŸ‘ thanks for the pointer.

|
Embed