0
votes
0answers
103 views

Function working in single.php but not working in custom template file

I defined in my functions.php the following code: function fix_footnotes($content){ return preg_replace('/href\s*=\s*"[^"]+(#[^"]+)"/','href="$1"', $content); } When I call this ...
1
vote
1answer
285 views

Scheduling posts to update once per day with wp_cron

I have a function that hooks into save_post that changes the value of a custom taxonomy term based on today's date. That's working fine. When I update a post, the taxonomy term is updated correctly. ...
0
votes
1answer
359 views

The work of Wordpress Function update_post

I use wp_update_post() in a Frontend Page. The first part of the function works as expected. post_content and/or post_title will be changed in wp_posts. But the function does not create a revision ...
1
vote
4answers
847 views

change a post status when users update posts?

Is there an efficient way to change a post status from 'published' to 'draft' when a user of a certain type tries to update their posts. I tried something along these lines function ...