Get original value in save_post action hooka

This is the solution: add_action(‘pre_post_update’, function($post_id, $post_data) { global $original_post; $original_post = get_post($post_id); }, 10, 2); add_action( ‘save_post_’, function($post_id, $post, $update) { global $original_post; $original_post->post_title; // original post title $post->post_title; // new post title }, 10, 3);

How to change lost password email text using custom plugin wordpress?

The filter for the Message that is sent to reset your password is retrieve_password_message. You use it like this: add_filter(‘retrieve_password_message’,’my_awesome_new_password_reset_email’,10,4); function my_awesome_new_password_reset_email($message, $key, $user_login, $user_data){ $message = “Hey, you need a new Password? Click here: “.site_url( “wp-login.php?action=rp&key=$key&login=”.rawurlencode( $user_login ),’login’).”!”; return $message; } $message is the original E-Mail Body, $key is the reset password key, $user_login … Read more

do_action not working in loop

You are calling do_action before adding it. Move add_action up, before HTML part. Second, your action function ltc_generate_input_fields’ expects$fieldsvalue, however yourdo_action` does not pass this parameter, so change it to do_action($section_actions, $fields);