@@ -196,38 +196,29 @@ public function callback_post_updated( $post_id, $posts_after, $posts_before ) {
196196			return ;
197197		}
198198
199- 		$ _newmaybe_unserialize ( $ posts_afterpost_content  );
200- 		$ _oldmaybe_unserialize ( $ posts_beforepost_content  );
199+ 		$ _newmaybe_unserialize ( $ posts_afterpost_content  ) ??  array () ;
200+ 		$ _oldmaybe_unserialize ( $ posts_beforepost_content  ) ??  array () ;
201201
202202		// Get updated settings. 
203- 		// Extract "location" property it will be compare separately. 
204- 		$ _new_locationacf_extract_var ( $ _new'location '  );
205- 		$ _old_locationacf_extract_var ( $ _old'location '  );
206- 
207- 		$ updatedarray_diff_assoc ( $ _new$ _old
208- 
209- 		// Check if "location" changed. 
210- 		if  ( $ _new_location$ _old_location
211- 			$ updated'location ' ] = $ _new_location
212- 			$ _old'location ' ]    = $ _old_location
213- 		}
203+ 		$ updated_keys$ this get_changed_keys ( $ _new$ _old
204+ 		$ updated_keysempty ( $ updated_keysarray_keys ( $ _new$ updated_keys
214205
215206		// Process updated properties. 
216- 		if  ( ! empty ( $ updated
217- 			foreach  ( $ updatedas  $ prop$ value
218- 				$ old_valuenull ;
219- 				if  ( empty ( $ valueis_array ( $ _oldempty ( $ _old$ prop
220- 					$ action'deleted ' ;
221- 					$ old_value$ _old$ prop
222- 				} else  {
223- 					$ action'updated ' ;
224- 				}
225- 
226- 				$ this log_prop ( $ action$ post_id$ posts_after$ prop$ value$ old_value
207+ 		foreach  ( $ updated_keysas  $ prop
208+ 			$ old_valuenull ;
209+ 			$ value$ _new$ prop
210+ 			if  ( empty ( $ valueis_array ( $ _oldempty ( $ _old$ prop
211+ 				$ action'deleted ' ;
212+ 				$ old_value$ _old$ prop
213+ 			} else  {
214+ 				$ action'updated ' ;
227215			}
216+ 
217+ 			$ this log_prop ( $ action$ post_id$ posts_after$ prop$ value$ old_value
228218		}
229219	}
230220
221+ 
231222	/** 
232223	 * Logs field/field group property changes (ACF v5 only). 
233224	 * 
0 commit comments