Code to execute in "save_post action" not work

This topic contains 4 reply and 3 voices, and was last updated by Salih 10 years, 4 months ago
Viewing 4 Posts - 1 through 4 (of 4 total)
Author Posts
September 10, 2013 at 6:19 pm 7988
Salih Hi I have found this code to upload and set as feature the image of the links. This code works when I add a post with WPbackend, but not work with WPUF I think is the same problem that I have in this thread. I think the problem i "save_post" action, I tried with this code but not work Also I tried modified this:
add_action('save_post', 'wds_video_sideload_post_thumb');
with this:
add_action('wpuf_add_post_after_insert', 'wds_video_sideload_post_thumb');
but not work Thanks and greetings
September 11, 2013 at 9:19 am 8004
Tareq Hasan Tareq Hasan

You understand what you are doing right?

In that code snippet, they are using the global $post which will not work in the action hook in WPUF. Instead, the WPUF action hook gets an $post_id as a parameter. So replacing $post->ID with $post_id should fix it.

September 11, 2013 at 6:59 pm 8022
ggsalas ggsalas

Thanks @Tareaq, now works well. I share the code in this pastebin: http://pastebin.com/2fsiXNiw

Greetings

July 13, 2014 at 4:25 pm 23469
Salih Salih

Hi guys, I have the same issue with video thumbnail plugin. I just wanted to know where I need to insert this code or which code to replace. I have never used action hooks so I need a basic understanding (if this is actually what we are using here).

There is also this other thread http://wedevs.com/support/topic/running-action-hook-on-frontend-post/ and I just wanted to know which one I need to apply and how.

Thanks guys!

July 19, 2014 at 7:23 am 23768
Salih Salih

Bump

Viewing 4 Posts - 1 through 4 (of 4 total)