Reputation
4,543
Top tag
Next privilege 5,000 Rep.
Approve tag wiki edits
Badges
1 7 17
Newest
 Enlightened
Impact
~231k people reached

Apr
13
comment Clone a Post Tite and Custom Field into Custom Post type
It's there in the answer right now. Just copy the first 4 lines from the main answer
Apr
12
comment Clone a Post Tite and Custom Field into Custom Post type
In my original answer the first if condition checks for the existing entry only. I think adding that if condition back should fix the repeated clones.
Apr
5
comment Stop wordpress from creating multiple size images
Preferably, you should use one of the filters from the plugin. If the plugin doesn't have one, then, depending on the plugin, maybe you might be able to use an if condition inside the function to check for the plugin.
Mar
16
reviewed Approve Proper Way to Modify Plugin
Mar
8
comment Clone a Post Tite and Custom Field into Custom Post type
I don't exactly see the issue with this code here. Maybe try removing the return; inside the if condition. But that will end up creating new clones, each time you update the post, which is likely to cause other problems.
Feb
26
comment Clone a Post Tite and Custom Field into Custom Post type
Hey, i have updated some untested code, i think it should work. Also note that it will work on newly created posts, not the old ones.
Feb
26
revised Clone a Post Tite and Custom Field into Custom Post type
updated code based on new stuff from comment
Feb
25
comment Clone a Post Tite and Custom Field into Custom Post type
save_post will not handle any programmatically applied updates, so if that's a concern, you might want to look into the hooks available in function update_metadata()
Feb
25
comment Clone a Post Tite and Custom Field into Custom Post type
That should be possible using a save_post hook. But you also need to establish a link between the earlier post and the newly created post. You could use update_post_meta( $post_id, '_surl_post_id', $p_id ) to save the new post's id with the old post's meta. Then create a separate hook on save_post action, which will check if the meta was updated and update the other post's meta if it did.
Feb
24
answered Using wordpress function to retrieve data
Feb
24
answered Display Page featured Image as well as Posts featured Image
Feb
24
answered Clone a Post Tite and Custom Field into Custom Post type
Feb
4
awarded  Enlightened
Feb
4
awarded  Nice Answer
Oct
15
awarded  Yearling
Mar
22
awarded  Nice Answer
Oct
15
awarded  Yearling
Jan
31
answered send email to all registered users when post expires
Jan
21
awarded  Constituent
Jan
13
awarded  Caucus