You must modify the contents of the message before posting it. I could overwrite my own publishing function, but I don't want to do this.
What I would like to do is something like:
add_action('before_publish_post','my_func'); function my_func($content){ $content = "new content"; return $content; }
I looked at publish_post, but that only allows me to change the content of the post that was published, not before.
any help would be appreciated, greetings
It must be a filter wp_insert_post_data
wp_insert_post_data
If I were really cool, I would wait until the anniversary date of this post and do it, but ...
You can also use:
add_action('pre_post_update','alter_post_contents');
, , , . , pre_post_update, , post id , post.php, , , , arg , ....
pre_post_update
post.php
, .
Use save_post.
save_post
You can read more here: http://codex.wordpress.org/Plugin_API/Action_Reference
Source: https://habr.com/ru/post/1772256/More articles:How to link datagrid Silverlight shortcut list item itemSource element to view Model - silverlightProgram memory segments in C - cReading zip files stored in GAE Blobstore - javaHow to create a Master Detail view with two user controls in MVVM? - data-bindingLinq to sql/С# - несколько, где поиск пары ключ/значение - c#Is it possible to move the index of a UITableView? - iosGet parent id from jquery div - jqueryWhat is the role of AssemblyFileVersionAttribute? - .netA simple update mechanism for a C / GTK application on Windows - cSplit a list of names in an alphabetical dictionary, in Python - pythonAll Articles