Can wp_insert_post_data filter be used to save custom field data?

You can access the raw $_POST data from the wp_insert_post_data filter, but there are probably better ways to intercept that data. save_post or similar hook would probably work As you are dealing with post_meta, update_post_meta uses update_metadata which provides the update_{$meta_type}_meta and updated_{$meta_type}_meta filters. Those may be the best for you but your question is … Read more

Strange bug on post/page save

In my experience this happens when you initiate an operation (Save/Update) and then try to leave the page to do something else before the requested operation has completed. Next time you save/update a post wait until the edit page returns to normal and displays your content. Then navigate away from the edit page. Chances are … Read more

How can I edit comment meta value before it is saved?

You can use “save_post” action-hook Add the code below into functions.php and enchance with your comment_meta code. function update_comments_meta( $post_id ) { // Do whatever add/update_comment_meta code you need } add_action( ‘save_post’, ‘update_comments_meta’ ); UPDATE. As an example i’ve attach code below. It performs on post save/update action fired. Code gets current post comments (all) … Read more

Help using acf/save_post hook to connect to Untappd API and update_field [closed]

It’s because your require_once ‘Pintlabs/Service/Untappd.php’; is relative to “current” file and should be absolute path. I don’t know where are you using this hook but depending on location it should look something like this: ABSPATH is your wordpress root dir and ‘custom-path’ should be a path to Pintlabs dir require_once ABSPATH.’custom-path/’.’Pintlabs/Service/Untappd.php’; get_template_directory() if you use … Read more

Save post in another table

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.

Updating user meta on save post

You could query all the authors and loop through to update their dates. The below query pulls all users who have a programme_id of the current post_id and allocates an array of their IDs. You can then loop through to update whatever is necessary: /** Save Custom Metaboxes **/ function save_custom_meta_boxes( $post_id, $post ) { … Read more