delay function on publish?

publish_post is called after post is published! So, you already got covered. but if you want to run an action after a certain time of the post is published, it’s better to write a cron job. For example, if you need to run the function after 5 minutes of the post is published, you need … Read more

Changing widget options via the functions.php when there are no hooks

After some digging, I’ve arrived at a solution (explained in the comments) – function change_widget_configuration() { $options = get_option(‘widget_some-widget’); // retrieve the options for all occurrences of the named widget* $widget_number = 3; // the id number of the specific occurrence of the widget whose options you wish to alter (this can be obtained simply … Read more

Getting User email on logout. wp_logout

wp_get_current_user() will never work in this hook, because, wp_logout action fires after user is logged out: session destroyed, cookies cleared and current user is set to 0. But wp_logout action recieves $user_id. I will give you a working example, because I do not familiar with your custom functions. //pass $user_id as argument function mmd_JudgeLogoutCheck($user_id) { … Read more