New answers tagged

0

Quite stupid solution, but works: function afterPostUpdated($meta_id, $post_id, $meta_key='', $meta_value=''){ if($meta_key=='_edit_lock') { if($_GET['message']==1) { // Your code here // } } } add_action('updated_post_meta', 'afterPostUpdated', 10, 4);


1

The post object is passed by reference as the second parameter of the save_post action (do_action ( 'save_post', int $post_ID, WP_Post $post, bool $update ). You can use this post object to get the post date and author from. You can try the following: (NOTE: The code is untested) add_action( 'save_post', 'wpse_214927_alter_title', 10, 2 ); function ...


0

Use the function get_post_meta($post_id) to get the post meta data. Hope this helps.


1

The original post_date is saved post_date and post_date_gmt. And modification dates are saved on post_modified_date and post_modified_date_gmt. So you never lose your original creation date.



Top 50 recent answers are included