• hI, we’re using this plugin and we love it. The only issue that we found is that not all revisions changes are showing on the UI on the backend of WP. We need that working and we’re willing to pay/hire you for that. Is that something that you can (or willing to ) do? Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi Nettra,

    This is something we’re also looking at. Our custom post revision screen
    e.g. revision.php?revision=225
    doesn’t show the additional post meta info – which is understandable.

    Anyone know of a solution to this? Any luck your end Nettra?

    I found this page:
    https://johnblackbourn.com/post-meta-revisions-wordpress

    which shows this:

    Displaying the meta field on the revisions screen

    For this we need to hook into the _wp_post_revision_fields action to tell WordPress which fields to show on the revisions screen, and hook into the _wp_post_revision_field_my_meta filter to display the meta field. Note that the filter name is specific for each field, so you’ll need to add a hook for each of your meta fields in the format _wp_post_revision_field_{field_name}.

    
    function my_plugin_revision_fields( $fields ) {
    
    	$fields['my_meta'] = 'My Meta';
    	return $fields;
    
    }
    add_filter( '_wp_post_revision_fields', 'my_plugin_revision_fields' );
    
    function my_plugin_revision_field( $value, $field ) {
    
    	global $revision;
    	return get_metadata( 'post', $revision->ID, $field, true );
    
    }
    add_filter( '_wp_post_revision_field_my_meta', 'my_plugin_revision_field', 10, 2 );

    However, I simply cannot get it to work. For example with meta field “competence” it should be :

    
    function my_plugin_revision_fields( $fields ) {
    
    	$fields['competence'] = 'Competence';
    	return $fields;
    
    }
    add_filter( '_wp_post_revision_fields', 'my_plugin_revision_fields' );
    
    function my_plugin_revision_field( $value, $field ) {
    
    	global $revision;
    	return get_metadata( 'post', $revision->ID, $field, true );
    
    }
    add_filter( '_wp_post_revision_field_competence', 'my_plugin_revision_field', 10, 2 );

    if I’m reading it right, but nothing changes on the revisions.php screen. Let me know if you have any luck….

    Alex

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Revisions UI addition’ is closed to new replies.