filter
Filters whether a viewer may see the history timeline of an object. Defaults to false, so a domain must allow it.
Parameters of davo_history_can_view Parameter Type Description $can_view bool Whether the viewer may see it. $object_type string Kind of object the history belongs to. $object_id int Object ID. $viewer_id int Viewing user ID, or 0 for a guest.
Returns bool
add_filter Copyadd_filter ( 'davo_history_can_view' , 'my_filter_callback' , 10 , 4 );
/**
* @param bool $can_view
* @param string $object_type
* @param int $object_id
* @param int $viewer_id
*/
function my_filter_callback ( $can_view , $object_type , $object_id , $viewer_id ) {
// Change $can_view as needed, then return it.
return $can_view ;
}src/domains/history/routes.php:228
filter
Filters whether an author is hidden in the history timeline of an object. Defaults to false.
Parameters of davo_history_mask_author Parameter Type Description $mask bool Whether to hide the author. $object_type string Kind of object the history belongs to. $object_id int Object ID. $user_id int The author's user ID.
Returns bool
add_filter Copyadd_filter ( 'davo_history_mask_author' , 'my_filter_callback' , 10 , 4 );
/**
* @param bool $mask
* @param string $object_type
* @param int $object_id
* @param int $user_id
*/
function my_filter_callback ( $mask , $object_type , $object_id , $user_id ) {
// Change $mask as needed, then return it.
return $mask ;
}src/domains/history/routes.php:152
filter
Filter the reference namespace a history object_type resolves against during migration, for an object_type this provider doesn't specifically recognize ('question'/'answer' are handled directly).
Parameters of davo_history_migration_object_namespace Parameter Type Description $namespace string Default namespace (wp_post). $object_type string The unrecognized object_type value.
add_filter Copyadd_filter ( 'davo_history_migration_object_namespace' , 'my_filter_callback' , 10 , 2 );
/**
* @param string $namespace
* @param string $object_type
*/
function my_filter_callback ( $namespace , $object_type ) {
// Change $namespace as needed, then return it.
return $namespace ;
}src/domains/history/migration-provider.php:573
action
Fires after a new history revision has been fully recorded.
Parameters of davo_history_recorded Parameter Type Description $revision_id int New revision ID. $object_type string Registered object type slug. $object_id int Object's post/entity ID. $user_id int Acting user ID. $diffs array field_key => { change_type, payload } for every field that changed.
add_action Copyadd_action ( 'davo_history_recorded' , 'my_action_callback' , 10 , 5 );
/**
* @param int $revision_id
* @param string $object_type
* @param int $object_id
* @param int $user_id
* @param array $diffs
*/
function my_action_callback ( $revision_id , $object_type , $object_id , $user_id , $diffs ) {
// Your code here.
}src/domains/history/services/recorder.php:118
action
Fires once at init (priority 5) so every domain can register its trackable object types and fields before anything reads the registry. See History_Registry::register_object_type()/register_field().
Parameters of davo_register_history_fields Parameter Type Description $registry History_Registry Shared registry instance.
add_action Copyadd_action ( 'davo_register_history_fields' , 'my_action_callback' , 10 , 1 );
/**
* @param History_Registry $registry
*/
function my_action_callback ( $registry ) {
// Your code here.
}src/domains/history/initializer.php:108